Modular synthesis intro, part 13: Envelope generators

Tags: musicintro

When we think about what makes one instrument sound different from another, we often think about the spectrum of the sound - harmonic like a violin, inharmonic like a bell, bright with many harmonics like a tack piano, smooth with few harmonics like a rock organ, and so on. But there's another important factor involved in how instruments sound, and it's a deceptively simple one: the amplitude envelope.

Modular synth oscillators usually produce steady signals that don't turn on and off. Unless your notes are all legato (each note playing until the start of the next with no silences in between), you need to turn the signal on and off as the notes start and end, and that's usually accomplished by including a VCA at some point near the output of the patch. If you control the VCA directly with a gate signal, you get sharp on/off transitions and no variation in volume during the note. Only a few real-life instruments sound like that (pipe organs sort of do); so for a more realistic and interesting sound, you have to shape the control voltage going into the VCA, with an envelope generator. The patch usually looks like oscillator, filter, and other audio generators going into the audio input of the VCA; gate control voltage from the sequencer, MIDI interface, or other controller into the envelope generator; and envelope control voltage output from the envelope generator into the control input of the VCA.

Attack, decay, sustain, release

The most traditional kind of synthesizer envelope is called an ADSR envelope: Attack, Decay, Sustain, Release.

At the start of the note, when the gate signal first goes high, the envelope generator's output (usually used to control the note's amplitude) increases rapidly to a peak - the attack phase. As soon as it hits the peak, it starts decreasing again - the decay phase - until it hits a preset level, the sustain level. Then it stays at that level as long as the gate is active. When the gate turns off, the volume falls to zero in the release phase. An ADSR module will normally provide controls for the timing of the attack, decay, and release, and for the level of the sustain (its timing being controlled by the input gate voltage).

ADSR envelopes are popular because they provide a decent simulation of a wide variety of instrument sounds. If you digitize something like a sustained piano note, its amplitude envelope looks very much like what comes from an ADSR: rapid increase at the start as the hammer hits the string, then a decay as the initial strike fades, but then the sound level remains roughly constant, somewhat below the initial peak, for as long as the key (or pedal) remains depressed, finally fading away when the dampers engage. Real pianos cannot sustain notes indefinitely, but allowing the synthesizer to do so as long as the gate signal remains high provides both a reasonable approximation of the acoustic instrument and a useful opportunity for special beyond-acoustic effects.

Not every natural sound really has significant amounts of all four stages. Percussion instruments without a lot of sustain, such as drums, may have an attack followed by a decrease in volume to zero (which might be called a "decay" or a "release" depending on when you think the note has ended). That kind of shape can be achieved by setting the sustain level on an ADSR generator to zero and adjusting the decay, release, or both, to get the desired fall-off in volume. Organs tend to have very little attack, decay, or release (just a sustain), so they can be faked just by feeding a gate signal directly to the VCA without an envelope generator; but using an envelope generator with just a little bit of those phases can often improve realism.

The effects of envelope shape can often be counter-intuitive; there are a lot of perceptual illusions involved. Ultra-fast attacks often sound slower than moderately fast attacks, which leads to a death spiral for some users who think their attacks aren't fast or "snappy" enough, want them even faster, and go to great lengths to speed up their envelopes while becoming less and less satisfied with the results. Going in the other direction with relatively slow attacks and decays can give a sound perceived as "wet" or "drippy," more a change in timbre than volume envelope. Here's one of my own tracks (demo of a module currently under development) with some of that kind of sound. One might be inclined to credit or blame the oscillator or filter for the wetness of these sounds, but it really comes almost entirely from the ADSR envelope.

Pushing the envelope

In my oscilloscope screen-shot, you can see that the output during the attack, decay, and release phases has a bit of curvature: concave down in the attack, concave up in the decay and release. These are usually called "exponential" curves in this context, even though the attack curve is really more like what mathematicians call a logarithmic curve. The underlying cause is that the voltage is coming from a capacitor driven by a fixed voltage through a resistor; in both directions the rate of change slows down as the voltage nears its final target. The general consensus among modular users seems to be that for realistic-sounding amplitude envelopes, this kind of curve (when fed into a linear VCA) is what you want, and it's usually the default. But some ADSR generators offer a choice between these kinds of curves and other shapes (linear, or even concave in the opposite direction). You can also feed the envelope generator's output into an exponential-response VCA, which will give yet another variation in the shapes of the final output.

