Acoustic DNA Resonator — Differentiable FDN
Analyzes a sound's spectral envelope, per-band decay rates, and modal peaks — its "acoustic DNA" — then trains a differentiable Feedback Delay Network (FDN) whose impulse response approximates those features. The same input is passed through the trained FDN as a self-derived resonator / spectral feedback chamber.
What this does
This script implements an Acoustic DNA Resonator — it analyses the selected Sound's spectral envelope, per-band decay rates, and modal peaks (the "acoustic DNA"), then trains a small differentiable Feedback Delay Network (PyTorch) whose impulse response approximates those features. The same input sound is then passed through the trained FDN as a self-derived resonator / spectral feedback chamber, dry/wet mixed, and returned as a new (optionally multichannel) Sound.
Key Features:
- 3 Presets — Bright shimmer chamber, Dark long decay, Subtle enhancement, plus Custom
- Acoustic DNA analysis — spectral envelope, per-band decay rates, modal peaks
- Differentiable FDN — Householder feedback matrix, one-pole shelf damping, prime delay lengths
- Self-excitation — the input sound excites its own trained resonator
- Multichannel output — up to 8 decorrelated channels, per-channel excitation preserves spatial image
- Training visualisation — loss curve, band decay bar chart, spectrogram comparison
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
AcousticDNAResonator.praat. - Choose a preset from the dropdown (Bright shimmer chamber, Dark long decay, Subtle enhancement, or Custom).
- Adjust parameters: FDN size (4–32), IR duration (0.25–15 s), Epochs (10–5000), Dry/wet mix, Normalize mode, Output channels.
- Optionally select a TextGrid (first tier, non-empty intervals) for event-based analysis.
- Click OK — Python engine analyses the sound, trains the FDN, renders output.
- Result
originalname_dnaresappears in the Objects window.
pip install numpy scipy soundfile torch. The engine analyses the input's spectral envelope and trains an FDN to match it. Training is CPU/GPU-safe — the default run takes 30–60 seconds on a modern CPU. The output can be multichannel (up to 8 channels); when output channels match input channels, each output channel processes its own input channel, preserving the spatial image.
3 Presets
| Preset | FDN Size | IR Duration (s) | Epochs | Dry/Wet | Character |
|---|---|---|---|---|---|
| Bright shimmer chamber | 10 | 2.0 | 600 | 0.55 | Short, bright resonance — favours upper partials |
| Dark long decay | 24 | 6.0 | 1000 | 0.45 | Cavernous, dark reverb — large FDN, long IR |
| Subtle enhancement | 12 | 2.5 | 500 | 0.18 | Light touch — mostly dry, subtle resonance |
FDN Theory — Differentiable Feedback Delay Network
FDN structure
An FDN consists of N parallel delay lines with lengths dᵢ, a feedback matrix A, and input/output gains g_in, g_out. The per-line transfer function is:
D(z) = g₀ · (1 - a) / (1 - a·z⁻ᵈ) (one-pole shelf damping)
Feedback matrix: Householder reflector — A = I - 2vvᵀ with ‖v‖ = 1. Orthogonal by construction, stable, and parameterised by a single vector.
Transfer function: H(z) = g_outᵀ · (I - D(z)A)⁻¹ · D(z) · g_in
For Householder feedback, I - D·A = (I - D) + 2·D·v·vᵀ is diagonal plus rank-1. The exact inverse is computed elementwise:
- B = I - D (diagonal)
- u = 2·D·v
- denom = 1 + vᵀ · B⁻¹ · u
- H = B⁻¹ · g_in - B⁻¹ · u · (vᵀ · B⁻¹ · g_in) / denom
Parameters
Core parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| Preset | 4 options + Custom | Bright shimmer chamber | Quick configuration for different resonance characters |
| FDN_size | 4–32 | 16 | Number of parallel delay lines — larger = denser reverb |
| IR_duration | 0.25–15 s | 4.0 | Length of the impulse response to train and render |
| Epochs | 10–5000 | 800 | Training iterations — more = better fit, slower |
| Dry_wet | 0–1 | 0.35 | Blend of dry (original) and wet (resonated) signals |
| Normalize_mode | none / peak / rms / loudness | rms | Output level normalisation |
| Out_channels | match input / mono / stereo / 4–8 | match input | Number of output channels — preserves spatial image |
Applications
Creative reverb / resonance design
Use case: Turn any sound into its own resonant chamber — the FDN learns the input's spectral DNA and creates a custom reverb tailored to that sound.
Settings: Dark long decay preset for cavernous reverb; Bright shimmer chamber for short, bright resonance.
Multichannel spatial processing
Use case: Process a stereo or surround recording with per-channel decorrelated taps, preserving the spatial image.
Settings: Out_channels = match input. Each channel excites its own decorrelated tap of the same trained FDN.
Experimental instrument design
Use case: Use the FDN as a performable resonator — feed different inputs through the same trained FDN for timbral variation.
Settings: Train on a base sound (e.g., a piano note), then process other sounds through the same FDN for cross-synthesis.
Workflow: Voice → Dark cavernous reverb
Source: Spoken word or sung phrase.
Settings: Dark long decay preset (FDN=24, IR=6s, dry/wet=0.45).
Result: The voice is placed in a custom, cavernous space that matches its spectral character — the reverb tail follows the voice's formants and decay rates.
Workflow: Stereo field recording → Resonant spatialisation
Source: Stereo field recording (birds, water, wind).
Settings: Subtle enhancement preset, Out_channels = match input (stereo).
Result: Each stereo channel gets its own decorrelated resonant treatment — the spatial image is preserved while the sound takes on a subtle, shimmering resonance.
Workflow: Piano → Bright shimmer chamber
Source: Piano recording.
Settings: Bright shimmer chamber preset (FDN=10, IR=2s, dry/wet=0.55).
Result: The piano's partials are enhanced by a bright, shimmering resonance — like the piano is playing inside a metal chamber.
• Training is slow: Reduce FDN_size (8–12), reduce Epochs (300–500), or use a GPU (
--device cuda in the Python backend).• Output is silent or distorted: Check that the input has reasonable amplitude. The FDN is trained on the input's spectral envelope; very quiet inputs may produce near-silent output.
• Multichannel output has channel imbalance: The decorrelated taps are unit-norm scaled to sqrt(n) so expected energy matches. If imbalance persists, check the source channel levels.
• Training loss not decreasing: The FDN may be too large for the input (try smaller FDN_size) or the IR_duration too short (increase to 4–6 s).
• TextGrid events not used: v0.1 exports events from the TextGrid but they are informational only (not yet used to drive time-varying targets). Future versions will use them for event-aware training.
Visualisation
- Input waveform — the original sound
- Rendered output spectrogram — the resonating sound (channel 1)
- Training loss curve — shows how the FDN fits the input's acoustic DNA
- Per-band decay bar chart — estimated decay times per frequency band (low → high Hz)
- Summary panel — FDN size, epochs, loss values, decay estimate, RMS, delays