|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <wavetable_osc.hpp>
Public Member Functions | |
| void | set_wavetable (const float *table) |
| Set wavetable (must have guard points for interpolation) | |
| void | set_frequency (float freq_hz, float sr=48000.0f) |
| Set frequency in Hz. | |
| void | set_note (float midi_note, float sample_rate=48000.0f) |
| Set frequency from MIDI note number (requires FPU) | |
| void | set_increment (uint32_t inc) |
| Set phase increment directly. | |
| void | set_amplitude (float amp) |
| Set output amplitude (0.0 = silence, 1.0 = full scale) | |
| void | process (float *out, uint16_t frames) |
| Generate audio samples. | |
| void | sync () |
| Hard sync — reset phase to zero. | |
| void | sync (uint32_t phase) |
| Reset phase to a specific value. | |
| uint32_t | phase () const |
| Current phase. | |
| uint32_t | increment () const |
| Current phase increment. | |
Definition at line 23 of file wavetable_osc.hpp.
|
inline |
Current phase increment.
Definition at line 76 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::increment().
|
inline |
Current phase.
Definition at line 73 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::phase().
Referenced by sbl::widgets::source::WavetableOsc< TableSize >::sync().
|
inline |
Generate audio samples.
| out | Output buffer (float, [-1.0, 1.0]) |
| frames | Number of samples |
Definition at line 59 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::advance(), sbl::dsp::PhaseAccumulator::phase(), and sbl::dsp::WavetableReader< Size >::read().
|
inline |
Set output amplitude (0.0 = silence, 1.0 = full scale)
Definition at line 52 of file wavetable_osc.hpp.
|
inline |
Set frequency in Hz.
| freq_hz | Frequency in Hz (e.g., 440.0f) |
| sr | Sample rate (default 48000) |
Definition at line 35 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::freq_to_inc(), and sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set phase increment directly.
Definition at line 49 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set frequency from MIDI note number (requires FPU)
| midi_note | MIDI note (69 = A4 = 440 Hz) |
| sample_rate | Sample rate |
Definition at line 44 of file wavetable_osc.hpp.
References sbl::dsp::note_to_phase_increment(), and sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set wavetable (must have guard points for interpolation)
Definition at line 28 of file wavetable_osc.hpp.
References sbl::dsp::WavetableReader< Size >::set_table().
|
inline |
Hard sync — reset phase to zero.
Definition at line 67 of file wavetable_osc.hpp.
References sbl::dsp::PhaseAccumulator::reset().
|
inline |
Reset phase to a specific value.
Definition at line 70 of file wavetable_osc.hpp.
References sbl::widgets::source::WavetableOsc< TableSize >::phase(), and sbl::dsp::PhaseAccumulator::reset().