• No results found

The first modern theorist to describe sound envelopes was Hermann von Helmholtz. In his classic book On the Sensations of Tone [Dover], written in 1870, Helmholtz described tones as having an amplitude contour consisting of three segments: an attack, during which the amplitude rises from zero to some peak value; the steady state, during which the tone sustains at the peak level; and the decay, during which the sound level falls again to zero.

While this is a fairly good description of the behavior of sounds produced by bowed and wind instruments, it’s somewhat less accurate with reference to plucked and percussive instruments such as piano, guitar, and timpani. If you examine the sound of one of these instruments in a waveform editor, you’ll see that it begins fairly suddenly and then falls back to zero at a more or less constant rate. There is no period of time in which the amplitude has a steady state.

When Bob Moog was building analog synthesizers in the mid-1960s, primarily for university music labs, he was approached by Vladimir Ussachevsky, who at the time was the head of the Columbia-Princeton Electronic Music Center. Ussachevsky suggested that Moog build a module that would provide a simple but practical and musically useful enhancement of Helmholtz’s scheme, an enhancement that would allow both wind-instrument envelopes and percussive envelopes to be generated. Ussachevsky’s control voltage generator had four knobs, which were labeled attack, decay, sustain, and release. Yes, this was the birth of the ADSR envelope generator.

In order to talk in a clear way about how an ADSR works, however, we need to pause for a moment to introduce a couple of new terms.

An envelope, as we noted earlier, is a signal that rises and falls in level over the course of time. The easiest way to describe such a signal is to consider that it consists of a series of line segments, as shown in Figure 7-1. Each line segment is defined by three data values: its starting and ending level, and the amount of time needed to move from the starting level to the ending level. Such line segments are often referred to as the envelope’s stages.

Since the line segments will be joined end to end in a continuous contour, the ending level of each segment is also the beginning level of the following segment. This simplifies the description of the envelope: We really only need to define one level value and one time value for each segment. Also, we can build in some assumptions, as Moog and Ussachevsky did: We can assume that the start and end levels will always be zero, and that the level reached at the end of the attack segment will always be the full level of the envelope (however that is defined in the synth).

The first knob (attack) in an ADSR envelope generator controls the amount of time that it takes the envelope to rise from zero to the maximum level of the envelope. This segment of the envelope works exactly as Helmholtz had described. The last knob, again as in Helmholtz, controls the amount of time the output will take to fall back to zero. Helmholtz called this the decay portion of the tone, but in Moog’s instruments and most others since then, it’s called the release.

Figure 7-3. A few examples of envelopes that can be produced by an ADSR (attack/decay/sustain/

release) envelope generator. The gate begins at the point labeled “note on” and ends at the point labeled

“note off.” The full output level of the envelope generator is at the top of each graph. In diagram 1, attack is instantaneous, decay is rapid, sustain level is 75%, and release is also rapid. In diagram 2, attack and release are slow, and sustain level is 100%, so the decay setting has no effect. In diagram 3, the note-off occurs before the end of the slow attack phase, so both the decay and sustain settings are irrelevant and

the envelope never reaches its full output level. In diagram 4, the sustain level is 0%, so the envelope falls to zero during the decay segment. As a result, the release setting is irrelevant. In diagram 5, the note-off occurs before the end of the decay, so the envelope goes immediately to the release stage, ignoring the sustain level.

In between the attack and the release, an ADSR envelope generator has two more knobs. One controls the level at which the output will sustain — Helmholtz’s steady state — until the key is lifted. The other controls the amount of time needed for the signal to fall from its peak level to the sustain level. This is called the decay time parameter. Thus we’ve defined a complete envelope with three parameters (attack, decay, and release) that control amounts of time, and one (sustain) that controls a level.

Using these simple parameters, an ADSR envelope generator can create a variety of useful shapes, such as those shown in Figure 7-3.

In an ADSR, the sustain level is usually considered to vary between 0% and 100% of the peak level arrived at at the end of the attack segment. It can’t be set any higher than the peak, but it can be set to zero.

This fact has an important consequence: If the sustain level is set to 100%, when the envelope reaches its peak level at the end of the attack segment, it will simply stay there until the note-off message signals that it’s time to begin the release segment. In this case the decay time parameter will be irrelevant, and changing its value will have no effect on the sound.

Conversely, if the sustain level is set to zero, once the decay segment has ended, it’s the release parameter that becomes irrelevant. When the decay is finished, the output of the envelope is zero, so when the player lifts the key and the release segment begins, the envelope has nowhere to fall. It’s at zero, and it stays there.

Let’s walk through the ADSR’s process step by step and watch what happens. Before the note begins, the output value is zero. When the gate signal arrives from the keyboard, the EG begins the attack segment of the envelope. The output rises from zero toward the maximum, increasing at a rate determined by the attack time parameter. This is the attack segment. At the end of the attack segment, the ADSR proceeds to the decay segment, during which the output falls from the peak level toward the sustain level. The rate at which it falls is controlled by the decay time parameter. Once the envelope reaches the sustain level, it stays there: The output remains constant until the gate signal ends. When the gate ends, the ADSR goes into its release segment, and the output falls from the sustain level back to zero at a rate determined by the release time parameter.

One question that immediately arises is, what happens if the player releases the key while the ADSR is still in the middle of the attack or decay segment — in other words, before the sustain level is reached? In most instruments, this common situation is handled by having the envelope fall immediately back toward zero, at the rate determined by the release parameter, starting at the moment when the gate ends. Figure 7-3 illustrates two of the envelope shapes that might result.

Another alternative is to design the envelope generator so that it will finish its attack and decay portions before going on to the release, whether or not the note-off has been received. An envelope programmed to do this is said to be free-running. Once the sustain segment begins, if the gate is still open (if the note-off has not been received), the question of whether the envelope is free-running becomes moot. Unless it’s not: Once in a while you might encounter an envelope generator that’s designed in such a way that when it’s in free-run mode, its sustain segment always takes zero time, so that it always proceeds from the decay segment directly to the release segment, whether or not a note-off has been received. (Such an envelope might better be described as an AR1BR2 envelope, since it has two release segments separated by a break point.)

Figure 7-4. When a new envelope begins before the release segment of a previous envelope has finished, the envelope generator will either restart from zero (top) or restart from its present position (bottom). On some instruments, you can choose either type of response.

A slightly more subtle question is what happens if the envelope is still in the middle of the release segment when the player starts a new envelope by pressing another key. This event can be handled in one of two ways, as shown in Figure 7-4. Either the envelope can jump from its current value back to zero in order to begin a fresh attack segment, or it can begin its attack segment from wherever it happens to be when the new gate signal arrives. On some instruments, you’ll find a switch that lets you choose which mode of operation you prefer for a given envelope in a particular patch. Restarting from zero gives all envelope attacks the same shape, which is often what one wants musically — but depending on what the envelope is being used for, the discontinuity that occurs when the output jumps back to zero can cause the sound to click, which may be undesirable.

Figure 7-5. The decay and sustain stages of a time-based envelope (top) and a rate-based envelope (bottom). In each case the decay parameter is identical, but the sustain setting is high (a) or low (b). When the decay parameter specifies an amount of time, the sustain level should be reached at the same moment whether it’s high or low. But when the decay parameter specifies a rate, the slope of the decay segment should be the same, so the envelope will need longer to fall to a low sustain level.