Пример #1
0
/*
 * Instantiate /classes/.
 */
static void allocAll () {
  if (! (inst.state = allocRunningConfig())) {
    fprintf (stderr, "FATAL: memory allocation failed for state memory.\n");
    exit(1);
  }
  if (! (inst.progs = allocProgs())) {
    fprintf (stderr, "FATAL: memory allocation failed for program config.\n");
    exit(1);
  }
  if (! (inst.reverb = allocReverb())) {
    fprintf (stderr, "FATAL: memory allocation failed for reverb.\n");
    exit(1);
  }
  if (! (inst.whirl = allocWhirl())) {
    fprintf (stderr, "FATAL: memory allocation failed for whirl.\n");
    exit(1);
  }
  if (! (inst.synth = allocTonegen())) {
    fprintf (stderr, "FATAL: memory allocation failed for tonegen.\n");
    exit(1);
  }
  if (! (inst.midicfg = allocMidiCfg(inst.state))) {
    fprintf (stderr, "FATAL: memory allocation failed for midi config.\n");
    exit(1);
  }
  if (! (inst.preamp = allocPreamp())) {
    fprintf (stderr, "FATAL: memory allocation failed for midi config.\n");
    exit(1);
  }
}
Пример #2
0
void allocSynth(struct b_instance *inst) {
  inst->state = allocRunningConfig();
  inst->progs = allocProgs();
  inst->reverb = allocReverb();
  inst->whirl = allocWhirl();
  inst->midicfg = allocMidiCfg(inst->state);
  inst->synth = allocTonegen();
  inst->preamp = allocPreamp();

  initControllerTable (inst->midicfg);
#if 1
  midiPrimeControllerMapping (inst->midicfg);
#endif

}
Пример #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;
}