<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><blockquote type="cite"><div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">If you've got an FPU, does it really matter?</div></blockquote><div><br></div>Eh, not really! Certainly not if I have headroom, but I don't always. <div><br></div><div>I wonder about it here because it's not something you can easily get feedback on at the pub, as you all know, and because in some applications like a polyphonic FM synth on an STM32G431, the envelopes operations are happening more than any others. shaving off one operation really could make a difference with 32+ envelopes going, assuming the compiler isn't already doing it for me. </div><div><br></div><div><blockquote type="cite"><div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">a chip that doesn't even have a *multiply*</div></blockquote><div><br></div>and indeed you sir are a wild man, hats off. <br><div><br></div><div>Chris <br><div><br><blockquote type="cite"><div>On Nov 5, 2025, at 5:16 PM, Tom Wiltshire <tom@electricdruid.net> wrote:</div><br class="Apple-interchange-newline"><div><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">If you've got an FPU, does it really matter? That seems like a simple enough sum for hardware of that level.<div><div><br></div><div>You mentioned my code, and I had to find a different way because I was using a chip that doesn't even have a *multiply*, let alone an FPU. Hence the entirely different approach.</div><div><br></div><div>FWIW, Ear Level have the best articles about both the basic filter and using it to generate envelopes, but if you've been looking into it, you'll have seen them:</div><div><br></div><div><a href="https://www.earlevel.com/main/2012/12/15/a-one-pole-filter/">https://www.earlevel.com/main/2012/12/15/a-one-pole-filter/</a></div><div><a href="https://www.earlevel.com/main/2013/06/01/envelope-generators/">https://www.earlevel.com/main/2013/06/01/envelope-generators/</a></div><div><br></div><div>HTH,</div><div>Tom</div><div><br></div><div><br></div><div><br></div><div><div><blockquote type="cite"><div>On 5 Nov 2025, at 21:55, Chris McDowell via Synth-diy <<a href="mailto:synth-diy@synth-diy.org">synth-diy@synth-diy.org</a>> wrote:</div><br class="Apple-interchange-newline"><div><meta http-equiv="content-type" content="text/html; charset=us-ascii"><div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Howdy list, <div><br></div><div>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: </div><div><br></div><div>output += (target - output) * rate </div><div><br></div><div>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. </div><div><br></div><div>my question for this deep well of synth experience: is there a better way to do it? I came across a similar strategy on <a href="http://musicdsp.org/">musicdsp.org</a> 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... </div><div><br></div><div>I'm familiar with Tom Wiltshire's envelope chip, which is another cool and very different strategy. What else is out there?! </div><div><br></div><div>Cheers,</div><div>Chris McDowell </div></div>________________________________________________________<br>This is the Synth-diy mailing list<br>Submit email to: <a href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a><br>View archive at: <a href="https://synth-diy.org/pipermail/synth-diy/">https://synth-diy.org/pipermail/synth-diy/</a><br>Check your settings at: <a href="https://synth-diy.org/mailman/listinfo/synth-diy">https://synth-diy.org/mailman/listinfo/synth-diy</a><br>Selling or trading? Use <a href="mailto:marketplace@synth-diy.org">marketplace@synth-diy.org</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div></body></html>