Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::widgets::mod::Lfo< TableSize > Class Template Reference

#include <lfo.hpp>

Collaboration diagram for sbl::widgets::mod::Lfo< TableSize >:

Public Member Functions

void set_wavetable (const float *table)
 Set wavetable (must have guard points for interpolation)
 
void set_rate (float freq_hz, float sr=48000.0f)
 Set LFO rate in Hz.
 
void set_increment (uint32_t inc)
 Set phase increment directly.
 
void set_depth (float depth)
 Set output amplitude (depth)
 
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.
 

Detailed Description

template<uint16_t TableSize>
class sbl::widgets::mod::Lfo< TableSize >

Definition at line 44 of file lfo.hpp.

Member Function Documentation

◆ increment()

template<uint16_t TableSize>
uint32_t sbl::widgets::mod::Lfo< TableSize >::increment ( ) const
inline

Current phase increment.

Definition at line 100 of file lfo.hpp.

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

Here is the call graph for this function:

◆ phase()

template<uint16_t TableSize>
uint32_t sbl::widgets::mod::Lfo< TableSize >::phase ( ) const
inline

Current phase.

Definition at line 97 of file lfo.hpp.

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

Here is the call graph for this function:

◆ process()

template<uint16_t TableSize>
void sbl::widgets::mod::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 81 of file lfo.hpp.

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

Here is the call graph for this function:

◆ set_depth()

template<uint16_t TableSize>
void sbl::widgets::mod::Lfo< TableSize >::set_depth ( float  depth)
inline

Set output amplitude (depth)

Controls the bipolar output range: output = wavetable * depth. Default is 1.0 — full ±1.0 normalized swing. Use values in [0, 1] for amplitude scaling. The caller applies domain conversion (exponential for frequency, linear for amplitude) at the modulation destination.

Parameters
depthOutput amplitude (1.0 = full ±1.0 swing)

Definition at line 74 of file lfo.hpp.

◆ set_increment()

template<uint16_t TableSize>
void sbl::widgets::mod::Lfo< TableSize >::set_increment ( uint32_t  inc)
inline

Set phase increment directly.

Definition at line 61 of file lfo.hpp.

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

Here is the call graph for this function:

◆ set_rate()

template<uint16_t TableSize>
void sbl::widgets::mod::Lfo< TableSize >::set_rate ( float  freq_hz,
float  sr = 48000.0f 
)
inline

Set LFO rate in Hz.

Parameters
freq_hzRate in Hz (e.g., 2.0f)
srSample rate (default 48000)

Definition at line 56 of file lfo.hpp.

References sbl::dsp::PhaseAccumulator::freq_to_inc(), and sbl::dsp::PhaseAccumulator::set_increment().

Here is the call graph for this function:

◆ set_wavetable()

template<uint16_t TableSize>
void sbl::widgets::mod::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 49 of file lfo.hpp.

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

Here is the call graph for this function:

◆ sync()

template<uint16_t TableSize>
void sbl::widgets::mod::Lfo< TableSize >::sync ( )
inline

Hard sync — reset phase to zero.

Definition at line 89 of file lfo.hpp.

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

Here is the call graph for this function:

◆ value()

template<uint16_t TableSize>
float sbl::widgets::mod::Lfo< TableSize >::value ( ) const
inline

Current LFO value (bipolar, float)

Definition at line 92 of file lfo.hpp.

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

Here is the call graph for this function:

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