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:

  1. 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:

  1. 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.

  2. 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:

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.helpers provides the underlying functionalities that generators and processors are built on — filter design, interpolation, windowing, and frequency conversions.

  • libdamp.datasets wraps various data sources for use as training data.

  • libdamp.losses defines training objectives for comparing two audio signals (RMSLoss, MSSLoss).

  • libdamp.models provides generic neural network building blocks (e.g. BiLSTM) that are used to predict the control parameters within experiments.

  • Experiment ties all of the above together into a trainable Lightning module, configured via gin-config, and is run via the scripts/run.py command-line entry point — see Running experiments for the full training workflow.

References

Indices