This is a quick tutorial on the how and why of an analog envelope.
This analog envelope module is based on how many real attack-release envelopes work electronically.
What you do is simple: use a filter to shape a hard on/off gate signal into smooth transitions.
The gate enters the module and sets the alpha of the LowPass node using the A or attack control. It does this because the gate going high switches the Crossfade node input to input b, where I’ve wired the attack knob.
This knob is sent through the expression
sqrt(sqrt(x)) portion shapes the knob’s response to get an even distribution of times across the sweep of the knob. If it wasn’t there, you would spend most of the turn of the knob on a quick setting and only the smallest portion of the high knob values being able to dial in longer attack times.
*0.0009+0.999 portion merely scales and offsets the knob’s value to get some nice values for the filter, which affect how fast and how slow the attack can be. There’s no magic to the values I picked out - I just experimented until I found a range that worked.
Once the gate goes low, the Crossfade node switches over to the R or release knob which then sets a different value for the LowPass node’s alpha input. Now you can see how if you didn’t use this Crossfade set up, you would be stuck with an equal attack/release setting.
Finally, there is a shape button. This allows you to go through one or two filters. If you go through one filter, you get a logarithmic rise and exponential decay, and if you go through both, you get something approximating a linear response.
How did I know that ganging two filters together would make the response more linear? I didn’t! I just tried it and that seems to be what it does. I knew it would change the shape, obviously, but wasn’t sure what it would do until I actually tried it. That’s why experimentation is so valuable and fun in Audulus!
If you want, try using expressions just before the module output to further shape the envelope. You can also try experimenting with adding decay and sustain stages.
Analog Envelope.audulus (6.1 KB)