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::Lfo< TableSize > Class Template Reference

Detailed Description

template<uint16_t TableSize>
class sbl::dsp::comp::Lfo< TableSize >

Definition at line 39 of file lfo.hpp.

#include <lfo.hpp>

Public Member Functions

void set_wavetable (const float *table)
 Set wavetable (must have guard points for interpolation)
 
void set_increment (uint32_t inc)
 Set phase increment directly.
 
void set_rate_su (float su)
 Set LFO rate from normalized [0,1] signal unit.
 
void set_depth_su (float su)
 Set output amplitude from normalized [0,1] signal unit.
 
void process (float *out, uint16_t frames)
 Generate modulation signal (bipolar: -depth to +depth)
 
void sync ()
 Hard sync — reset phase to zero.
 
float value () const
 Current LFO value (bipolar, float)
 
uint32_t phase () const
 Current phase.
 
uint32_t increment () const
 Current phase increment.
 

Friends

struct LfoTestAccess
 

Member Function Documentation

◆ set_wavetable()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::set_wavetable ( const float *  table)
inline

Set wavetable (must have guard points for interpolation)

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

Definition at line 46 of file lfo.hpp.

References sbl::dsp::primitives::WavetableReader< Size >::set_table().

◆ set_increment()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::set_increment ( uint32_t  inc)
inline

Set phase increment directly.

Definition at line 49 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::set_increment().

◆ set_rate_su()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::set_rate_su ( float  su)
inline

Set LFO rate from normalized [0,1] signal unit.

Parameters
suUnipolar [0,1] — exponential map to 0.05–30 Hz

Exponential mapping gives fine resolution at low rates (slow sweeps) and coarser control at high rates (fast vibrato/tremolo).

Definition at line 60 of file lfo.hpp.

References sbl::dsp::math::fast_exp2f().

◆ set_depth_su()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::set_depth_su ( float  su)
inline

Set output amplitude from normalized [0,1] signal unit.

Parameters
suUnipolar [0,1] — linear map to depth 0–1

Definition at line 71 of file lfo.hpp.

◆ process()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::process ( float *  out,
uint16_t  frames 
)
inline

Generate modulation signal (bipolar: -depth to +depth)

Parameters
outOutput buffer (float)
framesNumber of samples

Definition at line 84 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::advance(), sbl::dsp::primitives::PhaseAccumulator::phase(), and sbl::dsp::primitives::WavetableReader< Size >::read().

◆ sync()

template<uint16_t TableSize>
void sbl::dsp::comp::Lfo< TableSize >::sync ( )
inline

Hard sync — reset phase to zero.

Definition at line 92 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::reset().

◆ value()

template<uint16_t TableSize>
float sbl::dsp::comp::Lfo< TableSize >::value ( ) const
inline

Current LFO value (bipolar, float)

Definition at line 97 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::phase(), and sbl::dsp::primitives::WavetableReader< Size >::read().

◆ phase()

template<uint16_t TableSize>
uint32_t sbl::dsp::comp::Lfo< TableSize >::phase ( ) const
inline

Current phase.

Definition at line 102 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::phase().

◆ increment()

template<uint16_t TableSize>
uint32_t sbl::dsp::comp::Lfo< TableSize >::increment ( ) const
inline

Current phase increment.

Definition at line 105 of file lfo.hpp.

References sbl::dsp::primitives::PhaseAccumulator::increment().

Friends And Related Symbol Documentation

◆ LfoTestAccess

template<uint16_t TableSize>
friend struct LfoTestAccess
friend

Definition at line 108 of file lfo.hpp.


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