|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 61 of file ladder.hpp.
#include <ladder.hpp>
Public Member Functions | |
| void | set_cutoff_su (float su) |
| Set cutoff frequency from normalized [0,1] signal unit. | |
| void | set_resonance_su (float su) |
| Set resonance from normalized [0,1] signal unit. | |
| void | set_drive_su (float su) |
| Set drive from normalized [0,1] signal unit. | |
| void | process (float *buf, uint16_t frames, const float *cutoff_mod=nullptr, float mod_depth=0.0f) |
| Process a block of audio samples in-place (4-pole lowpass) | |
| void | reset () |
| Reset filter state (audio state only, not parameter smoothers) | |
Static Public Attributes | |
| static constexpr float | kMinFreqHz = 20.0f |
| static constexpr float | kMaxFreqHz = 20000.0f |
| static constexpr float | kCutoffOctaves = 9.965784f |
| static constexpr float | kMinDrive = 1.0f |
| static constexpr float | kMaxDrive = 4.0f |
Friends | |
| struct | LadderTestAccess |
|
inline |
Set cutoff frequency from normalized [0,1] signal unit.
| su | Unipolar [0,1] — exponentially mapped to 20–20000 Hz |
First call auto-initializes (no ramp from 0). Subsequent calls smooth via CriticalDamp (30ms settling, no overshoot).
Definition at line 81 of file ladder.hpp.
References sbl::dsp::math::clamp01(), kCutoffOctaves, kMinFreqHz, sbl::dsp::primitives::CriticalDamp::reset(), and sbl::dsp::math::su_to_hz().
|
inline |
Set resonance from normalized [0,1] signal unit.
| su | Unipolar [0,1] — 0 = flat, 1 = self-oscillation |
First call auto-initializes. Subsequent calls smooth via CriticalDamp (20ms settling, no overshoot).
Definition at line 100 of file ladder.hpp.
References sbl::dsp::math::clamp01(), and sbl::dsp::primitives::CriticalDamp::reset().
|
inline |
Set drive from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 1.0–4.0 drive |
First call auto-initializes. Subsequent calls smooth via OnePole (20ms settling).
Definition at line 118 of file ladder.hpp.
References sbl::dsp::math::clamp01(), kMaxDrive, kMinDrive, and sbl::dsp::primitives::ParameterSmoother::reset().
|
inline |
Process a block of audio samples in-place (4-pole lowpass)
Per-sample CriticalDamp/OnePole smoothing for cutoff, resonance, and drive. When cutoff_mod is provided, exponential modulation is applied around the smoothed cutoff center per-sample.
| buf | Float audio buffer (modified in-place) |
| frames | Number of samples |
| cutoff_mod | Cutoff modulation signal [-1,1] (nullptr = no modulation) |
| mod_depth | Modulation depth in octaves (e.g., 2.0 = ±2 octaves) |
Definition at line 142 of file ladder.hpp.
References sbl::dsp::math::exp_mod(), sbl::dsp::math::fast_tanhf(), kMaxFreqHz, kMinFreqHz, sbl::dsp::primitives::CriticalDamp::process(), sbl::dsp::primitives::ParameterSmoother::process(), and sbl::dsp::types::SAMPLE_RATE_F.
|
inline |
Reset filter state (audio state only, not parameter smoothers)
Definition at line 207 of file ladder.hpp.
|
friend |
Definition at line 215 of file ladder.hpp.
|
staticconstexpr |
Definition at line 66 of file ladder.hpp.
Referenced by process(), and set_cutoff_su().
|
staticconstexpr |
Definition at line 67 of file ladder.hpp.
Referenced by process().
|
staticconstexpr |
Definition at line 68 of file ladder.hpp.
Referenced by set_cutoff_su().
|
staticconstexpr |
Definition at line 69 of file ladder.hpp.
Referenced by set_drive_su().
|
staticconstexpr |
Definition at line 70 of file ladder.hpp.
Referenced by set_drive_su().