Beispiel #1
0
/*
 * LFO output
 */
void
EffectLFO::effectlfoout (float * outl, float * outr)
{
    float out;

    out = getlfoshape (xl);
    //if ((lfotype == 0) || (lfotype == 1))         //What was that for?
    out *= (ampl1 + xl * (ampl2 - ampl1));
    xl += incx;
    if (xl > 1.0) {
        xl -= 1.0f;
        ampl1 = ampl2;
        ampl2 = (1.0f - lfornd) + lfornd * (float)RND;
    };
    if(lfotype==8) out = scale*x0;  //fractal parameter
    *outl = (out + 1.0f) * 0.5f;


    if(lfotype==8) out = scale*y0;  //fractal parameter
    else out = getlfoshape (xr);

    //if ((lfotype == 0) || (lfotype == 1))
    out *= (ampr1 + xr * (ampr2 - ampr1));
    xr += incx;
    if (xr > 1.0) {
        xr -= 1.0f;
        ampr1 = ampr2;
        ampr2 = (1.0f - lfornd) + lfornd * (float)RND;
    };
    *outr = (out + 1.0f) * 0.5f;
};
Beispiel #2
0
//LFO output
void EffectLFO::effectlfoout(float *outl, float *outr)
{
    float out;

    out = getlfoshape(xl);
    if((lfotype == 0) || (lfotype == 1))
        out *= (ampl1 + xl * (ampl2 - ampl1));
    xl += incx;
    if(xl > 1.0f) {
        xl   -= 1.0f;
        ampl1 = ampl2;
        ampl2 = (1.0f - lfornd) + lfornd * RND;
    }
    *outl = (out + 1.0f) * 0.5f;

    out = getlfoshape(xr);
    if((lfotype == 0) || (lfotype == 1))
        out *= (ampr1 + xr * (ampr2 - ampr1));
    xr += incx;
    if(xr > 1.0f) {
        xr   -= 1.0f;
        ampr1 = ampr2;
        ampr2 = (1.0f - lfornd) + lfornd * RND;
    }
    *outr = (out + 1.0f) * 0.5f;
}
Beispiel #3
0
/*
 * LFO output
 */
void
effectlfoout (ZChorus_t * s, float * outl, float * outr, unsigned long count)
{
  float out;

  LADSPA_Data lfornd = *(s->lfornd);
  LADSPA_Data Pstereo = *(s->Pstereo);
  LADSPA_Data lfofreq = *(s->lfofreq);
  LADSPA_Data PLFOtype = *(s->PLFOtype);

  if (Pstereo != s->lfo.stereo)
     {
       s->lfo.stereo = Pstereo;
       s->lfo.xr=fmodf(s->lfo.xl+s->lfo.stereo+1.0,1.0);
     }


  s->lfo.lfofreq=(powf(2,lfofreq*10.0)-1.0)*0.03;
  s->lfo.incx = fabsf (s->lfo.lfofreq) * (float) count / (float) s->SAMPLE_RATE;
  if (s->lfo.incx > 0.49999999)  s->lfo.incx = 0.499999999;		//Limit the Frequency


  out = getlfoshape (s, s->lfo.xl);
  if ((PLFOtype == 0) || (PLFOtype == 1))
    out *= (s->lfo.ampl1 + s->lfo.xl * (s->lfo.ampl2 - s->lfo.ampl1));
  s->lfo.xl += s->lfo.incx;
  if (s->lfo.xl > 1.0)
    {
      s->lfo.xl -= 1.0;
      s->lfo.ampl1 = s->lfo.ampl2;
      s->lfo.ampl2 = (1.0 - lfornd) + lfornd * RND;
    };
  *outl = (out + 1.0) * 0.5;

  out = getlfoshape (s, s->lfo.xr);
  if ((PLFOtype == 0) || (PLFOtype == 1))
    out *= (s->lfo.ampr1 + s->lfo.xr * (s->lfo.ampr2 - s->lfo.ampr1));
  s->lfo.xr += s->lfo.incx;
  if (s->lfo.xr > 1.0)
    {
      s->lfo.xr -= 1.0;
      s->lfo.ampr1 = s->lfo.ampr2;
      s->lfo.ampr2 = (1.0 - lfornd) + lfornd * RND;
    };
  *outr = (out + 1.0) * 0.5;
};