Version 2.01

This commit is contained in:
Gary Scavone
2013-09-25 11:17:56 +02:00
committed by Stephen Sinclair
parent 6485746ee9
commit ea749b71d2
223 changed files with 12125 additions and 4552 deletions

View File

@@ -22,27 +22,32 @@ FM4Alg4 :: FM4Alg4() : FM4Op()
/* we still don't know what they will be. */
}
FM4Alg4 :: ~FM4Alg4()
{
}
MY_FLOAT FM4Alg4 :: tick()
{
MY_FLOAT temp;
temp = vibWave->tick() * modDepth * 0.2;
waves[0]->setFreq(baseFreq * (1.0 + temp) * ratios[0]);
waves[1]->setFreq(baseFreq * (1.0 + temp) * ratios[1]);
waves[2]->setFreq(baseFreq * (1.0 + temp) * ratios[2]);
waves[3]->setFreq(baseFreq * (1.0 + temp) * ratios[3]);
temp = vibWave->tick() * modDepth * (MY_FLOAT) 0.2;
waves[0]->setFreq(baseFreq * ((MY_FLOAT) 1.0 + temp) * ratios[0]);
waves[1]->setFreq(baseFreq * ((MY_FLOAT) 1.0 + temp) * ratios[1]);
waves[2]->setFreq(baseFreq * ((MY_FLOAT) 1.0 + temp) * ratios[2]);
waves[3]->setFreq(baseFreq * ((MY_FLOAT) 1.0 + temp) * ratios[3]);
waves[3]->addPhaseOffset(twozero->lastOut());
temp = gains[3] * adsr[3]->tick() * waves[3]->tick();
twozero->tick(temp);
waves[2]->addPhaseOffset(temp);
temp = (1.0 - (control2 * 0.5)) * gains[2] * adsr[2]->tick() * waves[2]->tick();
temp += control2 * 0.5 * gains[1] * adsr[1]->tick() * waves[1]->tick();
temp = ((MY_FLOAT) 1.0 - (control2 * (MY_FLOAT) 0.5)) *
gains[2] * adsr[2]->tick() * waves[2]->tick();
temp += control2 * (MY_FLOAT) 0.5 * gains[1] * adsr[1]->tick() * waves[1]->tick();
temp = temp * control1;
waves[0]->addPhaseOffset(temp);
temp = gains[0] * adsr[0]->tick() * waves[0]->tick();
lastOutput = temp * 0.5;
lastOutput = temp * (MY_FLOAT) 0.5;
return lastOutput;
}