One intriguing question to ask is exactly what happens if the gate signal should turn off early in the envelope. The usual description of how an ADSR envelope works assumes that the gate signal exists long enough for the attack and decay phases to finish; then the sustain continues for however long, and when the gate goes away during the sustain, the release begins. If the gate turns off during the attack or release, exactly what happens next depends on the design of the envelope generator's internal logic, and often isn't precisely explained in the module's documentation. Many ADSR generators will always complete their attack phase once triggered however briefly, but that is not an absolute given. Some will abort the attack if the gate does not last as long as the complete attack would. After the (possibly-shortened) attack, it's quite likely that the generator will skip to the release phase whenever the gate goes low, skipping or abbreviating the decay; but that, too, is not necessarily a given. Another possibility is to run the attack and decay with the decay going all the way to zero, never hitting the release phase at all. Further complexities may ensue if the gate turns off and then also turns on again before the ADSR cycle is finished. It may be necessary to read the documentation for an individual module carefully, or even run experiments on it, to figure out the details of how it will operate in these kinds of cases.

The most basic kind of ADSR envelope generator just has knobs for controlling the four variables that describe the envelope shape, but it's also common to have control voltage inputs. There's no consensus on whether higher control voltages should make the A, D, and R stages slower (more time) or faster (more speed). Voltage controlled envelopes are nice under sequencer control for simulating different playing techniques, or with an LFO or similar to just keep the sound of the synth changing over time.

Envelopes are not only for amplitude control, either. It's a standard thing in classic subtractive patches to use a second ADSR envelope on the filter cutoff for a more realistic simulation of the typical sound of acoustic instruments, which are brighter and harsher near the start of the note as the higher-frequency vibration modes fade out faster. And if you have different kinds of effects in your patch, an envelope applied to some other kind of control voltage input can create some interesting structure to your notes.

Simplified envelopes

If you specialize in a particular kind of sound, and especially if traditionally musical notes are not really your thing, you may decide you can get away without a complete ADSR envelope. Both "ASR" (Attack, Sustain, Release - no decay phase) and "AD" or "AR" envelopes (the volume just goes up and down once triggered without depending on the gate length) are somewhat popular, and because they require fewer controls, it's common to see "quad envelope" modules with four independent generators of this kind in a single module.

I'm not a big fan of this kind of envelope. Some people recommend them, especially to beginners, on the theory that having many envelopes cheap is nice and "you don't really need" the complexity of a true ADSR envelope, but I think that's short-sighted. If you don't have a separate decay phase and an arbitrarily controllable sustain length, then you just can't make some kinds of sounds, especially those inspired by traditional acoustic instruments. You end up limited to the "bleeps and bloops" some people consider to be a modular cliche. It remains, however, that having many envelope generators cheap is nice; AD envelopes work fine as long as you're focused on percussion sounds that don't sustain anyway; and simplified envelopes may be more tolerable in the West Coast tradition where you've got enough other things going on in the oscillator sounds themselves to pick up the slack of the simplified envelope shapes.

Looping and retriggering

Although basic ADSR envelopes (controlled just by a gate input) may be somewhat vague on how they behave with gates that turn off early in the cycle, it's also possible to build an envelope generator with more inputs and more precise control. In particular, some may offer a retrigger input, which jumps back to the attack phase despite that the main gate input is still high; or different kinds of features (inputs, outputs, and internal patching and switching) for looping the envelope.

With looping, the envelope generator becomes a sort of LFO, though usually not with a direct control of frequency (instead, you control the frequency indirectly by changing the lengths of the different stages in the cycle). Modules with this kind of feature are often sold on the claim that they can double as LFOs, but this is another point on which I'm skeptical: I want my LFO waveforms to be smooth so as to be unobtrusive (hence the Fixed Sine Bank) and apart from that, a looping ADSR envelope generator produces a somewhat strange waveform that can be difficult to control or use. It remains that having multiple functions from a single module is nice.

Also related to looping, or useful by itself, some envelope generators produce extra trigger outputs marking the ends of different stages of the cycle - "end of attack," "start of decay," or whatever. When you have several generators (or several generator sections in a multi-envelope module) you can use these to trigger other envelopes and create some potentially complicated sequences all triggered by a single input. An end-of-stage output is useful, for instance, if you want to have an envelope delayed, to start somewhat after the main trigger.

More complex envelopes

Some instruments are not well-modeled by the classic ADSR shape. For example, some brass instruments have an initial burst of sound which dies away quickly, but then instead of having a "sustain" they have another relatively slow attack, with the sound getting louder over the course of the note before going into a final release stage. You can model that by adding together the outputs of two ADSR envelopes, one fast and one slow, a technique also useful for building up so-called evolving sounds with long slow notes that change a lot over the course of the note (common in ambient music).

Eventually, though, one can exhaust these possibilities and look for an envelope generator which really has more stages in a single generator. These tend to be digital modules because of the greater degree of control needed; it's often impractical to have separate knobs for every stage of an envelope with many stages. The Mutable Instruments Frames (US$360) is one example - it can be used in other ways too, but one common thing to do with it is to program the different "frames" to represent stages in a complicated envelope and then index through them to generate whatever shape you want.

At some point complex envelopes which control different things happening over time merge into sequencers, and it's quite possible to use a module described as a "sequencer" to actually generate an envelope - especially with a slew rate limiter to give some shape to the transitions between the stages.