An ADSR envelope defines specific time and amplitude values for the “attack”, “decay”, “sustain”, and “release” portions of a sound event.
In a realtime context, where event duration is unknown, the “sustain” duration can be undefined, with a “note off” event triggering the “release” portion.
The strategies discussed above for linear and exponential envelopes can be directly applied to ADSR envelopes. The primary distinction becomes one of keeping track of the current "state" of the envelope.
Figure 9:
An ADSR envelope made with linear line segments.
Figure 10:
An ADSR envelope made with asymptotic line segments.