Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::widgets::source::ScanningOsc< TableSize, MaxTables > Class Template Reference

#include <scanning_osc.hpp>

Collaboration diagram for sbl::widgets::source::ScanningOsc< TableSize, MaxTables >:

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.
 

Detailed Description

template<uint16_t TableSize, uint8_t MaxTables = 8>
class sbl::widgets::source::ScanningOsc< TableSize, MaxTables >

Definition at line 29 of file scanning_osc.hpp.

Member Function Documentation

◆ add_table()

template<uint16_t TableSize, uint8_t MaxTables = 8>
bool sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::add_table ( const float *  table)
inline

Register a wavetable in scan order.

Note
All public methods are ISR-safe — bounded computation, no I/O.
Parameters
tablePointer to float table data (must have guard points)
Returns
true if added, false if at capacity

Definition at line 38 of file scanning_osc.hpp.

◆ increment()

template<uint16_t TableSize, uint8_t MaxTables = 8>
uint32_t sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::increment ( ) const
inline

Current phase increment.

Definition at line 113 of file scanning_osc.hpp.

References sbl::dsp::PhaseAccumulator::increment().

Here is the call graph for this function:

◆ phase()

template<uint16_t TableSize, uint8_t MaxTables = 8>
uint32_t sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::phase ( ) const
inline

Current phase.

Definition at line 110 of file scanning_osc.hpp.

References sbl::dsp::PhaseAccumulator::phase().

Here is the call graph for this function:

◆ process()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::process ( float *  out,
uint16_t  frames 
)
inline

Generate audio samples.

Parameters
outOutput buffer (float, [-1.0, 1.0])
framesNumber 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().

Here is the call graph for this function:

◆ set_amplitude()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_amplitude ( float  amp)
inline

Set output amplitude (0.0 = silence, 1.0 = full scale)

Definition at line 72 of file scanning_osc.hpp.

◆ set_frequency()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_frequency ( float  freq_hz,
float  sr = 48000.0f 
)
inline

Set frequency in Hz.

Parameters
freq_hzFrequency in Hz (e.g., 440.0f)
srSample 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().

Here is the call graph for this function:

◆ set_increment()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_increment ( uint32_t  inc)
inline

Set phase increment directly.

Definition at line 69 of file scanning_osc.hpp.

References sbl::dsp::PhaseAccumulator::set_increment().

Here is the call graph for this function:

◆ set_note()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_note ( float  midi_note,
float  sample_rate = 48000.0f 
)
inline

Set frequency from MIDI note number (requires FPU)

Parameters
midi_noteMIDI note (69 = A4 = 440 Hz)
sample_rateSample rate

Definition at line 64 of file scanning_osc.hpp.

References sbl::dsp::note_to_phase_increment(), and sbl::dsp::PhaseAccumulator::set_increment().

Here is the call graph for this function:

◆ set_scan()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::set_scan ( float  position)
inline

Set scan position.

Parameters
position0.0 = first table, 1.0 = last table

Definition at line 48 of file scanning_osc.hpp.

◆ sync()

template<uint16_t TableSize, uint8_t MaxTables = 8>
void sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::sync ( )
inline

Hard sync — reset phase to zero.

Definition at line 107 of file scanning_osc.hpp.

References sbl::dsp::PhaseAccumulator::reset().

Here is the call graph for this function:

◆ table_count()

template<uint16_t TableSize, uint8_t MaxTables = 8>
uint8_t sbl::widgets::source::ScanningOsc< TableSize, MaxTables >::table_count ( ) const
inline

Number of registered tables.

Definition at line 116 of file scanning_osc.hpp.


The documentation for this class was generated from the following file: