How does a synthesizer work?

A synthesizer builds sound from nothing but electricity: oscillators hum, a filter carves, an envelope shapes every note. A classic synth has three main parts in a row. Oscillators make a buzzing wave, a filter shapes its tone, and an amplifier sets how loud it is.

A synthesizer builds sound from nothing but electricity: oscillators hum, a filter carves, an envelope shapes every note. Play a real synth in your browser, take a Minimoog-style keyboard apart in 3D, and see why two sine waves can ring like a bell.

SynthClearOpened 1 Aug 202615 min to playFree · no sign-up

In 60 seconds

  1. Oscillators, a filter, an amplifier

    A classic synth has three main parts in a row. Oscillators make a buzzing wave, a filter shapes its tone, and an amplifier sets how loud it is. The keyboard only sends two signals: which note, and when a key is down.

  2. Every tone is a stack of sine waves

    Any repeating wave is a sum of sine waves at 1, 2, 3… times its frequency: its harmonics. A sawtooth has every harmonic at 1/n, a square only the odd ones at 1/n, and a triangle the odd ones at 1/n², which is why it sounds so soft.

  3. Subtractive: start bright, carve away

    A lowpass filter lets low frequencies through and cuts the high harmonics. Moog's ladder filter falls 24 dB per octave. Resonance boosts the harmonics right at the cutoff, and sweeping the cutoff makes the classic wah.

  4. Attack, decay, sustain, release

    An envelope gives each note a shape in time. Attack is the rise, decay the fall to the sustain level, which holds while the key is down, and release the fade after you let go. Short and sharp is a pluck; slow and long is a pad.

  5. FM: one wave wobbles another

    John Chowning found at Stanford that wobbling a sine wave's frequency very fast adds sidebands at the carrier plus and minus multiples of the modulator. The ratio places them and the index sets how many. Yamaha's DX7 made it famous in 1983.

  6. MIDI: messages, not sound

    Since 1983, instruments talk in MIDI: three bytes such as note on, which note, and how hard, sent at 31,250 bits a second. A step sequencer sends them on time, the idea behind drum machines like the Roland TR-808 and every DAW today.

Laws at work here

The history

130 years from a 200-ton music machine in New York to synthesizers that live inside a laptop.

Read the full history
  1. 1906A 200-ton music machine
  2. 1964Moog's modules take the stage
  3. 1979The Fairlight and the birth of sampling
  4. 1982Ten Ragas to a Disco Beat
  5. 1983The Yamaha DX7

The full explanation

SynthClear, chapter by chapter

Chapter 1

Inside a synthesizer

Oscillators make a tone, a filter shapes it, an amplifier opens and closes. Keys tell them when.

