20 const uint32_t MAX_WAVE_TABLES = 128;
36 return selectedTable.waveformName;
42 selectedTable = wavetableSet[midiNoteNumber];
49 double wtData[2] = { 0.0, 0.0 };
52 double wtReadLocation = selectedTable.tableLength * oscClockIndex;
55 double dIntPart = 0.0;
56 double fracPart = modf(wtReadLocation, &dIntPart);
57 uint32_t readIndex = (uint32_t)dIntPart;
58 uint32_t nextReadIndex = (readIndex + 1) & selectedTable.wrapMask;
68 return selectedTable.outputComp * output;
75 inline void addWavetable(Wavetable* table, uint32_t midiNoteNumber)
82 Wavetable wavetableSet[NUM_MIDI_NOTES];
83 Wavetable selectedTable;
virtual const char * getWaveformName()
Definition: wtsource.h:34
Definition: wtsource.h:23
Interface for wavetable sources.
Definition: synthbase.h:609
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:1387
double uint64ToDouble(uint64_t u)
maps a uint64 value to a double value without casting or mangling bits
Definition: synthfunctions.h:1944
Definition: addosccore.cpp:4
virtual uint32_t getWaveTableLength()
Definition: wtsource.h:72
const uint32_t NUM_MIDI_NOTES
Definition: synthconstants.h:618
virtual void selectTable(uint32_t midiNoteNumber)
Objects that access the database will select a table based on the user's waveform selection...
Definition: wtsource.h:40
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
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: wtsource.h:46