<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;">Woops, certainly meant to include the link: <a href="https://www.musicdsp.org/en/latest/Synthesis/189-fast-exponential-envelope-generator.html">https://www.musicdsp.org/en/latest/Synthesis/189-fast-exponential-envelope-generator.html</a><div><br></div><div>and yes, their usage of log() is just about calculating the rate. </div><div><br></div><div>your version looks to be functionally the same as the one in the link, one multiply and one add. my version has a subtract in there that I apparently don't need and this is, of course, why I asked :) </div><div><br></div><div>Chris <br><div><div><br><blockquote type="cite"><div>On Nov 5, 2025, at 4:48 PM, mskala@northcoastsynthesis.com wrote:</div><br class="Apple-interchange-newline"><div><div>On Wed, 5 Nov 2025, Chris McDowell via Synth-diy wrote:<br><br><blockquote type="cite">output += (target - output) * rate <br></blockquote><br><blockquote type="cite">my question for this deep well of synth experience: is there a better way to<br>do it? I came across a similar strategy on musicdsp.org recently that<br>suggested baking the target into the coefficient, which does indeed save one<br>subtract per iteration with the tradeoff that you have to do more math when<br>changing envelope states. its use of log() (admittedly infrequently) makes<br>me not all that interested, even if that's maybe a little irrational. If I<br></blockquote><br>I don't know what the "similar strategy" you have in mind is.  The way<br>I'm familiar with doing this kind of moving average looks like:<br><br>output += (target*rate)<br>output *= 1/(1+rate)<br><br>You precalculate target*rate when you change the target, and 1/(1+rate)<br>when you change the rate, so it's one add and one multiply, of stored<br>constant values, per ordinary iteration.<br><br>I'm not sure how log() would come into it - maybe if you're trying to<br>choose the rate based on a desired length of time to charge or discharge<br>to a certain point, but that's no more true here than in the original<br>iteration.<br><br>-- <br>Matthew Skala<br>North Coast Synthesis Ltd.</div></div></blockquote></div><br></div></div></body></html>