|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <phase.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=48000.0f) |
| Convert frequency in Hz to phase increment. | |
|
inline |
Advance phase by one sample.
Definition at line 36 of file phase.hpp.
Referenced by sbl::widgets::mod::Lfo< TableSize >::process(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::process(), and sbl::widgets::source::WavetableOsc< TableSize >::process().
|
inline |
|
inlinestatic |
Convert frequency in Hz to phase increment.
| freq_hz | Frequency in Hz (e.g., 440.0f) |
| sr | Sample rate (default 48000) |
Definition at line 70 of file phase.hpp.
Referenced by sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_frequency(), sbl::widgets::source::WavetableOsc< TableSize >::set_frequency(), and sbl::widgets::mod::Lfo< TableSize >::set_rate().
|
inline |
Current phase increment.
Definition at line 55 of file phase.hpp.
Referenced by sbl::widgets::mod::Lfo< TableSize >::increment(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::increment(), and sbl::widgets::source::WavetableOsc< TableSize >::increment().
|
inline |
Current phase value.
Definition at line 52 of file phase.hpp.
Referenced by sbl::widgets::mod::Lfo< TableSize >::phase(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::phase(), sbl::widgets::source::WavetableOsc< TableSize >::phase(), sbl::widgets::mod::Lfo< TableSize >::process(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::process(), sbl::widgets::source::WavetableOsc< TableSize >::process(), reset(), and sbl::widgets::mod::Lfo< TableSize >::value().
|
inline |
Reset phase to zero.
Definition at line 58 of file phase.hpp.
Referenced by sbl::widgets::mod::Lfo< TableSize >::sync(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::sync(), sbl::widgets::source::WavetableOsc< TableSize >::sync(), and sbl::widgets::source::WavetableOsc< TableSize >::sync().
|
inline |
|
inline |
Set the phase increment per sample.
inc = frequency_hz * 2^32 / sample_rate Use freq_to_inc() for Hz input.
Definition at line 33 of file phase.hpp.
Referenced by sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_frequency(), sbl::widgets::source::WavetableOsc< TableSize >::set_frequency(), sbl::widgets::mod::Lfo< TableSize >::set_increment(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_increment(), sbl::widgets::source::WavetableOsc< TableSize >::set_increment(), sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_note(), sbl::widgets::source::WavetableOsc< TableSize >::set_note(), and sbl::widgets::mod::Lfo< TableSize >::set_rate().