EQ and dynamics
EQ
Multi-band parametric EQ. A Band has type, freq, gain_db, q (0.7071), slope_db_oct (12/24/36/48, for high/low-pass only) and enabled. Chainable builders: highpass(f, slope), lowpass(f, slope), low_shelf(f, gain, q), high_shelf, peak(f, gain, q = 1.0), notch(f, q = 8), add(Band), clear_bands(), bands(). response_db(freq) returns the combined magnitude response.
Compressor
| Field | Default | Meaning |
|---|---|---|
threshold_db | −18 | |
ratio | 4 | 1 = off, large = limiting |
attack_ms / release_ms | 10 / 100 | |
knee_db | 6 | 0 = hard knee |
makeup_db | 0 | |
mix | 1 | <1 = parallel compression |
stereo_link | 1 | 1 = same gain reduction on both channels |
sidechain_hpf_hz | 0 | High-pass the detector; 0 = off |
detector | Peak | Detect::Peak or RMS |
gain_reduction_db() reports the deepest reduction in the last call. process_sidechain(L, R, n, kL, kR) detects on an external key signal.
Limiter
Lookahead brickwall: ceiling_db (−1), input_gain_db, release_ms (80), lookahead_ms (5), true_peak (true; detector examines 4× interpolated points via a 16-tap Lanczos kernel). Reports latency through latency_samples(); sample peaks are guaranteed under the ceiling, while true peak is kept within a fraction of a dB (master() additionally verifies with the full oversampling meter).
Gate
threshold_db −50, range_db −80, attack_ms 1, hold_ms 30, release_ms 150, hysteresis_db 4.
Pump
Tempo-synced ducking without a kick track: bpm 128, depth 0.8, attack_ms, release_ms 250, shape 1.6, offset_sec, pattern (hit positions in beats) and loop_beats. gain_at(t) exposes the curve. For genuine track-to-track ducking use Compressor::process_sidechain or Mixer::sidechain.
MultibandCompressor
Three bands split at low_freq (120 Hz) and high_freq (2.5 kHz), each with BandSettings (threshold_db −20, ratio 2, attack_ms 20, release_ms 150, makeup_db, knee_db 6); mix; gain_reduction_db(band).
Full API listing
wauvio/fx/effects/eq.hpp
wauvio::fx::class EQ
class EQ : public Effect
public:
struct Band
FilterType type = FilterType::Peak;
double freq = 1000.0;
double gain_db = 0.0; ///< shelves / peak
double q = 0.7071;
int slope_db_oct = 12; ///< HighPass / LowPass only: 12, 24, 36 or 48
bool enabled = true;
std::string name() const override { return "EQ"; }
EQ& highpass(double f, int slope_db_oct = 12) { return add({FilterType::HighPass, f, 0, 0.7071, slope_db_oct, true}); }
EQ& lowpass(double f, int slope_db_oct = 12) { return add({FilterType::LowPass, f, 0, 0.7071, slope_db_oct, true}); }
EQ& low_shelf(double f, double gain_db, double q = 0.7071) { return add({FilterType::LowShelf, f, gain_db, q, 12, true}); }
EQ& high_shelf(double f, double gain_db, double q = 0.7071) { return add({FilterType::HighShelf, f, gain_db, q, 12, true}); }
EQ& peak(double f, double gain_db, double q = 1.0) { return add({FilterType::Peak, f, gain_db, q, 12, true}); }
EQ& notch(double f, double q = 8.0) { return add({FilterType::Notch, f, 0, q, 12, true}); }
EQ& add(const Band& b) { bands_.push_back(b); return *this; }
EQ& clear_bands() { bands_.clear(); return *this; }
std::vector<Band>& bands() { return bands_; }
const std::vector<Band>& bands() const { return bands_; }
/// Combined magnitude response in dB at `freq` (uses the current sample rate).
double response_db(double freq) const
void reset() override { for (auto& ch : st_) for (auto& b : ch) b.reset(); }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio/fx/effects/dynamics.hpp
wauvio::fx::class Compressor
class Compressor : public Effect
public:
enum class Detect { Peak, RMS };
double threshold_db = -18.0;
double ratio = 4.0; ///< 1 = off, large = limiting
double attack_ms = 10.0;
double release_ms = 100.0;
double knee_db = 6.0; ///< 0 = hard knee
double makeup_db = 0.0;
double mix = 1.0; ///< <1 = parallel ("New York") compression
double stereo_link = 1.0; ///< 1 = both channels get the same gain reduction
double sidechain_hpf_hz = 0.0; ///< high-pass the detector (keeps bass from pumping the mix); 0 = off
Detect detector = Detect::Peak;
std::string name() const override { return "Compressor"; }
/// Deepest gain reduction (dB, >= 0) seen during the last process() call.
double gain_reduction_db() const noexcept { return max_gr_db_; }
void reset() override { gr_[0] = gr_[1] = 0.0; ms_[0] = ms_[1] = 0.0; hp_[0].reset(); hp_[1].reset(); max_gr_db_ = 0.0; }
using Effect::process;
void process(float* L, float* R, size_t n) override { process_sidechain(L, R, n, nullptr, nullptr); }
/// Detect on an external key signal (e.g. a kick) instead of the input itself.
/// kL/kR may be null (= use the input). Key buffers must hold n samples.
void process_sidechain(float* L, float* R, size_t n, const float* kL, const float* kR)
wauvio::fx::class Limiter
// Limiter - lookahead brickwall
// Guarantees |output sample| <= ceiling. With true_peak the detector also looks at
// 4x-interpolated points between samples (16-tap Lanczos), so the inter-sample
// (true) peak stays within a fraction of a dB of the ceiling. The ceiling is only
// mathematically guaranteed for sample peaks; fx::master() additionally verifies the
// true peak with the full oversampling meter.
class Limiter : public Effect
public:
double ceiling_db = -1.0;
double input_gain_db = 0.0; ///< push into the limiter (loudness maximiser)
double release_ms = 80.0;
double lookahead_ms = 5.0;
bool true_peak = true;
std::string name() const override { return "Limiter"; }
size_t latency_samples() const override { return la_samples() + extra(); }
double gain_reduction_db() const noexcept { return max_gr_db_; }
void reset() override
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class Gate
class Gate : public Effect
public:
double threshold_db = -50.0;
double range_db = -80.0; ///< attenuation when closed
double attack_ms = 1.0;
double hold_ms = 30.0;
double release_ms = 150.0;
double hysteresis_db = 4.0;
std::string name() const override { return "Gate"; }
void reset() override { env_ = 0.0; open_ = false; hold_ = 0; g_ = 1.0; }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class Pump
// Pump - tempo-synced ducking. Gives the house/trance "sidechain" pulse without
// needing a separate kick track. For real track-to-track sidechaining use
// Compressor::process_sidechain (or fx::Mixer::sidechain).
class Pump : public Effect
public:
double bpm = 128.0;
double depth = 0.8; ///< 0 = no ducking, 1 = full silence at the hit
double attack_ms = 4.0;
double release_ms = 250.0;
double shape = 1.6; ///< 1 = linear recovery, >1 = fast then settle, <1 = slow start
double offset_sec = 0.0; ///< time of the first hit
std::vector<double> pattern { 0.0 }; ///< hit positions in beats inside one loop
double loop_beats = 1.0; ///< loop length in beats (1 = every beat; 4 = hits placed in a bar)
std::string name() const override { return "Pump"; }
void reset() override { pos_ = 0; }
/// Gain at `t` seconds (the curve the effect applies).
double gain_at(double t) const
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class MultibandCompressor
class MultibandCompressor : public Effect
public:
struct BandSettings
double threshold_db = -20.0, ratio = 2.0, attack_ms = 20.0, release_ms = 150.0, makeup_db = 0.0, knee_db = 6.0;
double low_freq = 120.0; ///< low / mid crossover
double high_freq = 2500.0; ///< mid / high crossover
BandSettings low, mid, high;
double mix = 1.0;
MultibandCompressor()
std::string name() const override { return "MultibandCompressor"; }
/// Deepest gain reduction (dB) per band during the last process() call.
double gain_reduction_db(int band) const { return gr_[std::min(2, std::max(0, band))]; }
void reset() override
using Effect::process;
void process(float* L, float* R, size_t n) override