Lecture 10 · Keep the structure, learn the parameters
| Block | Representation | Generator |
|---|---|---|
| Filters and effects | LTI and time-varying systems | hand-designed |
| Classical synthesis | samples, partials, modes, physical state | hand-designed |
| DDSP | the same structured models | parameters learned |
| Reverberation | a recursive dynamical system | hand-designed, fittable |
| Diffusion | a learned representation | learned |
The four questions
Every lecture so far ended with a match step that we did by ear: pick a cutoff, an FM index, a pluck position until it sounds right. Today that step becomes an optimization.
A room (next lecture)
| target | |
| FDN, start | |
| FDN, fitted |
A guitar note (lecture 9)
| target | |
| modal string, by ear | |
| modal string, fitted |
An amplifier, on a recording it never saw
| clean input | |
| the amp | |
| model, fitted |
Listen first
In each column, the model’s structure was fixed in advance. What exactly was learned? And is a model that sounds right necessarily a model with the right parameters?
\[\hat{\theta} = \arg\min_\theta\; L\big(f_\theta(u),\ y_\text{target}\big), \qquad \theta \leftarrow \theta - \eta\,\frac{\partial L}{\partial \theta}\]
Differentiable DSP
Write the synthesizer or effect in an automatic-differentiation framework (PyTorch, JAX), so the gradient of a loss flows back through every filter, oscillator and delay into its parameters. The structure stays hand-designed; the numbers are learned.
Black box
A network learns the input–output behavior from data. Standard today for amps and pedals (recurrent networks, Wright et al. 2019; the open Neural Amp Modeler). No knobs inside.
White box
Known topology and equations, translated into a simulation: lectures 7 to 9 and 11, and Max’s wave digital filters for circuits. Every parameter has a meaning, but someone has to measure it.
Grey box
Keep the structure, learn the parameters, or learn only the parts nobody can write down (a body filter, a nonlinearity). DDSP lives here.
The grey box keeps what a musician needs: the fitted model is still a string, a reverb, an amp, with the same knobs as before.
Timbre transfer: sing into a model trained on violin, and the analysis (f₀, loudness) drives a violin. The representation is the control.
| Domain | Example | Hears | Blind to |
|---|---|---|---|
| time | \(\frac{\sum (y-\hat y)^2}{\sum y^2}\) (error-to-signal) | everything, including phase | nothing, which is the problem |
| spectrum | \(\big\| \lvert Y\rvert - \lvert\hat Y\rvert \big\|\) at one STFT size | spectral envelope | phase; time or frequency detail |
| multi-scale spectral | sum over STFT sizes, linear and log magnitude | transients and partials | phase |
| perceptual | mel or loudness-weighted spectra | what the ear weighs | fine structure the ear ignores |
| task-specific | energy decay curve (reverb), \(T_{60}\) per band | exactly one property | everything else |
\[L_\text{MSS} = \sum_{n \in \{256, 1024, 4096\}} \frac{\big\| |S_n| - |\hat S_n| \big\|_1}{\| S_n \|_1} + \big\| \log(|S_n| + \epsilon) - \log(|\hat S_n| + \epsilon) \big\|_1\]

One decaying sine at 220 Hz, and a model sine whose frequency sweeps from 110 to 440 Hz.
Practice
Do not learn what an analysis can measure. Pitch comes from a pitch tracker, delays from the room size; gradient descent refines decays, gains, filters and positions.

