|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 72 of file tape_delay.hpp.
#include <tape_delay.hpp>
Public Member Functions | |
| TapeDelay ()=default | |
| void | init (float *buf_l, float *buf_r, uint32_t max_samples) |
| Initialize with pre-allocated stereo delay buffers. | |
| void | set_time_su (float su) |
| Set delay time from normalized [0,1] signal unit. | |
| void | set_time_bpm (float bpm, Subdivision div) |
| Tempo-synced delay time (internally slewed) | |
| void | set_feedback_su (float su) |
| Set feedback from normalized [0,1] signal unit. | |
| void | set_tone_su (float su) |
| Set tone (head gap loss LP) from normalized [0,1] signal unit. | |
| void | set_bass_loss_su (float su) |
| Set bass loss (feedback HP) from normalized [0,1] signal unit. | |
| void | set_drive_su (float su) |
| Set drive (magnetic saturation) from normalized [0,1] signal unit. | |
| void | set_wobble_su (float su) |
| Set wow+flutter from normalized [0,1] signal unit. | |
| void | set_hiss_su (float su) |
| Set tape hiss from normalized [0,1] signal unit. | |
| void | set_drift_su (float su) |
| Set speed drift from normalized [0,1] signal unit. | |
| void | set_transport_speed_su (float su) |
| Set transport speed (motor inertia) from normalized [0,1] signal unit. | |
| void | set_ping_pong (bool enable) |
| Enable stereo ping-pong (alternating L/R repeats). Default: false. | |
| uint32_t | time () const |
| float | feedback () const |
| bool | ping_pong () const |
| void | process (float *left, float *right, uint16_t frames) |
| Process a stereo block in-place (wet-only output) | |
| void | tick () |
| Tick control-rate modulation (~200 Hz) | |
| void | reset () |
| Clear delay buffers and reset all internal state. | |
Static Public Attributes | |
| static constexpr float | kMinFeedback = 0.0f |
| static constexpr float | kMaxFeedback = 1.15f |
| static constexpr uint32_t | kModHeadroom = 128 |
| static constexpr float | kMinToneHz = 200.0f |
| static constexpr float | kMaxToneHz = 20000.0f |
| static constexpr float | kMinBassLossHz = 0.0f |
| static constexpr float | kMaxBassLossHz = 500.0f |
| static constexpr float | kMinBassLossFilterHz = 1.0f |
| static constexpr float | kMinDrive = 1.0f |
| static constexpr float | kMaxDrive = 3.0f |
| static constexpr float | kMaxWobble = 2.0f |
| static constexpr float | kMaxHiss = 1.0f |
| static constexpr float | kMaxDrift = 3.0f |
| static constexpr float | kMinTransportSpeed = 1.0f |
| static constexpr float | kMaxTransportSpeed = 20.0f |
Friends | |
| struct | TapeDelayTestAccess |
|
default |
|
inline |
Initialize with pre-allocated stereo delay buffers.
| buf_l | Left delay buffer (must outlive the Delay) |
| buf_r | Right delay buffer (must outlive the Delay) |
| max_samples | Maximum delay in samples (buffer size) |
Definition at line 101 of file tape_delay.hpp.
References sbl::dsp::primitives::DelayLine::init().
|
inline |
Set delay time from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–max_samples |
Feeds into the existing motor slew model. No additional smoothing.
Definition at line 115 of file tape_delay.hpp.
References kModHeadroom, and sbl::dsp::primitives::DelayLine::max_delay().
|
inline |
Tempo-synced delay time (internally slewed)
| bpm | Tempo in beats per minute |
| div | Musical subdivision |
Public because tempo sync requires structured input (BPM + subdivision), not a normalized signal.
Definition at line 132 of file tape_delay.hpp.
References sbl::dsp::types::SAMPLE_RATE_F.
|
inline |
Set feedback from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–1.15 (FDP-060) |
Linear mapping. For musical response curves (more resolution at the top of the range), apply a cam profile in the control stack before this port. Smoothed via OnePole (50ms structural settling), then per-sample linear ramp across the block.
Definition at line 147 of file tape_delay.hpp.
References kMaxFeedback, and sbl::dsp::primitives::ParameterSmoother::reset().
|
inline |
Set tone (head gap loss LP) from normalized [0,1] signal unit.
| su | Unipolar [0,1] — exponentially mapped to 200–20000 Hz |
0 = dark (200 Hz LP), 1 = bright (20000 Hz, near-passthrough). Exponential mapping is handled by OnePole::set_cutoff_su() using the configured range.
Definition at line 169 of file tape_delay.hpp.
|
inline |
Set bass loss (feedback HP) from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–500 Hz |
0 = disabled (no HP), 1 = maximum bass removal (500 Hz). OnePoleHP maps [0,1] exponentially across its configured range.
Definition at line 182 of file tape_delay.hpp.
|
inline |
Set drive (magnetic saturation) from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 1.0–3.0 |
Definition at line 192 of file tape_delay.hpp.
|
inline |
Set wow+flutter from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–2.0 |
Definition at line 202 of file tape_delay.hpp.
References kMaxWobble.
|
inline |
Set tape hiss from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–1.0 |
Definition at line 212 of file tape_delay.hpp.
References kMaxHiss.
|
inline |
Set speed drift from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 0–3.0 |
Definition at line 222 of file tape_delay.hpp.
References kMaxDrift.
|
inline |
Set transport speed (motor inertia) from normalized [0,1] signal unit.
| su | Unipolar [0,1] — linearly mapped to 1.0–20.0 |
Definition at line 232 of file tape_delay.hpp.
References kMaxTransportSpeed, and kMinTransportSpeed.
|
inline |
Enable stereo ping-pong (alternating L/R repeats). Default: false.
Definition at line 239 of file tape_delay.hpp.
|
inline |
Definition at line 243 of file tape_delay.hpp.
|
inline |
Definition at line 244 of file tape_delay.hpp.
|
inline |
Definition at line 245 of file tape_delay.hpp.
|
inline |
Process a stereo block in-place (wet-only output)
Input: dry signal from send bus. Output: wet delay signal (replaces input in-place). Caller mixes into return bus.
Definition at line 256 of file tape_delay.hpp.
References sbl::dsp::primitives::PhaseAccumulator::advance(), sbl::dsp::primitives::Rng::bipolar(), sbl::dsp::primitives::SlewLimiter::delta(), sbl::dsp::primitives::PhaseAccumulator::phase(), sbl::dsp::primitives::ParameterSmoother::process(), sbl::dsp::primitives::SlewLimiter::process(), sbl::dsp::primitives::DcBlocker::process(), sbl::dsp::primitives::OnePole::process(), sbl::dsp::primitives::OnePoleHP::process(), sbl::dsp::primitives::SoftLimiter::process(), sbl::dsp::comp::WarmSaturator::process(), sbl::dsp::primitives::WavetableReader< Size >::read(), sbl::dsp::primitives::DelayLine::read_cubic(), sbl::dsp::primitives::ParameterSmoother::reset(), sbl::dsp::primitives::SlewLimiter::reset(), sbl::dsp::primitives::OnePole::set_cutoff_su(), sbl::dsp::primitives::OnePoleHP::set_cutoff_su(), sbl::dsp::primitives::SlewLimiter::set_rate(), sbl::dsp::comp::AnalogDrift::value(), sbl::dsp::primitives::SlewLimiter::value(), and sbl::dsp::primitives::DelayLine::write().
|
inline |
Tick control-rate modulation (~200 Hz)
Advances AnalogDrift. Call from control loop, not audio callback.
Definition at line 423 of file tape_delay.hpp.
References sbl::dsp::comp::AnalogDrift::process().
|
inline |
Clear delay buffers and reset all internal state.
Definition at line 428 of file tape_delay.hpp.
References sbl::dsp::comp::AnalogDrift::reset(), sbl::dsp::primitives::DcBlocker::reset(), sbl::dsp::primitives::DelayLine::reset(), sbl::dsp::primitives::OnePole::reset(), sbl::dsp::primitives::OnePoleHP::reset(), and sbl::dsp::primitives::PhaseAccumulator::reset().
|
friend |
Definition at line 453 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 77 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 78 of file tape_delay.hpp.
Referenced by set_feedback_su().
|
staticconstexpr |
Definition at line 79 of file tape_delay.hpp.
Referenced by set_time_su().
|
staticconstexpr |
Definition at line 80 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 81 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 82 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 83 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 84 of file tape_delay.hpp.
|
staticconstexpr |
Definition at line 85 of file tape_delay.hpp.
Referenced by set_drive_su().
|
staticconstexpr |
Definition at line 86 of file tape_delay.hpp.
Referenced by set_drive_su().
|
staticconstexpr |
Definition at line 87 of file tape_delay.hpp.
Referenced by set_wobble_su().
|
staticconstexpr |
Definition at line 88 of file tape_delay.hpp.
Referenced by set_hiss_su().
|
staticconstexpr |
Definition at line 89 of file tape_delay.hpp.
Referenced by set_drift_su().
|
staticconstexpr |
Definition at line 90 of file tape_delay.hpp.
Referenced by set_transport_speed_su().
|
staticconstexpr |
Definition at line 91 of file tape_delay.hpp.
Referenced by set_transport_speed_su().