Skip to main content

Faustax

Faustax supplies batched, differentiable audio processors for JAX. The applications are parameter estimation, style transfer, automatic mixing, and data augmentation.

Each effect is a small program in Faust, built mostly from Faust Libraries. The Faust NNX backend compiles each program ahead-of-time to a Flax NNX module that works with jax.jit and jax.vmap. Behind the scenes, the module generates one sample of audio at a time with nnx.scan. One intentional exception exists: the noise-shaped reverb applies a synthesized 65536-tap FIR, which is hand-written JAX code, not Faust.

End users do not need the Faust compiler. The repository contains the generated Python modules in src/faustax/_generated/. The runtime dependencies are only jax, flax, numpy, librosa, and safetensors.

Documentation: https://dbraun.github.io/faustax/

Installation

pip install faustax  # or: uv add faustax

Faustax needs Python 3.11 or later. The base installation runs on CPU JAX and doesn't need the Faust compiler. Each extra adds the dependencies of one optional feature:

Install Adds
faustax[audiotree] audiotree, for the transform adapter (faustax.audiotree)
faustax[realtime] sounddevice, for the duplex stream in faustax.realtime
faustax[viz] matplotlib, for the --plot option of the fitting examples
faustax[vst-datasets] audiotree and dawdreamer, for the faustax-vst-* dataset commands

Ask for several extras at the same time:

pip install "faustax[realtime,viz]"

The CUDA wheels of JAX are not an extra of Faustax, because the wheel to install depends on your CUDA version. Install them next to Faustax:

pip install faustax "jax[cuda13]"

Usage

from flax import nnx
import jax.numpy as jnp
from faustax import Compressor

comp = Compressor(sample_rate=44100)

x = jnp.zeros((4, 2, 44100))  # (batch, channels, samples)

# Physical parameters (scalars broadcast; arrays of shape (batch,) vary per item)
y = comp.process(x, threshold_db=-24.0, ratio=4.0, attack_ms=10.0, release_ms=100.0)

# dasp-style: normalized parameters on [0, 1], shape (batch, num_params),
# e.g. straight from a neural network controller
rngs = nnx.Rngs(0)
params = rngs.uniform((4, comp.num_params))
y = comp.process_normalized(x, params)

Every processor exposes param_ranges. The library introspects these ranges from the Faust slider declarations; no person maintains them by hand. Every processor also exposes the underlying NNX module as .module. Use .module for streaming (process_block) and for NNX-native training workflows.

Effects

Processor Source
Gain src/faustax/dsp/gain.dsp
Distortion (soft-clipping tanh with drive) src/faustax/dsp/distortion.dsp
ParametricEQ (RBJ low shelf, 4 peaking bands, RBJ high shelf) src/faustax/dsp/parametric_eq.dsp
Compressor (feed-forward, soft knee, makeup gain) src/faustax/dsp/compressor.dsp
Freeverb (Schroeder reverb with dry/wet mix) src/faustax/dsp/freeverb.dsp
NoiseShapedReverb (12-band noise shaping, WASPAA 2021) src/faustax/reverb.py (JAX, not Faust)
StereoPanner (equal-power mono-to-stereo pan) src/faustax/dsp/stereo_panner.dsp
StereoWidener (mid-side width control) src/faustax/dsp/stereo_widener.dsp
functional.stereo_bus (per-track sends, stereo sum) pure JAX (dynamic track count)
diffvox.EQ (2 peaks, 2 shelves, low/high pass) src/faustax/dsp/diffvox/eq.dsp
diffvox.Compressor (compressor-expander w/ lookahead) src/faustax/dsp/diffvox/compressor.dsp
diffvox.PingPongDelay (cross-fed stereo delay send) src/faustax/dsp/diffvox/pingpong.dsp
diffvox.FDN (6-line reverb send with decay FIRs) src/faustax/dsp/diffvox/fdn.dsp

Faustax has the role of dasp-pytorch in the JAX ecosystem, with a different implementation strategy and different performance characteristics. The first block of the table is the dasp-pytorch parity set. Every processor that dasp-pytorch implements exists here with the same parameter names and the same semantics. (The expander of dasp-pytorch is unimplemented upstream.) Two upgrades are intentional. The EQ and the compressor are exact per-sample recurrences, not frequency-sampled approximations as in dasp-pytorch. The EQ is coefficient-exact against the RBJ formulas of dasp-pytorch. The Faustax compressor applies release_ms; dasp-pytorch accepts release_ms but ignores it. The Faustax reverb keys its shaping noise with rng=; dasp-pytorch uses unseeded torch.randn. This means Faustax runs are reproducible by default. Performance versus dasp-pytorch below gives the measured ratios for both libraries.

