![]() |
|
|
|
|
|
Merci à Michel Basset pour avoir beaucoup aidé à l'amélioration de la fidélité sonore. Left/right: Octave shift -2/+2. Sound synthesis source:
//Patch to cutoff or pitch
if (mode) {
flt=filter*(1-((1-lfo)*intlfo));
} else {
pitchlfo=(1-((1-lfo)*intlfo));
flt=filter;
}
//Double LP filter + resonance
float fb = peak + peak/(1.0f - flt);
buf0 = buf0 + flt * ((sine*80) - buf0 + fb * (buf0 - buf1))/2;
buf1 = buf1 + flt * (buf0 - buf1);
// output left and right
*target++ = (smp*pan)/256;
*target++ = (smp*(255-pan))/256;
sine-=(pitch*pitchmod*pitchlfo);
if (sine >= 400.0f) sine = 0.0f;
lfo-=ratelfo;
if (lfo < 0.01f) lfo=1.0f;
|