Skip to content

Class daisy::WaveTableLoader

ClassList > daisy > WaveTableLoader

More...

  • #include <WaveTableLoader.h>

Public Types

Type Name
enum Result

Public Functions

Type Name
float * GetTable (size_t idx)
Result Import (const char * filename)
void Init (float * mem, size_t mem_size)
Result SetWaveTableInfo (size_t samps, size_t count)
WaveTableLoader ()
~WaveTableLoader ()

Detailed Description

Loads a bank of wavetables into memory. Pointers to the start of each waveform will be provided, but the user can do whatever they want with the data once it's imported.

A internal 4kB workspace is used for reading from the file, and conveting to the correct memory location.

Public Types Documentation

enum Result

enum daisy::WaveTableLoader::Result {
    OK,
    ERR_TABLE_INFO_OVERFLOW,
    ERR_FILE_READ,
    ERR_GENERIC
};

Public Functions Documentation

function GetTable

float * daisy::WaveTableLoader::GetTable (
    size_t idx
) 

Returns pointer to specific table start or nullptr if invalid idx


function Import

Result daisy::WaveTableLoader::Import (
    const  char * filename
) 

Opens and loads the file The data will be converted from its original type to float And the wavheader data will be stored internally to the class, but will not be stored in the user-provided buffer.

Currently only 16-bit and 32-bit data is supported. The importer also assumes data is mono so stereo data will be loaded as-is (i.e. interleaved)


function Init

void daisy::WaveTableLoader::Init (
    float * mem,
    size_t mem_size
) 

Initializes the Loader


function SetWaveTableInfo

Result daisy::WaveTableLoader::SetWaveTableInfo (
    size_t samps,
    size_t count
) 

Sets the size of the tables to allow access to the specific waveforms


function WaveTableLoader

inline daisy::WaveTableLoader::WaveTableLoader () 

function ~WaveTableLoader

inline daisy::WaveTableLoader::~WaveTableLoader () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/util/WaveTableLoader.h