The four faustax.diffvox processors port the vocal effects chain of DiffVox (Yu et al., DAFx25). Each processor matches the real-time reference implementation of diffvox to float32 precision. faustax.diffvox loads its two curated preset datasets directly from a diffvox checkout. The datasets contain 385 internal presets and 70 MedleyDB presets, fit to real vocal productions. The datasets include the Gaussian parameter prior, so you can sample new vocal-chain settings. diffvox.Chain renders the full chain: the EQ, the compressor, the panned direct signal, and the delay and reverb sends.

from faustax.diffvox import Chain, load_preset_dataset

ds = load_preset_dataset("/path/to/diffvox/presets/internal")
chain = Chain(sample_rate=44100)
wet_stereo = chain.process(dry_mono, ds[7])   # (batch, 1, T) -> (batch, 2, T)

All effects share these semantics. Every effect is zero-latency and causal: it has no lookahead and no latency compensation. The output length always equals the input length. Thus, the effect truncates a reverb or delay tail at the end of the excerpt. Zero-pad the input if you need the decay. Deterministic effects ignore the rng argument. The rng argument exists for stochastic DSPs: the noise-shaped reverb, and Faust programs that call random_* foreign functions. For double precision, construct the processor with faust_float=jnp.float64 and enable jax_enable_x64. The whole state carry then follows that dtype.

Documentation

Introduction Install, the Processor API, normalized parameters
Status The known defect, the self-checking vectorizer, and what does not differentiate
Parameter estimation Recover effect settings, response curves and instrument physics by gradient descent; saving what you trained
Learnable soundfiles and menus Trainable wavetables ([param:1]) and categorical nentry menus as Gumbel-softmax
audiotree integration Any processor as a batched random transform in a grain data pipeline
argbind configuration Configure every slider from YAML
VST reference datasets Sweep a VST3 plugin's parameters and export (dry, wet) pairs to fit against
Real-time deployment Streaming process_block and the sounddevice callback
Performance CPU/GPU benchmarks, unroll, data parallelism across cores
Development Repository layout, regenerating modules, adding an effect
API reference Every public module, class and function
Custom gradient primitives faustax.ops — memory-light custom-VJP recursive filters
NNX backend notes What makes a generated module fast or slow: carry layout, unroll, GPU scan latency
Future work Scoped but unstarted tasks, and the reasons behind them

The examples/ directory contains runnable scripts.

Performance versus dasp-pytorch

The two libraries have different performance characteristics because their implementations are different. An exact per-sample recurrence is sequential in time. The frequency-domain approximations of dasp-pytorch are a small number of large batched tensor operations.

On CPU, the Faustax EQ costs approximately 4x the dasp-pytorch forward time and 6-8x the dasp-pytorch gradient time. This cost is the cost of coefficient-exact IIR output. The Faustax compressor is at parity with the dasp-pytorch compressor. The Faustax FFT-convolution reverb trains 20-30x faster than the direct convolution of dasp-pytorch.

On GPU, a sequential scan costs approximately 0.5-1 s per call at any batch size. Thus, dasp-pytorch is faster at small batch sizes. The Faustax wall time stays almost constant as the batch size grows. The gap for recursive effects decreases to approximately 5x at batch size 256. The Faustax reverb is faster than the dasp-pytorch reverb at every batch size. Run the Faustax scan on CPU when the number of parallel lanes is below approximately 64.

Use Faustax when you need exactness, streaming parity with deployment, fast reverb or dynamics training, or wide-batch or CPU throughput. Use dasp-pytorch frequency sampling when small-batch EQ gradients on GPU are the most important factor. The Performance page shows the measured tables for each claim in this section.

Development

uv sync
uv run pytest

uv sync is the only necessary setup step. The test suite runs without a Faust compiler. The tests that require a Faust compiler skip automatically. See CONTRIBUTING.md for how to add effects, how to get a Faust with the NNX backend, and the licensing rules for contributions.

Status

