|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <scanning_osc.hpp>
Public Member Functions | |
| bool | add_table (const float *table) |
| Register a wavetable in scan order. | |
| void | set_scan (float position) |
| Set scan position. | |
| 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. | |
| uint32_t | phase () const |
| Current phase. | |
| uint32_t | increment () const |
| Current phase increment. | |
| uint8_t | table_count () const |
| Number of registered tables. | |
Definition at line 29 of file scanning_osc.hpp.
|
inline |
Register a wavetable in scan order.
| table | Pointer to float table data (must have guard points) |
Definition at line 38 of file scanning_osc.hpp.
|
inline |
Current phase increment.
Definition at line 113 of file scanning_osc.hpp.
References sbl::dsp::PhaseAccumulator::increment().
|
inline |
Current phase.
Definition at line 110 of file scanning_osc.hpp.
References sbl::dsp::PhaseAccumulator::phase().
|
inline |
Generate audio samples.
| out | Output buffer (float, [-1.0, 1.0]) |
| frames | Number of samples |
Definition at line 79 of file scanning_osc.hpp.
References sbl::dsp::PhaseAccumulator::advance(), sbl::dsp::lut::lookup_linear(), and sbl::dsp::PhaseAccumulator::phase().
|
inline |
Set output amplitude (0.0 = silence, 1.0 = full scale)
Definition at line 72 of file scanning_osc.hpp.
|
inline |
Set frequency in Hz.
| freq_hz | Frequency in Hz (e.g., 440.0f) |
| sr | Sample rate (default 48000) |
Definition at line 55 of file scanning_osc.hpp.
References sbl::dsp::PhaseAccumulator::freq_to_inc(), and sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set phase increment directly.
Definition at line 69 of file scanning_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 64 of file scanning_osc.hpp.
References sbl::dsp::note_to_phase_increment(), and sbl::dsp::PhaseAccumulator::set_increment().
|
inline |
Set scan position.
| position | 0.0 = first table, 1.0 = last table |
Definition at line 48 of file scanning_osc.hpp.
|
inline |
Hard sync — reset phase to zero.
Definition at line 107 of file scanning_osc.hpp.
References sbl::dsp::PhaseAccumulator::reset().
|
inline |
Number of registered tables.
Definition at line 116 of file scanning_osc.hpp.