libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::WaveTableLoader Class Reference

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.

#include <WaveTableLoader.h>

Public Types

enum class  Result { OK , ERR_TABLE_INFO_OVERFLOW , ERR_FILE_READ , ERR_GENERIC }
 

Public Member Functions

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

Member Enumeration Documentation

◆ Result

Enumerator
OK 
ERR_TABLE_INFO_OVERFLOW 
ERR_FILE_READ 
ERR_GENERIC 

Constructor & Destructor Documentation

◆ WaveTableLoader()

daisy::WaveTableLoader::WaveTableLoader ( )
inline

◆ ~WaveTableLoader()

daisy::WaveTableLoader::~WaveTableLoader ( )
inline

Member Function Documentation

◆ GetTable()

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

Returns pointer to specific table start or nullptr if invalid idx

◆ 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)

◆ Init()

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

Initializes the Loader

◆ SetWaveTableInfo()

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

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


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