|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <lfo.hpp>
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. | |
|
inline |
Current phase increment.
Definition at line 100 of file lfo.hpp.
References sbl::dsp::PhaseAccumulator::increment().
|
inline |
Current phase.
Definition at line 97 of file lfo.hpp.
References sbl::dsp::PhaseAccumulator::phase().
|
inline |
Generate modulation signal (bipolar: -depth to +depth)
| out | Output buffer (float) |
| frames | Number 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().
|
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.
| depth | Output amplitude (1.0 = full ±1.0 swing) |
|
inline |
Set phase increment directly.
Definition at line 61 of file lfo.hpp.
References sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set LFO rate in Hz.
| freq_hz | Rate in Hz (e.g., 2.0f) |
| sr | Sample rate (default 48000) |
Definition at line 56 of file lfo.hpp.
References sbl::dsp::PhaseAccumulator::freq_to_inc(), and sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set wavetable (must have guard points for interpolation)
Definition at line 49 of file lfo.hpp.
References sbl::dsp::WavetableReader< Size >::set_table().
|
inline |
Hard sync — reset phase to zero.
Definition at line 89 of file lfo.hpp.
References sbl::dsp::PhaseAccumulator::reset().
|
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().