VOLTAreference

Reference / Start here

Build a synth sound

Start here · playable examples

Open in the workbench →
On this page · 5 sections

A synthesizer creates sound from changing signals. You do not need a circuit diagram to begin: choose a starting tone, shape how bright it is, and decide how it begins and ends. Those three choices already cover a remarkable range of basses, leads, keys and pads.

Start with Your first sound if the code is new to you. Each example below is independent; replace the previous program with the whole next example when comparing them.

1. Choose the raw material#

An oscillator repeats a waveform. Its repetition rate determines pitch; its shape determines its mixture of overtones, which affects tone color or timbre.

Starting soundWhat to listen forUseful direction
"sine"A smooth, pure toneSub bass, soft tones, FM building blocks
"triangle"A soft tone with a little edgeRounded basses, gentle leads
"saw"A bright buzzFiltered bass, strings, bold leads
"square"A hollow, woody buzzRetro leads, pulse-like basses

Listen for: the clean, rounded outline of the melody.

Listen to this example · four bars, then the tail
tempo = 120bpm
timingVersion = 2
play "sine" "c4 [e4 g4] b4 g4" |> release 120ms

Make it yours: replace "sine" with "saw". Keep the notes unchanged so you can concentrate on the tone. Then try "triangle" and "square".

2. Sculpt the brightness#

A low-pass filter lets low frequencies through and reduces higher ones. Its cutoff sets where that reduction begins. Raising the cutoff usually makes a harmonically rich sound brighter. Resonance emphasizes frequencies near the cutoff, giving a sweep a more pronounced vowel-like edge.

Listen for: the same saw-wave phrase becoming darker and brighter on alternate bars. The angle brackets choose one cutoff value per cycle.

Listen to this example · four bars, then the tail
tempo = 120bpm
timingVersion = 2
play "saw" "c3 eb3 g3 bb3"
  |> cutoff "<500 2400>"Hz
  |> resonance 2
  |> release 100ms

Make it yours: try "<300 4500>"Hz for a larger contrast. A filter cannot reveal high overtones that a pure sine did not contain; use the saw for this comparison. Explore the different colors in Filters.

3. Shape the beginning and ending#

An envelope changes a value over the life of a note. The common ADSR shape has four stages:

StageWhat it controlsA useful first experiment
AttackTime to rise to full level5ms for a quick start; 400ms for a swell
DecayTime to fall to the sustained levelShort for a pluck; longer for a soft key
SustainLevel while the note is held0.2 is quiet; 0.8 stays strong
ReleaseTime to fade after the note endsShort for separation; long for overlapping tails

Sustain is a level, not a duration. A note must last long enough for a slow attack to become audible.

Listen for: the notes swelling in and gently overlapping.

Listen to this example · four bars, then the tail
tempo = 120bpm
timingVersion = 2
play "saw" "c4 g4"
  |> cutoff 1800Hz
  |> attack 350ms
  |> decay 300ms
  |> sustain 0.55
  |> release 700ms
  |> reverb 0.37 0.18

Make it yours: change attack to 5ms and release to 80ms. The same oscillator now has a much more immediate, separated feel.

4. Build your own instrument#

A patch puts those choices in one reusable instrument. Inside a patch, pitch is the incoming note, freq pitch converts it to a frequency, and vel is the strength of the incoming hit. Multiplying gain by vel makes the patch respond to accents.

Listen for: a bright initial pluck that quickly becomes softer and darker.

Listen to this example · four bars, then the tail
tempo = 120bpm
timingVersion = 2
softpluck = patch {
  source = saw (freq pitch),
  ampEnv = adsr 5ms 180ms 0.15 160ms,
  filtEnv = adsr 2ms 220ms 0 100ms,
  cutoff = 500Hz + filtEnv * 2600Hz,
  resonance = 1.5,
  gain = vel * 0.3
}
play softpluck "c4 [eb4 g4] bb4 g4"

Make it yours: change the filter envelope's 220ms to 600ms. Listen for the brightness lingering after the initial hit. The amplitude and filter envelopes have separate jobs, even when they start together.

Choose your next kind of synthesis#

TechniqueHow it makes a soundExplore
SubtractiveStart bright and remove frequenciesFilters, Analog character
FM and phase modulationOne oscillator changes another at audio speedFM, phase and ring modulation
WavetableMove through a collection of waveformsWavetable synthesis
AdditiveCombine individual partialsAdditive synthesis
Physical modelingExcite a model of a vibrating objectStrings and resonators
GranularLayer tiny windows of recorded soundGranular synthesis

Next: Bring a sound to life adds repeating movement, and The sound recipe book turns these ideas into instruments.