A sound is not just a note. It also has a beginning, a development, and an ending.
I’ve been exploring how different envelope settings can change the character of a sound in Sonic Pi. For this experiment, I put together four examples: Pluck, Pad, Bass, and Lead.
I wanted to keep things simple: four different synthesizers, four different envelope settings, and four independent loops that can be run and heard separately.
Four ways a sound can behave
The starting point is ADSR = Attack, Decay, Sustain, and Release.
These four stages shape how a sound evolves over time. A short attack gives it a quick beginning, while a longer one allows it to fade in gradually. Decay, sustain, and release shape what happens afterwards.
One detail worth keeping in mind: in Sonic Pi, sustain specifies the duration of the sustain stage, measured in beats. The sustain volume level is controlled separately with sustain_level.
I used these settings to explore four different sound characters.
The experiments
Each example is a separate Sonic Pi loop. You can copy and run them individually to compare how the sounds behave.
1. Pluck
A very short envelope, with an almost instant attack and no sustain stage. I used the :pluck synth for this example.
# PLUCK: fast attack, quick decay, no sustain stage.
use_bpm 100
live_loop :pluck_character do
use_synth :pluck
play 60, amp: 0.6, attack: 0.001, decay: 0.15, sustain: 0, release: 0.05
sleep 0.3
play 64, amp: 0.6, attack: 0.001, decay: 0.15, sustain: 0, release: 0.05
sleep 0.3
play 67, amp: 0.6, attack: 0.001, decay: 0.15, sustain: 0, release: 0.05
sleep 0.3
play 72, amp: 0.6, attack: 0.001, decay: 0.15, sustain: 0, release: 0.05
sleep 0.5
end
2. Pad
A slower attack and a longer envelope give this example more room to develop. The notes overlap, allowing their sound tails to blend together.
# PAD: slow attack, longer sustain stage, long release.
use_bpm 60
live_loop :pad_character do
use_synth :hollow
play 60, amp: 0.4, attack: 0.8, decay: 0.3, sustain: 0.8, release: 1.5
sleep 2
play 64, amp: 0.4, attack: 0.8, decay: 0.3, sustain: 0.8, release: 1.5
sleep 2
play 67, amp: 0.4, attack: 0.8, decay: 0.3, sustain: 0.8, release: 1.5
sleep 2
play 72, amp: 0.4, attack: 0.8, decay: 0.3, sustain: 0.8, release: 1.5
sleep 3
end
3. Bass
Here I used a fast attack and short release, with a repeated low-note pattern. The envelope is relatively short, but the notes are triggered frequently, so their tails can overlap.
# BASS: fast attack, short envelope, repeated notes.
use_bpm 100
live_loop :bass_character do
use_synth :fm
play 36, amp: 0.6, attack: 0.01, decay: 0.05, sustain: 0.7, release: 0.08
sleep 0.25
play 36, amp: 0.6, attack: 0.01, decay: 0.05, sustain: 0.7, release: 0.08
sleep 0.25
play 36, amp: 0.6, attack: 0.01, decay: 0.05, sustain: 0.7, release: 0.08
sleep 0.25
play 38, amp: 0.6, attack: 0.01, decay: 0.05, sustain: 0.7, release: 0.08
sleep 0.25
end
4. Lead
The lead combines a quick attack with a longer sustain stage and release. I used a short melodic phrase with different pauses between notes.
# LEAD: fast attack, longer sustain stage, medium release.
use_bpm 100
live_loop :lead_character do
use_synth :prophet
play 72, amp: 0.5, attack: 0.02, decay: 0.1, sustain: 0.7, release: 0.3
sleep 0.5
play 74, amp: 0.5, attack: 0.02, decay: 0.1, sustain: 0.7, release: 0.3
sleep 0.25
play 72, amp: 0.5, attack: 0.02, decay: 0.1, sustain: 0.7, release: 0.3
sleep 0.25
play 69, amp: 0.5, attack: 0.02, decay: 0.1, sustain: 0.7, release: 0.3
sleep 0.5
play 67, amp: 0.5, attack: 0.02, decay: 0.1, sustain: 0.7, release: 0.3
sleep 1
end
Comparing the four characters
| Character | Synth | BPM | Envelope idea |
|---|---|---|---|
| Pluck | :pluck | 100 | Very short, no sustain stage |
| Pad | :hollow | 60 | Gradual attack, longer envelope |
| Bass | :fm | 100 | Quick attack, short release |
| Lead | :prophet | 100 | Quick attack, longer sustain stage |
The interesting part for me is that the envelope changes how a note occupies time. A short sound can act like a point of activity, while a longer one can become part of a continuous texture.
What’s next?
I’d like to take these four characters further and see how they work together. For example, a short pluck over a sustained pad, or a bass pattern underneath a slowly evolving sound.
This is a small step in my ongoing exploration of sound design. I’m still experimenting with the possibilities, but ADSR seems like a useful place to start.
Sometimes the way a sound begins and ends can change its character just as much as the note itself.
License
Code: MIT
Text: CC BY 4.0
