Using the LowPass node to create an Analog Envelope

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))*0.0009+0.999.

The 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.

The *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.

:slight_smile:

Analog Envelope.audulus (6.1 KB)

2 Likes

Just to add to the discussion here’s a variation of the same idea:
37%20AM


This another version of the same approach as @biminiroad’s. Rather than using the built-in low pass node, I constructed one using the z-1 node, so that I could have a filter with a different response rising and falling. Frankly @biminiroad’s approach is significantly more efficient, although this does have the advantage that it will work even if the incoming signal is something other than a square gate. For a gate signal I would definitely prefer @biminiroad’s design, but this still has an application as an asymmetric wave shaper. It never occurred to me to use a crossfade to switch filters. It really demonstrates the value of studying other people’s work. :cowboy_hat_face:
uAR V1.1.audulus (11.3 KB)

2 Likes

Here’s another, using the note distance detector from the slew and attenuators.

I was just investigating the lopass, was thinking variable slew but came up with this by accident. lopassenv


Accidental AR.audulus (61.3 KB)

Not as good sounding as the others but put it up because of the different method

1 Like