← Back

Envelopes (ADSR)

An envelope shapes a sound's volume over time. The four stages — Attack, Decay, Sustain, Release — turn a constant oscillator into something that feels played.

ADSR playground

Adjust the sliders, then trigger a note. The envelope curve is drawn in real time. Try the presets to hear how radically the same oscillator changes character.

10 ms
150 ms
60 %
300 ms
Hold key or click — release to trigger the Release stage

Isolate each stage

Trigger only the Attack+Decay, or a sustained note, or a long Release tail to hear each stage in isolation.

How it works

Scheduling volume over time. Rather than jumping to a new value, amplitude can be ramped smoothly — instantly, linearly, or exponentially. This is what separates a harsh click from a musical transition.
Exponential ramps are used for Attack and Decay because human hearing is logarithmic. A linear amplitude ramp sounds like it accelerates or decelerates. Exponential ramps sound smooth and natural — they can't ramp all the way to zero, so a near-silence value is used at the tail end.
Interrupting an envelope. When a key is released mid-attack, the release must start from whatever the current level is — not from the planned peak. The current level is captured at the moment of release, then the fade-out begins from there.