|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 30 of file phase_accumulator.hpp.
#include <phase_accumulator.hpp>
Public Member Functions | |
| void | set_increment (uint32_t inc) |
| Set the phase increment per sample. | |
| void | advance () |
| Advance phase by one sample. | |
| void | advance (uint16_t frames, uint32_t *out) |
| Advance and fill a buffer with per-sample phases. | |
| uint32_t | phase () const |
| Current phase value. | |
| uint32_t | increment () const |
| Current phase increment. | |
| void | reset () |
| Reset phase to zero. | |
| void | reset (uint32_t phase) |
| Reset phase to a specific value (for sync) | |
Static Public Member Functions | |
| static uint32_t | freq_to_inc (float freq_hz, float sr=types::SAMPLE_RATE_F) |
| Convert frequency in Hz to phase increment. | |
|
inline |
Set the phase increment per sample.
inc = frequency_hz * 2^32 / sample_rate Use freq_to_inc() for Hz input.
Definition at line 40 of file phase_accumulator.hpp.
Referenced by sbl::dsp::comp::Lfo< TableSize >::set_increment().
|
inline |
Advance phase by one sample.
Definition at line 43 of file phase_accumulator.hpp.
Referenced by sbl::dsp::modules::TapeDelay::process(), and sbl::dsp::comp::Lfo< TableSize >::process().
|
inline |
Advance and fill a buffer with per-sample phases.
Each output element is the phase AFTER advancing. Useful for batch wavetable reads.
Definition at line 51 of file phase_accumulator.hpp.
|
inline |
Current phase value.
Definition at line 59 of file phase_accumulator.hpp.
Referenced by sbl::dsp::comp::Lfo< TableSize >::phase(), sbl::dsp::modules::TapeDelay::process(), sbl::dsp::comp::Lfo< TableSize >::process(), reset(), and sbl::dsp::comp::Lfo< TableSize >::value().
|
inline |
Current phase increment.
Definition at line 62 of file phase_accumulator.hpp.
Referenced by sbl::dsp::comp::Lfo< TableSize >::increment().
|
inline |
Reset phase to zero.
Definition at line 65 of file phase_accumulator.hpp.
Referenced by sbl::dsp::modules::TapeDelay::reset(), and sbl::dsp::comp::Lfo< TableSize >::sync().
|
inline |
Reset phase to a specific value (for sync)
Definition at line 68 of file phase_accumulator.hpp.
References phase().
|
inlinestatic |
Convert frequency in Hz to phase increment.
| freq_hz | Frequency in Hz (e.g., 440.0f) |
| sr | Sample rate (default: SAMPLE_RATE_F global) |
Definition at line 77 of file phase_accumulator.hpp.