Ejemplo n.º 1
0
Archivo: lv2.c Proyecto: aelse/setBfree
void initSynth(struct b_instance *inst, double rate) {
  // equivalent to ../src/main.c main()
  unsigned int defaultPreset[9] = {8,8,6, 0,0,0,0, 0,0};

  /* initAll() */
  initToneGenerator (inst->synth, inst->midicfg);
  initVibrato (inst->synth, inst->midicfg);
  initPreamp (inst->preamp, inst->midicfg);
  initReverb (inst->reverb, inst->midicfg, rate);
  initWhirl (inst->whirl, inst->midicfg, rate);
  initRunningConfig(inst->state, inst->midicfg);
  /* end - initAll() */

  initMidiTables(inst->midicfg);

  setDrawBars (inst, 0, defaultPreset);
#if 0
  setDrawBars (inst, 1, defaultPreset);
  setDrawBars (inst, 2, defaultPreset);
#endif

#ifdef DEBUGPRINT
  if (walkProgrammes(inst->progs, 0)) {
    listProgrammes (inst->progs, stderr);
  }
  listCCAssignments(inst->midicfg, stderr);
#endif
}
Ejemplo n.º 2
0
/*
 * Ask each module to initialize itself.
 */
static void initAll () {
  fprintf (stderr, "init.. ");
  fprintf (stderr, "Audio : ");
  fflush (stderr);

  /* Open the JACK connection and get samplerate. */
  if (open_jack()) {
    perror ("could not connect to JACK.");
    exit(1);
  }

  fprintf (stderr, "Oscillators : ");
  fflush (stderr);
  initToneGenerator (inst.synth, inst.midicfg);

  fprintf (stderr, "Scanner : ");
  fflush (stderr);
  initVibrato (inst.synth, inst.midicfg);

  fprintf (stderr, "Overdrive : ");
  fflush (stderr);
  initPreamp (inst.preamp, inst.midicfg);

  fprintf (stderr, "Reverb : ");
  fflush (stderr);
  initReverb (inst.reverb, inst.midicfg, SampleRateD);

  fprintf (stderr, "Whirl : ");
  fflush (stderr);
  initWhirl (inst.whirl, inst.midicfg, SampleRateD);

#ifdef HAVE_ZITACONVOLVE
  fprintf (stderr, "Convolve : ");
  fflush (stderr);
  int s_policy= 0;
  struct sched_param s_param;

  memset (&s_param, 0, sizeof(struct sched_param));
  if (jack_client_thread_id(j_client)) {
    pthread_getschedparam(jack_client_thread_id(j_client), &s_policy, &s_param);
  } else {
    fprintf(stderr, "zita-convolver: not using RT scheduling\n");
  }
  initConvolution(NULL, inst.midicfg, AUDIO_CHANNELS, BUFFER_SIZE_SAMPLES, s_param.sched_priority, s_policy);
#endif

  fprintf (stderr, "RC : ");
  fflush (stderr);
  initRunningConfig(inst.state, inst.midicfg);

  fprintf (stderr, "..done.\n");
}
Ejemplo n.º 3
0
static LV2_Handle
instantiate(const LV2_Descriptor*     descriptor,
            double                    rate,
            const char*               bundle_path,
            const LV2_Feature* const* features)
{
  B3R* b3r = (B3R*)calloc(1, sizeof(B3R));
  if(!b3r) { return NULL ;}

  if (!(b3r->instance = allocReverb())) {
    free(b3r);
    return NULL;
  }

  initReverb(b3r->instance, NULL, rate);

  return (LV2_Handle)b3r;
}