Search guides and the APICtrl K
  1. API reference
  2. DSP

multiband.h

Multiband dynamics, wired once.

#include <sonore/multiband.h>
On this page

Design notes

crossover.h splits into bands that sum flat and compressors.h has the gain computers; what every multiband plugin then rewrites is the wiring -- two splitters for stereo, a stereo-linked detector per band, downward AND upward compression per band (the OTT shape that made "multiband" a household word), per-band bypass and solo, and a gain-reduction meter per band for the faceplate. Rewired by hand it comes out with the bands detected separately on the two channels (the image wanders), or with the upward stage's floor unbounded (a fade-out ends in a roar), or without the meters. This is the wiring.

Per band, downward compression through a VcaCompressor (the exact, clean gain law) and upward compression through dynamics.h's UpwardCompressor, both from ONE stereo-linked peak detector, the gains multiplied. The bands then sum, and because the splitter's bands sum flat, a band at ratio 1 is transparent: the unit test asks for the sum to be the input to 0.05 dB with every band idle.

Included by dsp.h.

Types 1

template <int Bands = 3> class MultibandDynamics

Stereo multiband compression, downward and upward in every band, over a MultibandSplitter whose bands sum flat (see the file comment for the wiring and why).

Call prepare() before audio; it applies every band's settings for the rate and clears the state. Until setCrossover() the splits are the splitter's, log-spaced between 100 Hz and 8 kHz. setCrossover(), setBand() and process() -- one stereo frame -- run on the audio thread. Each band's detector is stereo-linked, so the image stays put, and keeps running while the band is bypassed; soloing any band mutes the bands not soloed. gainChangeDb() is the faceplate's meter, makeup included.

↑↓ to move↵ to openEvery public name in the headers, and every guide