Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::primitives::WavetableReader< Size > Class Template Reference

Detailed Description

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

Definition at line 25 of file wavetable_reader.hpp.

#include <wavetable_reader.hpp>

Inheritance diagram for sbl::dsp::primitives::WavetableReader< Size >:
[legend]

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.
 

Member Function Documentation

◆ set_table()

template<uint16_t Size>
void sbl::dsp::primitives::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 30 of file wavetable_reader.hpp.

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

Referenced by sbl::dsp::comp::Lfo< TableSize >::set_wavetable().

◆ table()

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

Current table pointer.

Definition at line 33 of file wavetable_reader.hpp.

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

◆ read()

template<uint16_t Size>
float sbl::dsp::primitives::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 40 of file wavetable_reader.hpp.

Referenced by sbl::dsp::modules::TapeDelay::process(), sbl::dsp::comp::Lfo< TableSize >::process(), and sbl::dsp::comp::Lfo< TableSize >::value().

◆ read_cubic()

template<uint16_t Size>
float sbl::dsp::primitives::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 49 of file wavetable_reader.hpp.

◆ read_block()

template<uint16_t Size>
void sbl::dsp::primitives::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 59 of file wavetable_reader.hpp.


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