Esempio n. 1
0
EffectLFO::EffectLFO (Parameters *param)
{
	this->param = param;
    xl = 0.0;
    xr = 0.0;
    Pfreq = 40;
    Prandomness = 0;
    PLFOtype = 0;
    Pstereo = 96;

    iperiod = param->fPERIOD/fSAMPLE_RATE;
    h = iperiod;
    a = 10.0f;
    b = 28.0f;
    c = 8.0f / 5.0f;
    scale = 1.0f/36.0f;
    ratediv = 0.1f;
    holdflag = 0;
    tca = iperiod/(iperiod + 0.02);  //20ms default
    tcb = 1.0f - tca;
    rreg = lreg = oldrreg = oldlreg = 0.0f;
    updateparams ();

    ampl1 = (1.0f - lfornd) + lfornd * (float)RND;
    ampl2 = (1.0f - lfornd) + lfornd * (float)RND;
    ampr1 = (1.0f - lfornd) + lfornd * (float)RND;
    ampr2 = (1.0f - lfornd) + lfornd * (float)RND;


};
Esempio n. 2
0
EffectLFO::EffectLFO() :
    Pfreq(40),
    Prandomness(0),
    PLFOtype(0),
    Pstereo(96),
    xl(0.0f),
    xr(0.0f)
{
    updateparams();
    ampl1 = (1 - lfornd) + lfornd * synth->numRandom();
    ampl2 = (1 - lfornd) + lfornd * synth->numRandom();
    ampr1 = (1 - lfornd) + lfornd * synth->numRandom();
    ampr2 = (1 - lfornd) + lfornd * synth->numRandom();
}
Esempio n. 3
0
EffectLFO::EffectLFO(void)
    :Pfreq(40),
     Prandomness(0),
     PLFOtype(0),
     Pstereo(64),
     xl(0.0f),
     xr(0.0f),
     ampl1(RND),
     ampl2(RND),
     ampr1(RND),
     ampr2(RND),
     lfornd(0.0f)
{
    updateparams();
}
Esempio n. 4
0
EffectLFO::EffectLFO(float srate_f, float bufsize_f)
    :Pfreq(40),
      Prandomness(0),
      PLFOtype(0),
      Pstereo(64),
      xl(0.0f),
      xr(0.0f),
      ampl1(RND),
      ampl2(RND),
      ampr1(RND),
      ampr2(RND),
      lfornd(0.0f),
      samplerate_f(srate_f),
      buffersize_f(bufsize_f)
{
    updateparams();
}
Esempio n. 5
0
int HENON::run()
{
	for (int i = 0; i < framesToRun(); i++) {
		if (--branch <= 0) {
			doupdate();
			branch = getSkip();
		}
		if (--branch2 <= 0) {
			updateparams();
			branch2 = cr;
		}

		float out[2];

		float samp;

		x = y + 1 - (a * x * x);
		y = b * z;
		z = x;

		if (x > 1 || x < -1)
			samp = sin(x);
		else
			samp = x;

		out[0] = samp * amp;

		if (outputChannels() == 2) {
			out[1] = out[0] * (1.0f - pan);
			out[0] *= pan;
		}

		rtaddout(out);

		increment();
	}

	return framesToRun();
}