Alpha (0.0.x). The public API can change between releases. One known defect limits what you can depend on: Freeverb diverges from Faust's C++ backend at sample 1116 and after, the length of its shortest comb delay. Every other effect matches the C++ backend to < 2e-5 max absolute error. Status lists that defect in full, and three more facts to know before you depend on the library.

License

MIT — see LICENSE.

Some components carry additional third-party terms. NOTICE records all of these terms:

  • Generated modules (src/faustax/_generated/) are Faust compiler output. Their scaffolding comes from GRAME's Faust architecture file, whose grant explicitly permits redistribution under terms of your choice. Their DSP body is a translation of Faust standard library code that carries an LGPL exception, and the exception grants the same freedom. Individual library functions declare their own MIT or MIT-style STK-4.3 terms. NOTICE reproduces the copyright notices of those terms.
  • faustax.ops and faustax.dynamics port gradient rules and conventions from Chin-Yun Yu's MIT-licensed torchlpc, philtorch and torchcomp.
  • The dasp-pytorch parity layer (faustax.reverb and the parity .dsp sources) ports Apache-2.0-licensed dasp-pytorch. A copy of that license ships as LICENSE-APACHE-2.0.
  • fdn_toolbox (optional, dev-fdn group) is GPL-3.0. It is not required and is not vendored. It is currently a private repository. The two files that use it skip without it.

tools/collect_attribution.py --check verifies that NOTICE covers every library that the generated modules use. CI runs this check on every PR.

Citing

CITATION.cff contains the Faustax citation; GitHub's "Cite this repository" feature renders it. The file also contains a machine-readable reference list for the work that Faustax is based on. If your research relies on a particular layer, cite its upstream work together with Faustax:

  • Any Faustax processorFaust (GitHub): Orlarey, Letz & Fober, Faust: an Efficient Functional Approach to DSP Programming, in New Computational Paradigms for Computer Music, Delatour, 2009, pp. 65–96 — the compiler and standard libraries the modules are generated from.
  • The dasp-pytorch parity setdasp-pytorch and Steinmetz, Bryan & Reiss, Style Transfer of Audio Effects with Differentiable Signal Processing, JAES 70(9), 2022; for NoiseShapedReverb, Steinmetz, Ithapu & Calamia, Filtered Noise Shaping for Time Domain Room Impulse Response Estimation from Reverberant Speech, WASPAA 2021; for the compressor design, Giannoulis, Massberg & Reiss, Digital Dynamic Range Compressor Design—A Tutorial and Analysis, JAES 60(6), 2012.
  • faustax.ops / faustax.dynamics / faustax.filters — Yu et al., Differentiable All-pole Filters for Time-varying Audio Systems, DAFx 2024 (torchlpc / torchcomp), and philtorch.
  • faustax.diffvox — Yu et al., DiffVox: A Differentiable Model for Capturing and Analysing Vocal Effects Distributions, DAFx 2025.
  • Learnable normalized parameters — Ben Hayes, Magic Clamp, 2025.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faustax-0.0.1.tar.gz (546.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faustax-0.0.1-py3-none-any.whl (538.9 kB view details)

Uploaded Python 3

File details

Details for the file faustax-0.0.1.tar.gz.

File metadata

  • Download URL: faustax-0.0.1.tar.gz
  • Upload date:
  • Size: 546.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for faustax-0.0.1.tar.gz
Algorithm Hash digest
SHA256 005e26e35eae5135429493ff853c672613f980758f271571ef429f8f6028cc98
MD5 bb0627ea6bb6314bc0ad82d5241b7302
BLAKE2b-256 fb96bcbc9beb1d57ba4e7c74902dbaa822e51522b8d5f25a97d5d5f9271123a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for faustax-0.0.1.tar.gz:

Publisher: publish.yml on DBraun/faustax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file faustax-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: faustax-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 538.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for faustax-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cb9d8a9078cd643b1eb1e6c6d4ca2f35d2e5611c2ac18ecf167dcaca22e0a1e
MD5 6c9fc357f8704275c1d7385f1d41c37c
BLAKE2b-256 727e6198785b530bc3a43154e84c398b8abf00c826a1a8765996b7213ca0f6be

See more details on using hashes here.

Provenance

The following attestation bundles were made for faustax-0.0.1-py3-none-any.whl:

Publisher: publish.yml on DBraun/faustax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page