Example #1
0
osc_t *new_osc_constant(int val)
{
  osc_t *osc = create_osc(otyp_Constant);
  if (!osc)
    return NULL;
        
  osc->u.oconstant.val = val;
  return osc;
}
osc_t *new_osc_constant(stonerview_state *st, int val)
{
  osc_t *osc = create_osc(st, otyp_Constant);
  if (!osc)
    return NULL;
        
  osc->u.oconstant.val = val;
  return osc;
}
Example #3
0
osc_t *new_osc_linear(osc_t *base, osc_t *diff)
{
  osc_t *osc = create_osc(otyp_Linear);
  if (!osc)
    return NULL;

  osc->u.olinear.base = base;
  osc->u.olinear.diff = diff;
    
  return osc;
}
osc_t *new_osc_linear(stonerview_state *st, osc_t *base, osc_t *diff)
{
  osc_t *osc = create_osc(st, otyp_Linear);
  if (!osc)
    return NULL;

  osc->u.olinear.base = base;
  osc->u.olinear.diff = diff;
    
  return osc;
}
Example #5
0
osc_t *new_osc_phaser(int phaselen)
{
  osc_t *osc = create_osc(otyp_Phaser);
  if (!osc)
    return NULL;
        
  osc->u.ophaser.phaselen = phaselen;

  osc->u.ophaser.count = 0;
  /* Pick a random phase to start in. */
  osc->u.ophaser.curphase = rand_range(0, NUM_PHASES-1);

  return osc;
}
Example #6
0
osc_t *new_osc_multiplex(osc_t *sel, osc_t *ox0, osc_t *ox1, osc_t *ox2, osc_t *ox3)
{
  osc_t *osc = create_osc(otyp_Multiplex);
  if (!osc)
    return NULL;
    
  osc->u.omultiplex.sel = sel;
  osc->u.omultiplex.val[0] = ox0;
  osc->u.omultiplex.val[1] = ox1;
  osc->u.omultiplex.val[2] = ox2;
  osc->u.omultiplex.val[3] = ox3;
    
  return osc;
}
Example #7
0
osc_t *new_osc_velowrap(int min, int max, osc_t *step)
{
  osc_t *osc = create_osc(otyp_VeloWrap);
  if (!osc)
    return NULL;
        
  osc->u.ovelowrap.min = min;
  osc->u.ovelowrap.max = max;
  osc->u.ovelowrap.step = step;
    
  /* Pick a random initial value between min and max. */
  osc->u.ovelowrap.val = rand_range(min, max);
    
  return osc;
}
Example #8
0
osc_t *new_osc_randphaser(int minphaselen, int maxphaselen)
{
  osc_t *osc = create_osc(otyp_RandPhaser);
  if (!osc)
    return NULL;
        
  osc->u.orandphaser.minphaselen = minphaselen;
  osc->u.orandphaser.maxphaselen = maxphaselen;

  osc->u.orandphaser.count = 0;
  /* Pick a random phaselen to start with. */
  osc->u.orandphaser.curphaselen = rand_range(minphaselen, maxphaselen);
  /* Pick a random phase to start in. */
  osc->u.orandphaser.curphase = rand_range(0, NUM_PHASES-1);

  return osc;
}
Example #9
0
osc_t *new_osc_buffer(osc_t *val)
{
  int ix;
  osc_t *osc = create_osc(otyp_Buffer);
  if (!osc)
    return NULL;
    
  osc->u.obuffer.val = val;
  osc->u.obuffer.firstel = NUM_ELS-1;
    
  /* The last N values are stored in a ring buffer, which we must initialize
     here. */
  for (ix=0; ix<NUM_ELS; ix++) {
    osc->u.obuffer.el[ix] = osc_get(val, 0);
  }

  return osc;
}
osc_t *new_osc_buffer(stonerview_state *st, osc_t *val)
{
  int ix;
  osc_t *osc = create_osc(st, otyp_Buffer);
  if (!osc)
    return NULL;
    
  osc->u.obuffer.val = val;
  osc->u.obuffer.firstel = st->num_els-1;
    
  /* The last N values are stored in a ring buffer, which we must initialize
     here. */
  for (ix=0; ix<st->num_els; ix++) {
    osc->u.obuffer.el[ix] = osc_get(st, val, 0);
  }

  return osc;
}
Example #11
0
char *
exciterConfigure (LADSPA_Handle instance, const char *key, const char *value)
{

  if (!strcmp (key, "load"))
    {
      return NULL;
    }

  if (!strcmp (key, "url"))
    {
      create_osc (instance, value);
      return NULL;
    }


  return strdup ("error: unrecognized configure key");
}
Example #12
0
osc_t *new_osc_wrap(int min, int max, int step)
{
  int diff;
  osc_t *osc = create_osc(otyp_Wrap);
  if (!osc)
    return NULL;
        
  osc->u.owrap.min = min;
  osc->u.owrap.max = max;
  osc->u.owrap.step = step;
    
  /* Pick a random initial value between min and max. */
  if (step < 0)
    step = (-step);
  diff = (max-min) / step;
  osc->u.owrap.val = min + step * rand_range(0, diff-1);
    
  return osc;
}
osc_t *new_osc_bounce(stonerview_state *st, int min, int max, int step)
{
  int diff;
  osc_t *osc = create_osc(st, otyp_Bounce);
  if (!osc)
    return NULL;
        
  osc->u.obounce.min = min;
  osc->u.obounce.max = max;
  osc->u.obounce.step = step;
    
  /* Pick a random initial value between min and max. */
  if (step < 0)
    step = (-step);
  diff = (max-min) / step;
  osc->u.obounce.val = min + step * rand_range(0, diff-1);
    
  return osc;
}
Example #14
0
char *
holharmConfigure (LADSPA_Handle instance, const char *key, const char *value)
{

//  holharm_t *harmonizer = (holharm_t *) instance;


  if (!strcmp (key, "load"))
    {
      return NULL;
    }

  if (!strcmp (key, "url"))
    {
      create_osc (instance, value);
      return NULL;
    }


  return strdup ("error: unrecognized configure key");
}