Subtractive Synthesis Generator — User Guide

Band-limited oscillator synthesis followed by a continuously moving recursive filter, resonance/Q control, a separate amplitude envelope, and final target peak normalization.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 2.2 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

The generator creates a mono oscillator source, optionally filters it with a time-varying recursive filter, applies a separate amplitude envelope, and then peak-normalizes the finished note.

Process:
polyBLEP / band-limited oscillator → cutoff control → recursive filter + Q → amplitude envelope → target peak normalization

No input Sound is required. The tool can synthesize one note of the requested Duration or, when Bass line demo is enabled, concatenate a fixed four-note pattern.

Version 2.2 is substantially different from older versions of this tool: the filter envelope now controls cutoff frequency directly, the main filters are recursive IIR filters rather than frequency-domain Hann operations, and resonance is mapped to filter Q rather than to transition-band width.

Quick start

  1. Choose Custom or one of the six presets.
  2. Select the oscillator Waveform and Frequency.
  3. Select a Filter type, Cutoff frequency, and Resonance.
  4. Select a Filter envelope and Envelope amount.
  5. Select an Amplitude envelope and Duration.
  6. Enable Edit details if you need to change sample rate, Pulse width, or Output peak.
  7. Run the script. A mono Sound is created and optionally visualized and played.

Signal flow

Actual v2.2 processing chain

1. Generate a band-limited oscillator source.

2. Generate a sample-by-sample cutoff-frequency control curve.

3. Convert the moving cutoff to recursive filter coefficients.

4. Apply the selected low-pass, high-pass, band-pass, notch, or bypass topology.

5. Multiply by the selected amplitude envelope.

6. Peak-scale the complete non-silent result to Output peak.

The filter envelope and amplitude envelope are independent. The first changes spectral filtering; the second changes signal gain.

Oscillators

Discontinuous source waveforms are built from a polyBLEP sawtooth primitive. The correction around waveform discontinuities reduces the strongest aliasing that would occur with naive sample-by-sample saw, square, and pulse formulas.

WaveformCurrent implementation
SawtoothOne polyBLEP saw at the selected frequency, scaled to 0.85.
SquareDifference of two polyBLEP saws separated by half a cycle, scaled to 0.85.
PulseDifference of two polyBLEP saws separated by the selected Pulse width, with DC correction for the chosen duty cycle.
TriangleA band-limited square derived from polyBLEP saws is numerically integrated, DC-centered, then peak-scaled internally to 0.85.
Dual SawTwo polyBLEP saws at f and f + 7 Hz, mixed at 0.45 each.
Super SawFive polyBLEP saws at f × {1, 1.005, .995, 1.01, .99}, mixed at 0.18 each.

Pulse width

Pulse width is available only on the Details page and is accepted from 0.1 to 0.9. A value of 0.5 produces the symmetric square-wave case; asymmetric values change the pulse spectrum.

Dual Saw and Super Saw are still mono. Detuning creates beating and spectral density, not stereo width.

Filter models

The current filters are time-varying RBJ-style recursive biquads. Their coefficients are recalculated sample by sample from the moving cutoff curve.

Resonance → Q

For the 12 dB/octave low-pass, high-pass, band-pass, and notch filters:

Q = 0.7071068 + Resonance × (10 - 0.7071068)

Thus Resonance = 0 gives approximately the Butterworth second-order value Q = 0.707, while Resonance = 1 gives Q = 10.

FilterTopologyResonance behavior
No FilterSource copied unchanged through the filter stage.Resonance and cutoff do not alter the audio.
Low Pass 12dBOne second-order low-pass biquad.Q from .707 to 10.
Low Pass 24dBTwo cascaded second-order low-pass stages.Stage 1 fixed at Q=.5411961; stage 2 rises from Q=1.306563 to 10. At Resonance=0 the pair forms the standard fourth-order Butterworth Q pair.
High PassOne second-order high-pass biquad.Q from .707 to 10.
Band PassOne second-order band-pass biquad centered on the moving cutoff.Higher Q narrows and emphasizes the pass region.
NotchOne second-order notch biquad centered on the moving cutoff.Q controls the spectral width of the rejection region.
High Resonance means a high-Q recursive response around the cutoff. The script does not implement an analog ladder model or an explicit self-oscillating feedback circuit, so descriptions such as “Moog ladder self-oscillation” would be inaccurate for this implementation.

Filter envelopes

The selected Filter envelope creates an explicit cutoff-frequency Sound. The cutoff is always clamped to:

20 Hz ... 45% of SampleRate
EnvelopeActual cutoff trajectory
No EnvelopeConstant at the selected Cutoff frequency.
Short SweepStarts at cutoff × (1 + 2 × amount) and falls linearly to the base cutoff during the first max(20 ms, 25% of note duration); then remains at the base cutoff.
Long SweepRises linearly over the complete note from the base cutoff to cutoff × (1 + 1.5 × amount).
Attack EmphasisA short parabolic excursion during the first max(20 ms, 20% of duration), peaking at cutoff × (1 + 3 × amount), then returning to the base cutoff.
Decay SweepStarts at cutoff × (1 + 2 × amount) and falls linearly to the base cutoff across the complete note.

Envelope amount ranges from 0 to 1 and scales the excursion above the base cutoff. These envelopes never sweep below the selected base cutoff.

