|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 46 of file shaper.hpp.
#include <shaper.hpp>
Public Member Functions | |
| Shaper ()=default | |
| void | set_depth_su (float su) |
| Set fold depth from normalized [0,1] signal unit. | |
| void | set_bias_su (float su) |
| Set asymmetric bias from normalized [0,1] signal unit. | |
| void | set_drive_su (float su) |
| Set saturation drive from normalized [0,1] signal unit. | |
| void | set_mix_su (float su) |
| Set dry/wet mix from normalized [0,1] signal unit. | |
| void | set_compensate (bool compensate) |
| void | process (float *buf, uint16_t frames, const float *depth_mod=nullptr, float mod_depth=0.0f) |
| void | reset () |
| Reset internal state (WavefoldAA history + oversampling) | |
Static Public Attributes | |
| static constexpr float | kMinDepth = 1.0f |
| static constexpr float | kMaxDepth = 10.0f |
| static constexpr float | kMinBias = -0.1f |
| static constexpr float | kMaxBias = 0.1f |
| static constexpr float | kMinDrive = 1.0f |
| static constexpr float | kMaxDrive = 4.0f |
Friends | |
| struct | ShaperTestAccess |
|
default |
|
inline |
Set fold depth from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 1.0–10.0 |
Depth uses ParameterInterpolator (per-sample linear ramp) inside process(), not exponential smoothing. This is correct for nonlinear parameters where the first-sample spike from exponential smoothers would cause audible clicks in the wavefolder.
Definition at line 71 of file shaper.hpp.
|
inline |
Set asymmetric bias from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to -0.1–0.1 |
0.5 = no bias (symmetric, odd harmonics only). 0.0 = negative bias (-0.1), 1.0 = positive bias (+0.1). Uses ParameterInterpolator internally (same rationale as depth).
Definition at line 90 of file shaper.hpp.
|
inline |
Set saturation drive from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 1.0–4.0 |
Smoothed via OnePole (20ms timbral settling).
Definition at line 107 of file shaper.hpp.
References kMaxDrive, kMinDrive, and sbl::dsp::primitives::ParameterSmoother::reset().
|
inline |
Set dry/wet mix from normalized [0,1] signal unit.
| su | Unipolar [0,1] — 0 = dry, 1 = full wet |
Smoothed via OnePole (15ms gain settling).
Definition at line 126 of file shaper.hpp.
References sbl::dsp::primitives::ParameterSmoother::reset().
|
inline |
Output level compensation: when true (default), output level stays roughly constant as depth increases. When false, higher depth = more level into downstream.
Definition at line 141 of file shaper.hpp.
|
inline |
Process block in-place (mono). Per-sample ParameterInterpolator ramp for depth and bias. OnePole smoothing for drive and mix. When depth_mod is provided, additive depth modulation is applied per-sample on top of the ParameterInterpolator ramp.
| buf | Float audio buffer (modified in-place) |
| frames | Number of samples |
| depth_mod | Depth modulation signal [-1,1] (nullptr = no modulation) |
| mod_depth | Modulation range in fold-depth units (e.g., 3.0 = ±3) |
Definition at line 155 of file shaper.hpp.
References sbl::dsp::primitives::ParameterInterpolator::next(), sbl::dsp::primitives::ParameterSmoother::process(), sbl::dsp::comp::WavefoldAA::process(), sbl::dsp::comp::WarmSaturator::process(), and sbl::dsp::primitives::ParameterSmoother::value().
|
inline |
Reset internal state (WavefoldAA history + oversampling)
Definition at line 210 of file shaper.hpp.
References sbl::dsp::comp::WavefoldAA::reset().
|
friend |
Definition at line 218 of file shaper.hpp.
|
staticconstexpr |
Definition at line 51 of file shaper.hpp.
Referenced by set_depth_su().
|
staticconstexpr |
Definition at line 52 of file shaper.hpp.
Referenced by set_depth_su().
|
staticconstexpr |
Definition at line 53 of file shaper.hpp.
Referenced by set_bias_su().
|
staticconstexpr |
Definition at line 54 of file shaper.hpp.
Referenced by set_bias_su().
|
staticconstexpr |
Definition at line 55 of file shaper.hpp.
Referenced by set_drive_su().
|
staticconstexpr |
Definition at line 56 of file shaper.hpp.
Referenced by set_drive_su().