[sdiy] software / firmware envelopes in C (or anything else)
Chris McDowell
declareupdate at gmail.com
Thu Nov 6 19:38:37 CET 2025
My use of the term "side effects" was sloppy, because I think there's only one and it is the primary effect. An envelope through a VCA can jump abruptly, where this one will only jump as abruptly as the envelope stage rates allow. It will only ever ramp toward new targets.
If it's a monophonic implementation and in a legato mode with previous notes held, new notes cause the output to ramp toward the new sustain value at the rate of decay. In a non-legato mode, new notes cause the output to ramp toward velocity * 2.0 at the rate of attack.
If it is a polyphonic synth, it only comes in to play when a voice is stolen. The volume or cutoff or whatever of that voice will ramp toward velocity * 2.0 from wherever it happens to be.
I had thought for a bit that adding slew to a velocity signal controlling a VCA could be one solution, but what rate to choose for that slew is unclear and it interacts with the rest of the envelope output. I like the simplicity of my envelopes only ever operating via targets and rates.
This is a limitation I don't love in the Prophet REV2, for example. It welcomes pretty flexible velocity modulation, but it is always an abrupt effect. I have not consciously encountered a velocity implementation like mine in the wild.
Chris McDowell
> On Nov 6, 2025, at 8:11 AM, Tom Wiltshire <tom at electricdruid.net> wrote:
>
>
>
>> On 6 Nov 2025, at 12:44, Chris McDowell via Synth-diy <synth-diy at synth-diy.org> wrote:
>>
>> When velocity is involved, I set the attack target to 2 * velocity, and the sustain level to sustain * velocity, instead of multiplying the envelope output by velocity. this has some side effects but feels a lot more natural to me
>
> Interesting. What's the difference? At first glance, that sounds like it would be the same (at least for constant-time envelopes - I can see constant-rate envelopes would change).
>
>
More information about the Synth-diy
mailing list