Amplitude envelopes

Every amplitude envelope explicitly starts and ends at zero or approaches zero through a short cosine fade, reducing note-boundary clicks.

EnvelopeActual implementation
PercussiveFast cosine attack, exp(-8t) decay, and a short release fade.
SustainedFast attack followed by the slower exp(-1.5t) decay and a longer release. It is more sustained than Percussive, but it is not a flat ADSR sustain stage.
Slow AttackCosine attack up to 0.5 s or 40% of the note, unity middle section, then a slow release.
PluckVery short attack, strong exp(-20t) decay, and short release.
GateFast attack, near-unity body, then a release of up to 100 ms or 25% of the note.

Controls

Main page

ControlDefaultMeaning
PresetCustomCustom plus six complete synthesis configurations.
Bass line demooffReplaces the single note with the fixed four-note demonstration described below.
WaveformSawtoothOscillator source.
Frequency220 HzSingle-note oscillator frequency. Bass-line demo uses its own fixed note frequencies.
Filter typeLow Pass 24dBRecursive filter topology or bypass.
Cutoff frequency1000 HzBase cutoff before filter-envelope modulation.
Resonance.30Maps to filter Q; valid 0–1.
Filter envelopeNo EnvelopeSelects the moving-cutoff trajectory.
Envelope amount.70Depth of the cutoff excursion; valid 0–1.
Amplitude envelopeSustainedControls note gain over time.
Duration3.0 sSingle-note duration. Ignored by Bass-line demo audio, whose four notes are each 0.25 s.

Details page

ControlDefaultMeaning
Sampling frequency44100 HzDirect synthesis and output sample rate; minimum 8000 Hz.
Pulse width.30Used only by Pulse; valid .1–.9.
Output peak.90Target peak normalization; valid >0…1.

Presets

Presets override Waveform, Frequency, Filter type, Cutoff, Resonance, Filter envelope, Envelope amount, and Amplitude envelope. They do not override the Details-page Sample rate, Pulse width, or Output peak.

PresetSourceFilterControl / amplitude envelope
Moog BassSaw, 110 HzLP24, 600 Hz, res .60Decay Sweep .80 / Percussive
ARP LeadSaw, 440 HzLP12, 2000 Hz, res .40Short Sweep .90 / Sustained
TB-303 AcidSaw, 220 HzLP24, 800 Hz, res .80Attack Emphasis 1.00 / Pluck
String PadSuper Saw, 220 HzLP12, 1500 Hz, res .20No Envelope / Slow Attack
Plucked BassSaw, 110 HzLP24, 1200 Hz, res .50Short Sweep .70 / Pluck
Synth BrassSaw, 330 HzLP12, 2500 Hz, res .30Long Sweep .60 / Slow Attack
Preset names describe intended synthesis gestures; they do not mean the script models the circuitry of the named historical instruments.

Bass-line demo

When enabled, the normal Frequency and Duration controls no longer define the output note sequence. The script renders four independently synthesized notes:

110 Hz × 0.25 s
110 Hz × 0.25 s
220 Hz × 0.25 s
196 Hz × 0.25 s

The four notes use the current preset/filter/envelope settings and are concatenated into a one-second mono Sound.

Each 0.25 s note passes through the complete synthesis engine and is peak-normalized independently before concatenation.

With Bass-line demo plus visualization, Panels A–D use a separate representative 110 Hz, 1-second note so the mechanism remains readable. Panel D and the visualization QC therefore describe that representative note rather than the four-note concatenated result. The Info-window peak/RMS printed before visualization refers to the actual bass-line output.

Sampling and safety

The script requires at least 8000 Hz sample rate and at least 16 samples across the requested note duration.

The highest oscillator frequency used by the selected source must remain below:

45% of SampleRate

For Dual Saw this check uses f + 7 Hz; for Super Saw it uses 1.01 × f.

The moving cutoff is independently clamped between 20 Hz and 45% of Sample rate.

Version 2.2 uses polyBLEP correction for the discontinuous oscillators, but there is no oversampling stage.

Output and level

PropertyBehavior
InputNo input Sound required.
ChannelsMono.
DurationSingle-note mode: exactly Duration. Bass-line demo: exactly 1.0 s.
Sample rateExactly the Details-page Sampling frequency.
NormalizationEvery non-silent synthesized note is peak-scaled to Output peak. This is target normalization, not a down-only ceiling.
Single-note namesubtractive_<waveform>_<preset>.
Bass demo namesubtractive_bassline_<preset>.

The earlier Volume control was removed because a common gain applied before unconditional target peak normalization cannot change the final peak level.

Visualization and QC

PanelWhat it shows
A — Source oscillatorUp to the first 40 ms of the actual band-limited source waveform.
A2 — Measured spectral sculptingPraat LTAS curves for the raw oscillator and the post-filter signal, plotted together up to min(8 kHz, Nyquist).
B — Filter controlThe actual cutoff-frequency trajectory over the note, with the current filter-envelope name and displayed Q.
C — Amplitude controlThe exact amplitude-envelope Sound used to shape the filtered source.
D — Measured outputThe final normalized waveform used for verification.

The QC grid summarizes source type, realized cutoff range, filter topology, Q/resonance, amplitude envelope, peak, and RMS.