home/ atoms/ adsr-envelope-sonic-pi

ADSR envelopes in Sonic Pi shape both amplitude and duration of each triggered note

Sonic Pi’s amplitude envelope has four phases: attack (0 to attack_level), decay (attack_level to sustain_level), sustain (held at sustain_level), and release (sustain_level to 0). Total duration = attack + decay + sustain + release. Default for all synths is release: 1 with everything else at 0 (1-beat sound, instant onset). Envelope opts cannot be changed via control after trigger. The same opts appear on both synths and samples, though sample auto-sustain behaves differently.

Examples

play 60, attack: 0.5, decay: 0.2, sustain_level: 0.6, sustain: 1, release: 0.5

total duration = 0.5+0.2+1+0.5 = 2.2 beats

Assessment

Calculate the total duration of play 60, attack: 0.3, sustain: 1.5, release: 0.7. Then shape the envelope to produce a plucked-string feel.

“duration of a sound is the summation of the times of each of these phases”
corpus · sonic-pi-built-in-tutorial · chunk 5