Sun Jul 6 22:02:46 EDT 2014
Envelopes / LFO
Core routine is exponential decay
state += a (target - state)
Does this need 24 bit states? As long as there is enough resolution
in the shortest period settings to get it going that should not be
So the core routine here is a 16 x 16 -> 16 fixed point mul, possibly
8 bit is enough for the a coeff.
There is double-hacks.rkt
0.0pole+ computes 0.ab x 1.0z
0.0pole- computes 0.ab x 1.Fz
Other variants should be easy to add for LFO sine waves.
Problem is that these don't start from low values. Maybe add a little
fudge to let them increment/decrement anyway in case they don't?
Or alternatively use some kind of ad-hoc floating point approach to
prescale / postscale the states?
Basically, we can't ever gain more than one bit so conditionally
shifting whenever the top or guard bit changes sign might work.