Oscillator / Waveshaper
Stateful FM oscillator with internal smoothing of modulation ratio and modulation index. Use it when ratio and index are moved by param(), automation, or other live controls and the older fm() becomes grainy or crackly.
fm2(), fm21(), and fm22() are independent FM units with separate internal state. Use numbered variants when one formula needs more than one smoothed FM operator at the same time. Additional variants continue as fm23() to fm27().
0.24*fm2(X, 1.0+3.0*param(0), 0.4+6.0*param(1))
0.16*fm21(X, 1.0+2.0*param(0), 0.2+4.0*param(1)) +0.16*fm22(0.5*X, 2.0+3.0*param(2), 0.4+5.0*param(3))
Use fm() for simple static FM tones. Use fm2() when the second or third argument is modulated during playback and you want smoother behavior.