home/ modules/ building-differentiable-dsp-instruments

Building Differentiable DSP Instruments with DDSP

  • learner can explain how DDSP makes DSP differentiable so a network drives classical synthesizers
  • learner can wire harmonic, filtered-noise, and reverb processors through the Processor API
  • learner can prepare CREPE-conditioned TFRecord training data and reason about perceptual loudness weighting

Assemble a small DDSP instrument on paper and in config: chain a Harmonic synth, a FilteredNoise synth, and a trainable Reverb through the Processor API, describe the exp_sigmoid amplitude mapping, prepare a TFRecord dataset with CREPE f0/A-weighted loudness, and state what each processor contributes to the final timbre.

This module builds toward designing your own neural instrument: a DDSP model you could train on ten minutes of a single sound source — a violin, your own voice, a field recording — and then play live with pitch and loudness curves from a controller or a live-coding pattern. Unlike black-box neural audio, a DDSP instrument stays legible on stage: every knob the network turns is a real synthesizer parameter you can inspect, override, or hijack mid-set.

The arc starts with the big idea — DSP components wrapped as differentiable operations so gradients flow through classical synthesis — before anything is wired up. From there you meet the Processor API, whose inputs-vs-controls split is the mental model everything else hangs on: raw network tensors in, physically valid synth controls out. With that frame, each processor becomes a supported exercise: the Harmonic synthesizer’s amplitude/distribution/f0 triple, the FilteredNoise synthesizer’s noise-shaping magnitude envelope, and the trainable Reverb’s learned impulse response. When amplitudes need to be strictly positive, the exp_sigmoid scaling atom is your just-in-time pointer; when you turn to data, the CREPE pitch-extraction and TFRecord preparation atoms walk you through the offline conditioning pipeline, with A-weighted loudness explaining why the model hears volume the way you do.

Every required atom is load-bearing for the capstone: you cannot chain the three processors, justify the amplitude mapping, or prepare the dataset without them. The supporting atom on zeroing partials above Nyquist enriches the picture — it explains why the harmonic stack never aliases — but the capstone stands without reciting it. By the end, the unsupported task is yours alone: assemble the full chain and account for what each stage contributes to the timbre.

Runnable examples

Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.

reverb-space

s("cp").room(0.6).size(4)

strudel-0019 · CC0

out: mix ~a ~b >> plate 0.3

glicol-0008 · MIT

Atoms in this module

Required — these gate the capstone

DDSP makes DSP components differentiable so neural networks can drive classical synthesizers
Concept L2 First instrument KB
The DDSP Processor separates unconstrained network outputs (inputs) from physically valid synthesizer controls
Concept L2 First instrument KB
DDSP's Harmonic synthesizer sums band-limited sinusoidal harmonics weighted by a learned distribution
Concept L2 First instrument KB
DDSP's FilteredNoise synthesizer shapes white noise with a learned frequency-domain magnitude envelope
Concept L2 First instrument KB
DDSP's Reverb processor can use either a predicted or a single learned impulse response for convolution
Concept L2 First instrument KB
DDSP uses the CREPE pitch detector to extract frame-rate f0 and confidence from audio for training conditioning
Concept L2 First instrument KB
DDSP training requires preprocessing raw audio into TFRecord files with precomputed f0, loudness, and audio chunks
Procedure L2 First instrument KB
The exp_sigmoid nonlinearity maps network outputs to strictly positive amplitudes with a controllable range
Concept L2 First instrument KB
Perceptual loudness in DDSP uses A-weighting to match human hearing sensitivity across frequencies
Concept L2 First instrument KB

Supporting — enrichment, not gating

Harmonic synthesizers must zero out partials above the Nyquist frequency to prevent aliasing
Principle L2 First instrument KB