Some classic envelope shapes are shown below. Corresponding sounds were created by applying the same envelope to both filter and amplifier. Click on each image to play example:
What are Gates and Triggers?
How does an envelope generator know when to begin and end its stream of voltage? It traditionally uses a gate. When a key on the keyboard is depressed, not only does the keyboard send control voltage to the oscillator to specify the pitch, but it sends a second type of signal called a gate, to all EG's participating in the note event. When the key is depressed (called Key On) the unipolar pulse begins its positive 5V phase and stays there until the key is released (called Key Off) where the pulse returns to 0V value. The keyboard gate signal is patched to both envelope generators, and they each move through their attack and decay times to rest at the sustain level until the envelope is ungated (key off), at which point they begin their decay phase. Sometimes an envelope may not make it to the sustain level before being ungated, at which point it jumps to the release phase from wherever it was, and that may cause a click if the discontinuity is too great.
A keyboard or soft-synth may offer the option for legato note connections. The if the user enables legato touch, if there is no time gap between depressed notes or they overlap, the gate will not end, and so the envelope will remain in its sustain mode (or wherever it is in its process). Therefore connected note will not start a new attack phase and the result will be a legato connection.
A trigger is a short transient pulse, which unlike a gate, has the same brief duration regardless of action, including a key off. Envelopes responding to triggers will skip the sustain phase and immediately go to the release, so are, in effect, ADR's, not ADSR's.