dynamic_eq.h
The dynamic equaliser: a band that compresses itself.
#include <sonore/dynamic_eq.h>- 1type
- Guides: Getting started, MIDI and MPE
On this page
Design notes
The modern mixing tool this library kept ALMOST having: eq.h knows how to make a matched bell, compressors.h knows how a gain computer behaves, and a dynamic EQ is exactly their composition. Per band, a detector listens to the band's own slice of the spectrum (of the input, or of a sidechain key), and the measured level drives the band's gain through the standard compressor law, Giannoulis, Massberg & Reiss, "Digital Dynamic Range Compressor Design: A Tutorial and Analysis" (JAES 2012): rectified envelope, soft knee in the log domain, dB-domain attack/release smoothing of the control signal. The band itself is eq.h's Vicanek matched biquad, redesigned at control rate as the gain moves.
Why this beats a multiband compressor for surgical work: a crossover splits and re-sums the WHOLE signal, so its band edges are in the sound even at rest; a dynamic EQ is bell-shaped gain on the intact signal: at rest (ratio 1, static gain 0) a band is exactly unity.
Each band works downward (cut when its slice is loud: resonance taming, de-essing) or upward (lift when it is quiet), always through a RANGE cap, because an uncapped upward band on silence is a noise amplifier.
The detector for a bell is the RBJ constant-0dB-peak bandpass at the same frequency and Q, so the level it reads IS the level in the band; shelf bands detect through the matching low/highpass. Dynamics apply to Bell, LowShelf and HighShelf bands; pass/notch shapes are static by nature.
ONE PER CHANNEL; for linked stereo, feed both instances the same key.
Included by dsp.h.
Types 1
template<int Bands = 4> class DynamicEq
An equaliser of up to Bands bands, each of which can compress or expand its own slice of the spectrum (see the file comment for the design).
One channel, per sample; for linked stereo give both instances the same key through process(x, key). Call setSampleRate() in prepare(), then set the bands with setBand(): a band does nothing until its Band says enabled. The setters and process() run on the audio thread. The dynamic gain is worked out every 16 samples and a band's filter redesigned only when that gain moved by more than 0.05 dB; setBand() itself redesigns at once. gainDb() reads back each band's dynamic gain, for a meter.