[sdiy] software / firmware envelopes in C (or anything else)
Chris McDowell
declareupdate at gmail.com
Wed Nov 5 22:55:32 CET 2025
Howdy list,
I've been thinking about this for about a decade. I use what the web calls a "leaky integrator" all over my synth code. I first used it as the basis of an envelope some 15 years ago when mimicking the Moog Rogue's strategy of providing a target and a "rate" to a lowpass filter built around a 3080 OTA. On an MCU with an FPU, it works pretty much great. the basics:
output += (target - output) * rate
where target changes based on what stage of an envelope we're in and rate is some small float coefficient calculated based on desired stage length in milliseconds.
my question for this deep well of synth experience: is there a better way to do it? I came across a similar strategy on musicdsp.org <http://musicdsp.org/> recently that suggested baking the target into the coefficient, which does indeed save one subtract per iteration with the tradeoff that you have to do more math when changing envelope states. its use of log() (admittedly infrequently) makes me not all that interested, even if that's maybe a little irrational. If I find myself num_envelopes cycles away from meeting a timing deadline, I'll consider it...
I'm familiar with Tom Wiltshire's envelope chip, which is another cool and very different strategy. What else is out there?!
Cheers,
Chris McDowell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20251105/4205ac70/attachment.htm>
More information about the Synth-diy
mailing list