Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::comp::AnalogDrift Class Reference

Detailed Description

Definition at line 26 of file analog_drift.hpp.

#include <analog_drift.hpp>

Public Member Functions

 AnalogDrift (uint32_t seed=1)
 Construct with PRNG seed. Use a different seed for each instance.
 
void set_rate (float control_rate_hz)
 
float process (float amount)
 
float value () const
 Current drift value (before amount scaling), for diagnostics.
 
void reset ()
 Reset drift state to zero.
 
void seed (uint32_t s)
 Re-seed the PRNG (for test reproducibility).
 

Constructor & Destructor Documentation

◆ AnalogDrift()

sbl::dsp::comp::AnalogDrift::AnalogDrift ( uint32_t  seed = 1)
inlineexplicit

Construct with PRNG seed. Use a different seed for each instance.

Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 31 of file analog_drift.hpp.

Member Function Documentation

◆ set_rate()

void sbl::dsp::comp::AnalogDrift::set_rate ( float  control_rate_hz)
inline

Set the control rate in Hz. Adjusts walk step and smoothing to maintain consistent drift character regardless of call rate. Call once at init, not per-sample.

Definition at line 36 of file analog_drift.hpp.

Referenced by sbl::dsp::modules::MorphOsc< MaxFrames >::set_drift_rate().

◆ process()

float sbl::dsp::comp::AnalogDrift::process ( float  amount)
inline

Process one control tick.

Parameters
amountPeak deviation in semitones (0.05 = ±5 cents)
Returns
Pitch offset in semitones

Definition at line 53 of file analog_drift.hpp.

References sbl::dsp::primitives::Rng::bipolar().

Referenced by sbl::dsp::modules::TapeDelay::tick(), and sbl::dsp::modules::MorphOsc< MaxFrames >::tick_drift().

◆ value()

float sbl::dsp::comp::AnalogDrift::value ( ) const
inline

Current drift value (before amount scaling), for diagnostics.

Definition at line 67 of file analog_drift.hpp.

Referenced by sbl::dsp::modules::TapeDelay::process().

◆ reset()

void sbl::dsp::comp::AnalogDrift::reset ( )
inline

Reset drift state to zero.

Definition at line 70 of file analog_drift.hpp.

Referenced by sbl::dsp::modules::MorphOsc< MaxFrames >::reset(), and sbl::dsp::modules::TapeDelay::reset().

◆ seed()

void sbl::dsp::comp::AnalogDrift::seed ( uint32_t  s)
inline

Re-seed the PRNG (for test reproducibility).

Definition at line 76 of file analog_drift.hpp.

References sbl::dsp::primitives::Rng::seed().


The documentation for this class was generated from the following file: