Storage for one dynamic table source; a wavetable that is created dynamically at load time, rather than being loaded from a static resource or table array.
More...
#include <dynamictablesource.h>
|
| DynamicTableSource () |
| empty constructor
|
|
| ~DynamicTableSource () |
| empty destructor
|
|
virtual const char * | getWaveformName () override |
|
virtual void | selectTable (uint32_t midiNoteNumber) override |
| Select a table based on MIDI note number.
|
|
virtual double | readWaveTable (double normalizedPhaseInc) override |
| Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead. More...
|
|
virtual uint32_t | getWaveTableLength () override |
|
void | addWavetable (uint32_t startNoteNumber, uint32_t endNoteNumber, std::shared_ptr< double > _table, uint32_t length, const char *name) |
| Adds a new wavetable or tables to the array of 128 tables, one for each MIDI note. More...
|
|
void | clearAllWavetables () |
| Clear out the wavetables to initialize or re-initialize.
|
|
Storage for one dynamic table source; a wavetable that is created dynamically at load time, rather than being loaded from a static resource or table array.
- exposes the IWavetableSource interface
- stores 128 DynamicWavetable objects, one for each MIDI note
- stores a selected table
- the owning object (a wavetable core) selects the table based on pitch during the update() phase, then makes calls to read the table during the render() phase
- see also DynamicWavetable
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2021 / 04 / 26
◆ addWavetable()
void SynthLab::DynamicTableSource::addWavetable |
( |
uint32_t |
startNoteNumber, |
|
|
uint32_t |
endNoteNumber, |
|
|
std::shared_ptr< double > |
_table, |
|
|
uint32_t |
length, |
|
|
const char * |
name |
|
) |
| |
|
inline |
Adds a new wavetable or tables to the array of 128 tables, one for each MIDI note.
- one table may be used to cover multiple MIDI notes
- if a single table is used for a single MIDI note, set the start and end numbers identically
- Parameters
-
startNoteNumber | the MIDI note number of the first note to add the table |
endNoteNumber | the MIDI note number of the last note to add the table |
_table | the shared pointer to the table (array) |
length | the size of the table (array) |
name | the unique name of this table |
◆ getWaveformName()
virtual const char* SynthLab::DynamicTableSource::getWaveformName |
( |
| ) |
|
|
inlineoverridevirtual |
◆ getWaveTableLength()
virtual uint32_t SynthLab::DynamicTableSource::getWaveTableLength |
( |
| ) |
|
|
inlineoverridevirtual |
◆ readWaveTable()
virtual double SynthLab::DynamicTableSource::readWaveTable |
( |
double |
normalizedPhaseInc | ) |
|
|
inlineoverridevirtual |
Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead.
- Parameters
-
normalizedPhaseInc | the phase increment value; usually this is the mcounter member of a SynthClock object and is fo/fs where fo is the desired oscillator frequency |
Implements SynthLab::IWavetableSource.
The documentation for this class was generated from the following file: