libdamp¶
Framework for experiments with Differentiable Audio and Music Processing in PyTorch.
Goals¶
Differentiable digital signal processing (DDSP) [1] is an umbrella term for including classical DSP building blocks (such as filters, oscillators, and signal transforms) in deep learning pipelines.
libdamp offers a collection of DSP building blocks written in PyTorch, so that they can used within its automatic differentiation framework.
In addition to the differentiable building blocks — oscillators, noise
generators, filters, envelopes, transforms, etc. — libdamp offers the infrastructure for running experiments, including configuration with gin-config datasets, losses, and training with Lightning.
The library grew out of research on differentiable wind instrument modeling using pulsetable synthesis, but its building blocks are intentionally generic and reusable for other audio and music processing tasks and DDSP-related research.
Publications¶
The experiments provided in this repository accompany the following publications:
Simon Schwär, Christian Dittmar, Stefan Balke, and Meinard Müller. Differentiable Pulsetable Synthesis for Wind Instrument Modeling. In Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP): 14792–14796, Barcelona, Spain, 2026.
If you use libdamp in your research, please consider citing one of the above works.
In addition, we used libdamp for the following talks and workshop contributions:
Manuel Peters and Simon Schwär. Differentiable Wind Instrument Synthesis with Pulsetables and Beyond. Workshop on Audio & Music Signal Processing (pre-ICASSP), Barcelona, Spain, 2026.
Simon Schwär, Christian Dittmar, Stefan Balke, Meinard Müller. Comparing Differentiable Implementations of Classical Sound Synthesis Methods. DAGA, Dresden, 2026.
Architecture¶
libdamp is organized around two complementary kinds of stateful audio building blocks, plus
the supporting code needed to train models built from them:
libdamp.generatorsproduce a new audio signal from given control parameters such as frequency or amplitude trajectories (e.g.SinusoidalOsc,HarmonicOsc,TableOsc).libdamp.processorsmodify an existing audio signal according to control parameters (e.g.GainEnvelope,ButterworthLowPassFilter).
Both provide a similar interface: update() sets new control parameters, generate() (for libdamp.generators) or
process() (for libdamp.processors) produces the next chunk of audio, and clear() resets internal state.
This shared, stateful design lets generators and processors be called repeatedly without updating the parameters, e.g. if the frame rate of a real-time system is separate from the update rate of the parameter estimation.
The remaining subpackages support building and training models out of these blocks:
libdamp.helpersprovides the underlying functionalities that generators and processors are built on — filter design, interpolation, windowing, and frequency conversions.libdamp.datasetswraps various data sources for use as training data.libdamp.lossesdefines training objectives for comparing two audio signals (RMSLoss,MSSLoss).libdamp.modelsprovides generic neural network building blocks (e.g.BiLSTM) that are used to predict the control parameters within experiments.Experimentties all of the above together into a trainable Lightning module, configured via gin-config, and is run via thescripts/run.pycommand-line entry point — see Running experiments for the full training workflow.
References¶
API Reference
- Generators
- Processors
- Datasets
- Helpers
Convolutionfreqz()combined_freqz()design_resonant_filter()design_butter_bandpass()design_butter_filter()design_fir_filter()iir_freq_sampling()hz2midi()midi2hz()timbre2harmonics()incremental_mod()incremental_mod_triton()incremental_mod_python()SelectItemConvStackFreqToBinsLogitsToFreqexp_sigmoid()tensor_linspace()apply_along_dim()ensure_tensor()interpolate_samples()smooth()cubic_hermite_splines()interpolate_pchip()interpolate_linear()poly()get_window()stft()istft()hilbert()
- Losses
- Models