4 #include "synthfunctions.h" 9 class DynamicTableSource :
public IWavetableSource
28 if (midiNoteNumber >= NUM_MIDI_NOTES)
return;
36 double wtData[2] = { 0.0, 0.0 };
42 double dIntPart = 0.0;
43 double fracPart = modf(wtReadLocation, &dIntPart);
44 uint32_t readIndex = (uint32_t)dIntPart;
62 inline void addWavetable(uint32_t startNoteNumber, uint32_t endNoteNumber, std::shared_ptr<double> _table, uint32_t length,
const char* name)
64 if (endNoteNumber >= NUM_MIDI_NOTES)
return;
68 for (uint32_t i = startNoteNumber; i <= endNoteNumber; i++)
78 for (uint32_t i = 0; i < NUM_MIDI_NOTES; i++)
virtual void selectTable(uint32_t midiNoteNumber)
Objects that access the database will select a table based on the user's waveform selection...
Definition: dynamictablesource.h:26
double outputComp
output scaling factor (NOT volume or attenuation, waveform specific)
Definition: synthbase.h:1227
virtual const char * getWaveformName()
Definition: dynamictablesource.h:20
double doLinearInterpolation(double x1, double x2, double y1, double y2, double x)
performs linear interpolation of x distance between two (x,y) points; returns interpolated value ...
Definition: synthfunctions.h:1350
DynamicTableSource()
empty constructor
Definition: dynamictablesource.h:41
Definition: synthengine.cpp:16
~DynamicTableSource()
empty destructor
Definition: dynamictablesource.h:42
uint32_t tableLength
length
Definition: synthbase.h:1225
Structure for holding information about a static wavetable, that is read from a static location...
Definition: synthbase.h:1209
uint32_t wrapMask
mask = length - 1
Definition: synthbase.h:1226
DynamicWavetable selectedTable
— selected table, stored here
Definition: dynamictablesource.h:144
const char * waveformName
waveform name
Definition: synthbase.h:1229
virtual uint32_t getWaveTableLength()
Definition: dynamictablesource.h:59
DynamicWavetable wavetableSet[NUM_MIDI_NOTES]
— prefab table valid for all MIDI notes
Definition: dynamictablesource.h:143
std::shared_ptr< double > table
the table (shared)
Definition: synthbase.h:1224
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.
Definition: dynamictablesource.h:113
virtual double readWaveTable(double oscClockIndex)
Read a table at a normalized index where 0.0 is the start of the table and 1.0 is the end of it...
Definition: dynamictablesource.h:33
void clearAllWavetables()
Clear out the wavetables to initialize or re-initialize.
Definition: dynamictablesource.h:132