| Parameter | By ear (L9) | Fitted |
|---|---|---|
| \(f_0\) | 83 Hz, tracked | 83 Hz (fixed) |
| stiffness \(B\) | \(5.0\cdot10^{-5}\) | \(6.4\cdot10^{-5}\) |
| \(\sigma_0\) | 6.0 | 7.1 |
| \(\sigma_2\) | \(1.0\cdot10^{-6}\) | \(5.6\cdot10^{-7}\) |
| pick, pickup | 0.15, 0.03 | 0.15, 0.03 |
| pick width | 1.5 % | 0.3 % |
Test on the 13 other notes of the riff, which training never saw (each at its own measured pitch):
| Note | \(f_0\) | Loss, by ear | Loss, fitted |
|---|---|---|---|
| E3 | 165 Hz | 2.86 | 2.70 |
| D3 | 147 Hz | 3.53 | 3.26 |
| G3 | 196 Hz | 3.62 | 3.54 |
| A2 | 110 Hz | 2.84 | 2.66 |
| B2 | 123 Hz | 3.63 | 3.44 |
… and better on all 13, by 1–14 % (6 % on average).
The whole riff, one fitted string:
| target | |
| by ear (L9) | |
| fitted |
Why it generalizes
The structure is shared by every note: one string, one body. What was fitted on one note is a property of the instrument, not of the recording.
The DDSP piano notebook (DDSP_Piano.py): one Pianoteq note, a 3-delay FDN whose delays are the three strings of a unison and whose matrix is the bridge; about 50 parameters.
| Training loss | Mean \(T_{60}\) error per partial | |
|---|---|---|
| 200 Adam steps | baseline | 25 % |
| 500 Adam steps | 10 % lower | 31 % |
Failure case: overfitting the objective
The loss kept improving, the model got worse at what we care about (the decay of each partial). Past a point the extra steps fit fine structure no decay estimator measures.
Keep an exam
A measure the optimizer never sees: held-out notes, a physical quantity, a listening test.

Grey box: pre-EQ → \(\tanh(g(u+b))\) → cabinet EQ, 22 parameters, fitted to a hidden amp on one guitar recording. On a different recording: loss 1.78 → 0.27.
But: drive \(g\) = 1.6 instead of 6, bias 0.63 instead of 0.15
At the true parameters the loss is exactly 0; the fit found a valley of nearly equivalent amps with a softer curve and more EQ. Sound matched, parameters not identified.
| Black box (network) | Grey box (DDSP) | White box (lectures 7–9) | |
|---|---|---|---|
| Needs | lots of input–output data | a structure and some data | a structure and measurements |
| Knobs after training | only those it was trained with | all of the model’s: pluck position, \(T_{60}\), drive | all |
| Generalizes | within the training data | along the structure (other notes, other rooms) | wherever the physics holds |
| Parameters mean something | no | if they are identifiable | yes |
Make it playable
After fitting the guitar string, which parameters would you now give to a player, and which would you freeze as “the instrument”?
| Lecture | Structure | Matched by ear | Matched by gradient |
|---|---|---|---|
| 7 · oscillators | saw + filter | cutoff envelope | amplitudes and filters (DDSP) |
| 7, 9 · drums | 808 voices, modal membrane | decay, snappy, strike position | inharmonic sines + noise + a learned transient (Shier et al. 2023) |
| 8 · samples | the recording | nothing to match | the neural vocoder’s generator |
| 9 · physical models | modal string | \(B\), \(\sigma\), positions | the same, plus a body EQ |
| 10 · amps | EQ → nonlinearity → EQ | the drive knob | all 22, with a catch |
| 11 · reverb | FDN | delays, \(T_{60}\) | absorption, EQ, matrix (next lecture) |
Next lecture puts every method of the course into one room. Lecture 12 then removes the last hand-designed part: the structure itself. A diffusion model learns the representation and the generator from data.
| Black box | Grey box (DDSP) | |
|---|---|---|
| Representation | network weights | the parameters of a DSP structure |
| Controls | the conditioning inputs | the structure’s own knobs |
| Built-in structure | none (or architecture only) | oscillators, filters, delays, physics |
| Fixed vs. learned | everything learned | structure fixed, numbers learned |
Structure plus gradients
Write the DSP differentiably, choose a loss, let gradient descent do the match step. The structure makes the result generalize and keeps it playable.
The loss decides
What the loss cannot see, the fit cannot learn: frequencies from waveform losses, decays from spectrograms. Measure what you can, optimize the rest.
Keep an exam
A lower loss is not a better model, and a good-sounding fit need not have the true parameters. Test on held-out notes, rooms and quantities.
Fits in this deck: slides/make_ddsp_media.py (PyTorch; numbers in data/ddsp/fit_results.txt). Reverb match from the pyFDN tutorial (DAFx 2026); piano numbers from DDSP_Piano.py. Loss overview after the WS25 guest lecture by Gloria Dal Santo.