FX suite (wauvio/fx)
Modulation, delay and stereo
See it in action: Creative effects
Modulation (effects/modulation.hpp)
FracDelay— ring-buffer delay with Catmull-Rom fractional reads:init(max_samples),push,read(d)(d ≥ 1),at(back),clear,capacity.Tremolo—rate_hz5, optional tempo sync (sync_bpm,sync_beats),depth0.5,stereo_phase_deg(180 = alternating L/R),shape.AutoPan—rate_hz0.5,sync_bpm,sync_beats4,depth1,shape,phase_deg.StereoChorus—rate_hz0.6,depth_ms2.5,delay_ms14,voices1–6 per channel (3),spread,mix0.5,shape.DualMono<T>— adapter that runs a core mono effect (anything withinit(sr)andprocess(Buffer&), such asfx::basic::FlangerorPhaser) independently on each channel. Access sides withleft()/right()or set both viaconfigure(fn); setextra_tail_secondsif the wrapped effect rings.
StereoDelay (effects/delay.hpp)
| Field | Default | Meaning |
|---|---|---|
time_ms, time_ms_right | 350, −1 | Left/both delay; right < 0 = same as left |
sync_bpm, sync_beats_left, sync_beats_right | 0, dotted eighth, −1 | When sync_bpm > 0 beat values replace milliseconds |
feedback | 0.4 | 0..0.98 |
ping_pong | false | Echoes alternate L→R→L |
lowcut_hz, highcut_hz | 0, 6000 | Filters in the feedback path (each repeat darker) |
mod_depth_ms, mod_rate_hz | 0, 0.4 | Tape-style wobble |
mix | 0.35 |
Stereo (effects/stereo.hpp)
StereoImager—width(0 mono, 1 unchanged, 2 double),mid_gain_db,side_gain_db,mono_below_hz(4th-order high-pass on the side signal),balance.Utility—gain_db,pan(equal power),mute,invert_left,invert_right,swap_channels,mono,remove_dc.
Full API listing
wauvio/fx/effects/modulation.hpp
wauvio::fx::class FracDelay
class FracDelay
public:
void init(size_t max_samples) { buf_.assign(max_samples + 8, 0.0f); pos_ = 0; }
void clear() { std::fill(buf_.begin(), buf_.end(), 0.0f); pos_ = 0; }
size_t capacity() const noexcept { return buf_.size() > 8 ? buf_.size() - 8 : 0; }
void push(float x) noexcept { buf_[pos_] = x; pos_ = (pos_ + 1) % buf_.size(); }
/// Read `d` samples back (d >= 1; 1 = the most recent push). Fractional delays use
/// Catmull-Rom interpolation.
float read(double d) const noexcept
wauvio::fx::class Tremolo
class Tremolo : public Effect
public:
double rate_hz = 5.0;
double sync_bpm = 0.0; ///< > 0: rate follows tempo (one cycle per sync_beats)
double sync_beats = 1.0;
double depth = 0.5; ///< 0..1
double stereo_phase_deg = 0.0; ///< right channel LFO offset (180 = alternating L/R)
LfoShape shape = LfoShape::Sine;
std::string name() const override { return "Tremolo"; }
void reset() override { pos_ = 0; }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class AutoPan
class AutoPan : public Effect
public:
double rate_hz = 0.5, sync_bpm = 0.0, sync_beats = 4.0;
double depth = 1.0; ///< 0 = centre, 1 = full left <-> right
LfoShape shape = LfoShape::Sine;
double phase_deg = 0.0;
std::string name() const override { return "AutoPan"; }
void reset() override { pos_ = 0; }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class StereoChorus
class StereoChorus : public Effect
public:
double rate_hz = 0.6;
double depth_ms = 2.5;
double delay_ms = 14.0;
int voices = 3; ///< 1..6 per channel
double spread = 1.0; ///< 0..1: how far apart the L/R LFO phases are
double mix = 0.5;
LfoShape shape = LfoShape::Sine;
std::string name() const override { return "StereoChorus"; }
double tail_seconds() const override { return (delay_ms + depth_ms) * 0.001; }
void reset() override { pos_ = 0; for (auto& d : dl_) d.clear(); }
using Effect::process;
void process(float* L, float* R, size_t n) override
/// Adapter for Wauvio's core mono effects (anything with init(sr) and process(Buffer&)).
/// auto& fl = chain.add<DualMono<wauvio::Flanger>>(); fl.left().rate_hz = 0.3;
/// Use configure() to change both sides at once.
template <class T>
wauvio::fx::class DualMono
class DualMono : public Effect
public:
DualMono() = default;
std::string name() const override { return "DualMono"; }
T& left() { return l_; }
T& right() { return r_; }
template <class F> DualMono& configure(F&& f) { f(l_); f(r_); return *this; }
double extra_tail_seconds = 0.0; ///< set if the wrapped effect rings (e.g. a flanger with feedback)
double tail_seconds() const override { return extra_tail_seconds; }
void reset() override { l_.init(sr_); r_.init(sr_); }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio/fx/effects/delay.hpp
wauvio::fx::class StereoDelay
class StereoDelay : public Effect
public:
// Time: either milliseconds or tempo sync (sync_bpm > 0 -> sync_beats_* are used).
double time_ms = 350.0; ///< left (or both) delay time
double time_ms_right = -1.0; ///< < 0 = same as left
double sync_bpm = 0.0;
double sync_beats_left = div::dotted(div::eighth); ///< default: dotted eighth
double sync_beats_right = -1.0; ///< < 0 = same as left
double feedback = 0.4; ///< 0..0.98
bool ping_pong = false; ///< input into the left line, echoes bounce L -> R -> L ...
double lowcut_hz = 0.0; ///< high-pass in the feedback path (0 = off)
double highcut_hz = 6000.0; ///< low-pass in the feedback path (0 = off) - each repeat gets darker
double mod_depth_ms = 0.0; ///< tape-style wobble
double mod_rate_hz = 0.4;
double mix = 0.35;
std::string name() const override { return "StereoDelay"; }
double tail_seconds() const override
void reset() override { pos_ = 0; dl_[0].clear(); dl_[1].clear(); for (auto& f : lc_) f.reset(); for (auto& f : hc_) f.reset(); }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio/fx/effects/stereo.hpp
wauvio::fx::class StereoImager
class StereoImager : public Effect
public:
double width = 1.0; ///< 0 = mono, 1 = unchanged, 2 = twice as wide
double mid_gain_db = 0.0;
double side_gain_db = 0.0;
double mono_below_hz = 0.0; ///< side signal is high-passed (4th order): bass stays centred. 0 = off
double balance = 0.0; ///< -1 = left only, +1 = right only
std::string name() const override { return "StereoImager"; }
void reset() override { for (auto& b : hp_) b.reset(); }
using Effect::process;
void process(float* L, float* R, size_t n) override
wauvio::fx::class Utility
/// Gain, pan, polarity, channel swap, mono sum, DC removal.
class Utility : public Effect
public:
double gain_db = 0.0;
double pan = 0.0; ///< -1..1, equal power (0 = unchanged)
bool mute = false, invert_left = false, invert_right = false, swap_channels = false, mono = false, remove_dc = false;
std::string name() const override { return "Utility"; }
void reset() override { dc_[0].reset(); dc_[1].reset(); }
using Effect::process;
void process(float* L, float* R, size_t n) override