ADSR envelope

Amplitude modulation

As said in the soundfont section, the timbre of an instrument is composed of multiple harmonic or non-harmonic partials (individual sine waves) of different frequencies and amplitudes that generaly change over time. But the timbre is not the only important component of an instrument sound, the amplitude variation is another one.

Let's take a look at this recording of a clarinet (listen as wav or mp3)

Clarinet recording

On the picture above, showing the waveform of the sound, we can see that the amplitude varies over time during which the note is played. This variation, called amplitude modulation, is an important information that makes the difference between two instruments that could produce same harmonic sounds.

Using the same sustained part of the sound, let's modify the amplitude modulation by using a decreasing exponential modulation.

Clarinet - decreasing exponential modulation

By listening the produced sound (as wav or mp3) can we say that this sound comes from a clarinet?

So, coming back with the original clarinet sound, we can see four major parts of the amplitude modulation:

Clarinet - decreasing exponential modulation
  • The red part: the amplitude increases from zero to a maximum value.
  • The green part: the amplitude decreases from its previous value to a lower value.
  • The magenta part: the sound amplitude do not change.
  • The orange part: the amplitude decreases down to zero.

In fact, the amplitude modulation may be more complex than the one shown as example. So, a synthesizer generally uses a simplified technique for such a modulation. Moreover, even by limiting the number of control points (that splits the amplitude variation into segments), the amplitude variation within each time interval may be not linear.

Sound synthesis techniques employ an envelope generator that controls the amplitude of played sound at any point in its duration. The envelope generator, by settings its parameters, allows to modulate the amplitude of the sound as near as possible than the one found for each instrument.

One envelope generator commonly used is the ADSR envelope (Attack Decay Sustain Release) that consists of four parameters dividing the envelope in four parts.

ADSR envelope

The ADSR envelope uses four parameters to describe how the instrument sound varies over the time.

The four parameters are:

  • Attack time is the time taken for sound amplitude to reach its maximum amplitude, after pressing a key.
  • Decay time is the time taken for the sound amplitude to decrease from the attack level to the sustain level.
  • Sustain level is the level of the sound amplitude during the main sequence of its duration.
  • Release time is the time taken for the sound amplitude to decrease from the sustain level to zero after the key is released.

My synthesizer uses a linear approach of such an ADSR envelope:

MIDS ADSR envelope

I've also added the possibility to do not use the sustain level. In this case you may define a minimum decay level, that allows having such an ADSR envelope:

MIDS ADSR envelope

Finally, the example bellow shows the clarinet sound modulated by using a linear ADSR envelope (listen as wav or mp3):

Clarinet ADSR envelope