A synthesizer makes sound from electricity alone. Nothing vibrates until the very end, when a loudspeaker turns the voltage into moving air (see Faraday's law for how a speaker works).

This is a classic analog synth, laid out like the Minimoog of 1970. Read its front panel from left to right and you follow the sound. The oscillators (VCOs) make a buzzing tone. The mixer blends them. The filter (VCF) takes away the bright parts. The amplifier (VCA) makes it louder and softer, steered by an envelope. Then it goes out of the output jack.

The keyboard only sends two signals: which note (a control voltage) and when a key is down (a gate). The pitch wheel bends the note and the mod wheel adds wobble from an LFO. Under the panel are the circuit boards that do the real work.

Early synths were modular: separate boxes joined by patch cables, so you could wire them any way you liked. The Minimoog wired the most useful path inside, so musicians could take it on stage.

Try “Inside a synth” in the interactive model →

Chapter 2

Waves and harmonics

Every tone is a stack of pure sine waves. The stack sets the sound.

An oscillator makes a wave that repeats, and how many times a second it repeats is the note's frequency. A3 repeats 220 times a second: 220 hertz (Hz). But the shape of the wave matters too. That is why a flute and a violin playing the same note sound different.

In 1807 Joseph Fourier showed that any repeating wave can be built by adding up plain sine waves, at 1, 2, 3, 4… times the main frequency. These are the harmonics. Each wave shape is just a recipe:

A sine wave is one harmonic alone: a pure, soft tone. A sawtooth has every harmonic, the nth one 1/n as strong: bright and buzzy, like brass or strings. A square has only the odd harmonics (1, 3, 5…) at 1/n: hollow, like a clarinet. A triangle has the odd ones too, but they fade as 1/n², so it is much softer.

The layers behind show each harmonic. The glowing line in front is their sum: the wave the speaker plays. The boards show the live signal when you play: a scope for the shape, a spectrum for the harmonics.

Try “Waves and harmonics” in the interactive model →

Chapter 3

Carving the sound: the filter

Start bright, then take harmonics away. That is subtractive synthesis.

Most classic synths use subtractive synthesis. The oscillator makes a bright wave with lots of harmonics, like a sawtooth. Then a filter takes some away, the way a sculptor carves stone.

The usual filter is a lowpass: low frequencies pass, high ones are cut. The cutoff is where the cutting starts. Above it the harmonics fall away steeply: this filter loses 24 dB per octave, so each doubling of frequency leaves only a sixteenth of the strength. Bob Moog's ladder filter of 1965 had this slope, and it is a big part of the famous Moog sound.

Resonance (Moog called it emphasis) feeds some of the output back in, so harmonics right at the cutoff get a boost. Turn it up and you hear a sharp, singing peak. Move the cutoff while a note plays and you get the wah of a filter sweep.

An envelope can open the filter on every note and let it close again. That makes a note start bright and turn mellow, just like a plucked string: see GuitarClear.

Try “The filter” in the interactive model →

Chapter 4

Attack, decay, sustain, release

Every note has a shape in time. Four numbers set it.

A real instrument's note has a shape in time. A piano note starts with a bang and fades. A violin can swell slowly and hold. A synth copies this with an envelope generator, and the most common kind has four settings, ADSR:

Attack: how long the sound takes to rise to full strength after you press a key. Decay: how long it takes to fall to the sustain level. Sustain: the level it holds for as long as the key is down (a level, not a time). Release: how long it takes to die away after you let go.

The key sends a gate signal: on while held, off when released. The envelope turns that simple on/off into a smooth curve, which drives the amplifier (VCA). Here it also opens the filter a little, so the note is brightest when it is loudest, as in real instruments.

Short attack and no sustain gives a pluck. A slow attack and long release gives a soft pad. Everything at full gives an organ, which is on or off. A quick swell with a bit of decay sounds like brass.

Decay and release fall fast at first, then slower and slower. The times here are how long they take to get 98% of the way.

Try “The envelope” in the interactive model →

Chapter 5

FM: one wave wobbles another

Two plain sine waves can make bells, brass and electric pianos.

In 1967 a composer at Stanford, John Chowning, found another way to make rich sounds. Take a plain sine wave, the carrier, and wobble its frequency very fast with a second sine wave, the modulator. This is frequency modulation (FM), the same idea FM radio uses, but at audio speed.

When the wobble is fast enough, you stop hearing a wobble. You hear new frequencies, called sidebands, spaced evenly on both sides of the carrier: fc ± fm, fc ± 2fm and so on. Two numbers control them. The ratio of modulator to carrier sets where the sidebands land. Whole-number ratios give harmonics, like an instrument. Other ratios give clanging, bell-like sounds. The index (how hard it wobbles) sets how many sidebands are strong. Their heights follow maths called Bessel functions.

Chowning published this in 1973, and Stanford licensed the patent to Yamaha. In 1983 Yamaha's DX7 put FM in a keyboard musicians could afford, and its electric piano and bell sounds are all over 1980s pop. It was digital: its six "operators" are sine waves computed by chips.

Two other ideas followed. A sampler, like the Fairlight CMI of 1979, records real sounds and plays them back at any pitch. A wavetable synth, from the early 1980s, steps through a list of stored wave shapes as a note plays.

Try “FM synthesis” in the interactive model →

Chapter 6

MIDI, sequencers and drum machines

Three bytes say “play this note”. A sequencer sends them on time, over and over.

In 1983 synth makers agreed on a common language: MIDI, the Musical Instrument Digital Interface. It was pushed by Dave Smith of Sequential Circuits and Ikutaro Kakehashi of Roland, and it still works today. MIDI sends no sound at all, only messages, as a stream of bits down a 5-pin cable.

Press a key and the keyboard sends three bytes: Note on plus the channel (90 in hex for channel 1), which note (60 is middle C) and velocity, how hard you hit it (0 to 127). Let go and it sends Note off (80). The cable runs at 31,250 bits a second. Each byte takes 10 bits, so a note-on takes under a millisecond.

A sequencer sends those messages for you, on time. This one has 16 steps, each a sixteenth of a bar, with a row for each drum and one for the bass. Its coloured step keys copy the Roland TR-808 drum machine of 1980, whose booming synthesized bass drum is all over hip-hop and pop. Roland's TB-303 bass machine, with its squelchy resonant filter, started acid house.

An arpeggiator takes the keys you hold and plays them one at a time in a pattern. Today a DAW (a music program on a laptop or phone) does all of this in software: its software synths do the same maths as the oscillators, filters and envelopes in this box.

Try “MIDI and sequencers” in the interactive model →

Test yourself

Frequently asked

In a classic synth, which part takes away the bright, buzzy harmonics?

The filter. The oscillator makes a bright wave full of harmonics. The filter removes the high ones, which is why this is called subtractive synthesis.

What does a synth keyboard send to the rest of the synth?

Which note (a control voltage) and when a key is down (a gate). The keys make no sound. They set the oscillators’ pitch with a voltage and start the envelopes with a gate.

Why was the Minimoog such a big step after modular synths?

It wired the most useful path inside one small box, so it could go on stage. Modulars needed cables and a lot of space. The Minimoog fixed the path inside, so a player could just switch it on and play.

Which wave contains every harmonic, the nth one at 1/n of the strength?

Sawtooth. The sawtooth has them all: 1, 1/2, 1/3, 1/4… That is why it sounds so bright and buzzy.

A note has a frequency of 220 Hz. What is the frequency of its 3rd harmonic?

660 Hz. Harmonics sit at whole-number multiples: 3 × 220 Hz = 660 Hz.

Why does a triangle wave sound so much softer than a square wave?

Its odd harmonics fade as 1/n² instead of 1/n, so the high ones are tiny. Both use odd harmonics only, but the triangle’s 3rd is 1/9 and its 5th 1/25 as strong, against 1/3 and 1/5 for a square.

What does a lowpass filter do to a sawtooth wave?

Cuts the harmonics above the cutoff, making it duller. Low frequencies pass and the high harmonics are cut, so the bright buzz turns soft and round.

This filter falls at 24 dB per octave. A harmonic two octaves above the cutoff is about how much weaker?

48 dB. Two octaves × 24 dB per octave = 48 dB: less than a hundredth of its height.

What does turning up the resonance do?

Boosts the harmonics right at the cutoff. Feedback makes a peak at the cutoff frequency. Sweep it and you hear the classic squelchy “wah”.

Which ADSR setting is a level, not a time?

Sustain. Sustain is how loud the note stays while the key is held. The other three are times.

You want a soft string pad that swells in and fades out slowly. What do you turn up?

Attack and release. A long attack makes it swell in, and a long release lets it fade after you let go.

With sustain at zero, what happens if you hold a key down?

The note fades away after the decay, even though the key is held. The envelope rises, then decays towards the sustain level. If that level is zero, the note dies away like a plucked string.

In FM synthesis, what does the modulator do?

It wobbles the carrier’s frequency. The modulator pushes the carrier’s frequency up and down. When that happens fast, you hear sidebands instead of a wobble.

A 220 Hz carrier is modulated at 440 Hz (ratio 2). Where are the first sidebands?

660 Hz and 220 Hz (folded back from −220). fc ± fm = 220 ± 440: 660 Hz, and −220 Hz, which folds back to 220 Hz. All the partials stay on multiples of 220 Hz: a harmonic tone.

Which famous 1983 keyboard made FM synthesis popular?

Yamaha DX7. Yamaha licensed Chowning’s FM patent from Stanford. The DX7’s electric piano and bells were everywhere in 1980s music.

What travels down a MIDI cable?

Messages such as “note on, middle C, velocity 100”. MIDI carries instructions, not sound. The receiving synth makes the sound.

MIDI runs at 31,250 bits per second and uses 10 bits per byte. About how long does a 3-byte note-on take?

About 1 millisecond. 3 bytes × 10 bits = 30 bits. 30 ÷ 31,250 = 0.00096 s, just under a millisecond.

At 120 BPM with four steps per beat, how long is each step?

0.125 s. 120 beats a minute is one beat every 0.5 s. A quarter of that is 0.125 s.

Words worth knowing

Oscillator
A circuit or program that makes a repeating wave. Its frequency sets the note.
Harmonic
A sine wave at a whole-number multiple of a note's frequency. The mix of harmonics sets the tone.
Subtractive synthesis
Making a sound by starting with a bright wave and filtering harmonics away.
Lowpass filter
A filter that passes low frequencies and cuts high ones, above its cutoff.
Resonance
A boost at a filter's cutoff, made by feeding its output back in.
ADSR envelope
Attack, decay, sustain and release: the four settings that shape a note in time.
LFO
Low-frequency oscillator: a slow wave that wobbles pitch, tone or loudness.
FM synthesis
Making rich sounds by wobbling one sine wave's frequency with another at audio speed.
MIDI
The 1983 standard that lets instruments and computers send notes to each other as short messages.

Fork it. Teach with it.

This box is plain HTML, CSS and JavaScript, with no build step and no accounts. Run it yourself and it sends nothing anywhere. The code is MIT. The words, images and videos are CC BY 4.0, so you can reuse them anywhere if you credit “Glassbox, glassbox.how/e/synthclear”.

git clone https://github.com/bdeeps/synthclear.git

Built with three.js (MIT), Geist, Instrument Serif (SIL OFL 1.1).

←→ previous / next box · / search

Would you like to see the full page, with the interactive model?