Subtractive Synthesis Generator — User Guide
Classic analog-style subtractive synthesis: oscillators, filters, and envelopes — the foundation of electronic music.
What this does
This script implements subtractive synthesis — the synthesis method that powered the analog synthesizer revolution of the 1960s-70s and remains the foundation of most modern electronic music. The concept is elegantly simple: start with a harmonically rich waveform (oscillator), remove frequency content with filters, and shape the result over time with envelopes.
Key Features:
- 6 Classic Waveforms — Sawtooth, square, pulse, triangle, plus thick detuned variants
- 6 Filter Types — Low-pass (12dB/24dB), high-pass, band-pass, notch, plus no-filter option
- Filter Envelopes — Time-varying cutoff frequency for classic synth sweeps
- 5 Amplitude Envelopes — Percussive, sustained, pluck, gate, slow attack
- Resonance Control — Emphasis at cutoff frequency for analog character
- Variable Pulse Width — Control harmonic content of pulse waves
Technical Implementation: The script follows classic analog synthesizer signal flow: (1) Oscillator generates harmonically rich waveform using formula synthesis (sawtooth formula: 2×(f×t - floor(f×t+0.5))), (2) Optional filter envelope modulates amplitude creating time-varying brightness, (3) Main filter applies frequency-domain shaping via Hann band-pass/stop-band filtering with resonance-controlled bandwidth, (4) Amplitude envelope shapes final output. The 24dB low-pass filter uses cascaded 12dB filters for steeper rolloff. Resonance is implemented through narrower filter bandwidth (higher Q factor). All processing maintains 44.1kHz sampling throughout.
Quick start
- In Praat, Run script… →
Subtractive Synthesis Generator.praat. - Choose Waveform (start with "Sawtooth" — classic synth sound).
- Set Duration (3 seconds default) and Frequency (220 Hz = A3).
- Select Filter_type ("Low Pass 12dB" is most common).
- Set Cutoff_freq (1000 Hz good starting point, try 500-3000 Hz range).
- Adjust Resonance (0.3 default, higher = more emphasis at cutoff).
- Choose Filter_envelope ("Short Sweep" for classic synth sweep).
- Set Envelope_amount (0.7 = strong sweep effect).
- Choose Amplitude_envelope ("Percussive" for synth bass/lead).
- Click OK — sound generates and plays.
Subtractive Synthesis Theory
🎹 The Subtractive Synthesis Chain
Signal flow: Oscillator → Filter Envelope → Main Filter → Amplitude Envelope → Output
Philosophy: Start complex, sculpt away — like Michelangelo carving marble
Key insight: Harmonic content = timbre. Filtering = timbral sculpting over time.
📊 Detailed Signal Flow
- Oscillator Stage — Generates harmonically rich waveform at specified frequency
- Filter Envelope Stage — If enabled, modulates signal amplitude (creates time-varying brightness)
- Main Filter Stage — Removes/emphasizes frequencies based on filter type and cutoff
- Amplitude Envelope Stage — Shapes overall volume over time (attack, decay, sustain, release)
- Output Stage — Volume scaling and peak normalization to 0.9
Core Concepts
Harmonics & Timbre
All waveforms except sine contain harmonics — integer multiples of the fundamental frequency. A 220 Hz sawtooth contains 220 Hz (fundamental), 440 Hz (2nd harmonic), 660 Hz (3rd), 880 Hz (4th), etc. The relative strength of these harmonics determines timbre:
- Sawtooth: All harmonics, amplitude ∝ 1/n (brightest, most harmonics)
- Square: Only odd harmonics (1st, 3rd, 5th...), amplitude ∝ 1/n (hollow, clarinet-like)
- Triangle: Only odd harmonics, amplitude ∝ 1/n² (mellow, fewer harmonics)
- Pulse: All harmonics, but strength varies with pulse width (variable spectrum)
The Filter's Role
Filters remove or emphasize specific frequency ranges. A low-pass filter at 1000 Hz applied to a 220 Hz sawtooth:
- Passes: 220, 440, 660, 880 Hz (below cutoff) — mostly intact
- Attenuates: 1100, 1320, 1540 Hz and higher (above cutoff) — reduced/removed
- Result: Darker, warmer tone — the "brightness" (high harmonics) is subtracted
Resonance (Q Factor)
Resonance emphasizes frequencies right at the cutoff frequency, creating a peak in the frequency response. This is the characteristic "analog synth" sound:
- Low resonance (0.1-0.3): Gentle, natural filtering
- Medium resonance (0.4-0.6): Emphasized cutoff, classic synth character
- High resonance (0.7-1.0): Strong peak, can create whistling tone at cutoff (self-oscillation)
Filter Envelopes (Time-Varying Timbre)
Static filtering is useful, but filter envelopes make sounds evolve over time by modulating the cutoff frequency. Classic example: filter sweep from bright attack to dark sustain:
- Start: High cutoff (3000 Hz) — bright, all harmonics present
- Evolution: Cutoff decreases over time → darker
- End: Low cutoff (500 Hz) — only fundamental and few harmonics remain
This creates the "wah" or "sweep" sound fundamental to analog synthesis. The filter_envelope parameter controls how the cutoff changes, envelope_amount controls how much it changes.
Waveforms (6 Oscillator Types)
1. Sawtooth Brightest
Formula: 2×(frequency×t - floor(frequency×t + 0.5))
Harmonic content: All harmonics (1st, 2nd, 3rd, 4th...), amplitude = 1/n
Spectrum: Complete harmonic series descending at 6dB/octave (−6dB/oct rolloff)
Character: Bright, rich, buzzy, brassy — the richest basic waveform
Analog equivalent: Sawtooth oscillator (Moog, ARP, Sequential)
Best for: Bass, leads, brass sounds, pads — most versatile waveform
Filter recommendations: Works with all filters. Low-pass 800-1500 Hz for bass, 1500-3000 Hz for leads.
Famous uses: Minimoog bass (Parliament-Funkadelic), Jupiter-8 strings, TB-303 acid bass
2. Square Hollow
Formula: if sin(2πft) > 0 then 1 else -1
Harmonic content: Only odd harmonics (1st, 3rd, 5th, 7th...), amplitude = 1/n
Spectrum: Missing even harmonics creates "hollow" quality, −6dB/oct rolloff on odds
Character: Hollow, woody, clarinet-like, nasal — distinctive 50% duty cycle
Analog equivalent: Square wave oscillator (50% pulse width)
Best for: Clarinet/oboe simulation, retro game sounds, chip music, hollow pads
Filter recommendations: Low-pass 600-1200 Hz for woodwind character, high resonance for nasality.
Famous uses: Chiptune music (NES, Game Boy), early video game sounds, Commodore 64 SID chip
3. Pulse Variable
Formula: if (f×t - floor(f×t)) < pulse_width then 1 else -1
Harmonic content: All harmonics, but strength varies with pulse width
Spectrum: Pulse width determines spectral nulls — 50% = square, narrow = thin/nasal
Character: Variable timbre based on pulse_width parameter (0.1-0.9)
Pulse width effects:
- 0.5 (50%) = Square wave (hollow)
- 0.3 (30%) = Thin, nasal, reedy
- 0.1 (10%) = Very thin, whistle-like, spectral nulls
Best for: Variable timbres, PWM (pulse width modulation) effects, experimental sounds
Filter recommendations: Band-pass to emphasize formants, low-pass with high resonance for vocal quality.
Note: In analog synths, modulating pulse width over time (PWM) creates rich, evolving timbres. This script uses fixed width, but try different values (0.2, 0.3, 0.4) to explore timbral variety.
4. Triangle Mellow
Formula: (2/π) × arcsin(sin(2πft))
Harmonic content: Only odd harmonics, amplitude = 1/n² (fast decay)
Spectrum: Much fewer harmonics than square (−12dB/oct rolloff vs −6dB/oct)
Character: Mellow, soft, flute-like, pure — closest to sine after fundamental
Analog equivalent: Triangle oscillator (common in modular synths)
Best for: Flute sounds, soft pads, sub-bass, pure tones, FM synthesis carrier
Filter recommendations: Often used unfiltered or with gentle low-pass (2000-4000 Hz). Less drastic filtering needed due to naturally mellow spectrum.
Famous uses: Yamaha DX7 carriers (FM synthesis), 808 bass drum pitch component
5. Dual Saw Thick
Formula: Two sawtooths: fundamental + detuned copy (+7 Hz)
Harmonic content: Double sawtooth spectrum with beating between copies
Spectrum: Richer than single saw due to detuning — creates interference/beating
Character: Thicker, fatter, chorus-like — slight detuning adds width
Analog equivalent: Two VCOs slightly detuned (classic analog technique)
Best for: Fat bass, thick leads, rich pads, analog warmth
Detuning effect: 7 Hz separation creates ~7 beats/second — audible warbling that adds "movement" and thickness. This is how analog synth players created "fat" sounds before digital effects.
Filter recommendations: Same as sawtooth, but can use slightly lower cutoff (700-1200 Hz bass) since detuning adds richness.
6. Super Saw Massive
Formula: Five sawtooths at f×(1.0, 1.005, 0.995, 1.01, 0.99)
Harmonic content: Extremely rich due to multiple detuned copies
Spectrum: Massively dense — beating patterns between all five oscillators
Character: Huge, wide, massive, chorus/ensemble effect — thickest waveform
Analog equivalent: Roland JP-8000/8080 SuperSaw oscillator (1997)
Best for: Trance supersaw leads, massive pads, epic synth sounds, EDM
Detuning scheme: ±0.5%, ±1% creates complex beating patterns at multiple rates. This density is impossible with single oscillator — defines modern EDM "wall of sound."
Filter recommendations: Low-pass 1500-2500 Hz to control massive harmonic content. High resonance (0.5-0.7) adds focus. Slow filter sweeps create epic builds.
Famous uses: Trance leads (1998-2005 trance boom), modern EDM buildups, Skrillex-style leads
Waveform Selection Guide
| Sound Goal | Best Waveform | Why |
|---|---|---|
| Bass (sub to 200Hz) | Sawtooth or Dual Saw | Rich harmonics provide presence in mix |
| Lead (melody) | Sawtooth or Super Saw | Brightness cuts through mix, filtering creates expression |
| Pad (sustained) | Super Saw or Triangle | Super Saw = thick, Triangle = ethereal |
| Retro/8-bit | Square or Pulse | Authentic chip music character |
| Brass | Sawtooth | High harmonics mimic brass formants |
| Woodwind | Square or Pulse | Hollow odd harmonics = clarinet/oboe |
| Flute/Soft | Triangle | Few harmonics = pure, flute-like |
| Modern EDM | Super Saw | Industry standard for trance/progressive leads |
Filters (6 Types)
1. No Filter Bypass
Effect: None — raw waveform passed through unfiltered
Use case: Hear pure waveform character, compare before/after filtering, very bright sounds
Sound: Maximum brightness, all harmonics present, can sound harsh or digital
Recommendation: Use with Triangle (already mellow) or for intentionally harsh digital tones. Most sounds benefit from filtering.
2. Low Pass 12dB Classic
Effect: Removes high frequencies above cutoff at 12dB/octave slope
Implementation: Single Hann band-pass filter (0 Hz to cutoff_freq)
Slope: 12dB/octave = gentle rolloff, natural sound
Character: Warm, smooth, musical — most common filter type
Resonance effect: Creates peak at cutoff frequency, more pronounced with higher resonance (narrow bandwidth)
Analog equivalent: 2-pole filter (Moog ladder filter, most analog synths)
Best for: General-purpose filtering, bass, pads, leads — works for everything
Settings guide:
- 300-600 Hz: Deep bass, sub-bass, kick drums
- 600-1200 Hz: Bass synth, warm pads
- 1200-2000 Hz: Leads, brass, balanced tone
- 2000-4000 Hz: Bright leads, plucks, preserve attack transients
3. Low Pass 24dB Steep
Effect: Removes high frequencies above cutoff at 24dB/octave slope
Implementation: Two cascaded 12dB filters for steeper rolloff
Slope: 24dB/octave = steep rolloff, dramatic effect
Character: Darker, more aggressive filtering than 12dB, sharper cutoff
Resonance effect: Very pronounced peak, can self-oscillate at high resonance
Analog equivalent: 4-pole filter (TB-303, Juno-60, Jupiter-8, MS-20)
Best for: Acid bass (TB-303 style), aggressive filtering, dramatic sweeps
Comparison to 12dB: At cutoff 1000 Hz, 12dB leaves more 2000 Hz content (−12dB) vs 24dB (−24dB). 24dB creates "sharper" divide between passed/rejected frequencies.
Famous uses: TB-303 acid bass, Juno-60 pads, Jupiter-8 brass
4. High Pass Bright
Effect: Removes low frequencies below cutoff, passes highs
Implementation: Hann stop-band filter (0 Hz to cutoff_freq blocked)
Character: Thin, bright, reduces bass/warmth — opposite of low-pass
Use cases:
- Remove muddiness from complex mixes
- Create thin, telephone-like effects
- Hi-hat/cymbal emphasis
- Reduce low-end rumble
Settings guide:
- 100-200 Hz: Remove sub-bass only (clean up low end)
- 300-500 Hz: Thin sound, reduce warmth
- 800-1200 Hz: Telephone effect, lo-fi
- 1500+ Hz: Extreme thinness, whistle-like
Combo technique: High-pass on one layer + low-pass on another = split spectrum for layering
5. Band Pass Focused
Effect: Only passes narrow frequency band around cutoff, removes both lows and highs
Implementation: Hann pass band (cutoff ± bandwidth/2)
Character: Telephone/radio-like, nasal, focused on specific frequency region
Resonance effect: Controls bandwidth — high resonance = narrow band (more resonant), low = wide band
Bandwidth: 50 + (1-resonance)×150 Hz. At resonance 0.3: 155 Hz wide. At 0.8: 80 Hz wide.
Use cases:
- Vocal formant simulation (800-1200 Hz)
- Telephone/radio effects
- Nasal/mid-range emphasis