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::dsp::WavetableReader< Size > Class Template Reference

#include <wavetable.hpp>

Inheritance diagram for sbl::dsp::WavetableReader< Size >:
Collaboration diagram for sbl::dsp::WavetableReader< Size >:

Public Member Functions

void set_table (const float *table)
 Set the wavetable to read from (must have Size+1 guard points for linear)
 
const float * table () const
 Current table pointer.
 
float read (uint32_t phase) const
 Read a single sample with linear interpolation.
 
float read_cubic (uint32_t phase) const
 Read a single sample with cubic Hermite interpolation.
 
void read_block (const uint32_t *phases, float *out, uint16_t frames) const
 Read a block of samples using linear interpolation.
 

Detailed Description

template<uint16_t Size>
class sbl::dsp::WavetableReader< Size >

Definition at line 24 of file wavetable.hpp.

Member Function Documentation

◆ read()

template<uint16_t Size>
float sbl::dsp::WavetableReader< Size >::read ( uint32_t  phase) const
inline

Read a single sample with linear interpolation.

Parameters
phase32-bit phase (full range = one table cycle)
Returns
Interpolated sample value in [-1.0, 1.0]

Definition at line 39 of file wavetable.hpp.

References sbl::dsp::lut::lookup_linear().

Referenced by sbl::widgets::mod::Lfo< TableSize >::process(), sbl::widgets::source::WavetableOsc< TableSize >::process(), and sbl::widgets::mod::Lfo< TableSize >::value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_block()

template<uint16_t Size>
void sbl::dsp::WavetableReader< Size >::read_block ( const uint32_t *  phases,
float *  out,
uint16_t  frames 
) const
inline

Read a block of samples using linear interpolation.

Parameters
phasesArray of per-sample phase values
outOutput sample buffer
framesNumber of frames to process

Definition at line 58 of file wavetable.hpp.

References sbl::dsp::lut::lookup_linear().

Here is the call graph for this function:

◆ read_cubic()

template<uint16_t Size>
float sbl::dsp::WavetableReader< Size >::read_cubic ( uint32_t  phase) const
inline

Read a single sample with cubic Hermite interpolation.

Parameters
phase32-bit phase
Returns
Interpolated sample value (smoother, higher cost)

Definition at line 48 of file wavetable.hpp.

References sbl::dsp::lut::lookup_linear().

Here is the call graph for this function:

◆ set_table()

template<uint16_t Size>
void sbl::dsp::WavetableReader< Size >::set_table ( const float *  table)
inline

Set the wavetable to read from (must have Size+1 guard points for linear)

Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 29 of file wavetable.hpp.

References sbl::dsp::WavetableReader< Size >::table().

Referenced by sbl::widgets::mod::Lfo< TableSize >::set_wavetable(), and sbl::widgets::source::WavetableOsc< TableSize >::set_wavetable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ table()

template<uint16_t Size>
const float * sbl::dsp::WavetableReader< Size >::table ( ) const
inline

Current table pointer.

Definition at line 32 of file wavetable.hpp.

Referenced by sbl::dsp::WavetableReader< Size >::set_table().

Here is the caller graph for this function:

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