1 #ifndef _SynthLabWTSource_h 2 #define _SynthLabWTSource_h 4 #include "synthfunctions.h" 9 const uint32_t MAX_WAVE_TABLES = 128;
12 class StaticTableSource :
public IWavetableSource
35 double wtData[2] = { 0.0, 0.0 };
41 double dIntPart = 0.0;
42 double fracPart = modf(wtReadLocation, &dIntPart);
43 uint32_t readIndex = (uint32_t)dIntPart;
65 for (uint32_t i = 0; i < NUM_MIDI_NOTES; i++)
71 synthLabTableSet->tableFs);
86 class DrumWTSource :
public IWavetableSource
127 inline void addWavetable(
const double* _table, uint32_t length,
const char* name,
double outputComp = 1.0)
134 inline void addWavetable(
const uint64_t* _table, uint32_t length,
const char* name,
double outputComp = 1.0)
137 StaticWavetable wt(_table, length, name, outputComp);
uint32_t tableLength
length
Definition: synthbase.h:1184
virtual const char * getWaveformName()
Definition: synthlabwtsource.h:94
double outputComp
output scaling factor
Definition: synthbase.h:1095
StaticWavetable drumTable
one table per drum
Definition: synthlabwtsource.h:232
virtual void selectTable(uint32_t midiNoteNumber)
Objects that access the database will select a table based on the user's waveform selection...
Definition: synthlabwtsource.h:100
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
double uint64ToDouble(uint64_t u)
maps a uint64 value to a double value without casting or mangling bits
Definition: synthfunctions.h:1848
DrumWTSource()
empty constructor
Definition: synthlabwtsource.h:151
const char * waveformName
string for the GUI
Definition: synthbase.h:1098
uint32_t wrapMask
wrapping mask = length - 1
Definition: synthbase.h:1185
Definition: synthengine.cpp:16
uint64_t ** ppHexTableSet
pointers to sets of hex encoded tables
Definition: synthbase.h:1089
virtual uint32_t getWaveTableLength()
Definition: synthlabwtsource.h:58
Structure for holding information about a static wavetable, that is read from a static location...
Definition: synthbase.h:1153
virtual const char * getWaveformName()
Definition: synthlabwtsource.h:20
virtual void selectTable(uint32_t midiNoteNumber)
Objects that access the database will select a table based on the user's waveform selection...
Definition: synthlabwtsource.h:26
const char * waveformName
waveform name string
Definition: synthbase.h:1188
double outputComp
output scaling factor (NOT volume or attenuation, waveform specific)
Definition: synthbase.h:1186
StaticTableSource()
empty constructor
Definition: synthlabwtsource.h:42
StaticWavetable wavetableSet[NUM_MIDI_NOTES]
— prefab table valid for all MIDI notes
Definition: synthlabwtsource.h:128
virtual uint32_t getWaveTableLength()
Definition: synthlabwtsource.h:122
const double * dTable
table of 64-bit doubles
Definition: synthbase.h:1183
StaticWavetable selectedTable
— selected table, stored here
Definition: synthlabwtsource.h:129
uint32_t * tableLengths
pointers to lengths of each of the hex encoded tables
Definition: synthbase.h:1088
~StaticTableSource()
empty destructor
Definition: synthlabwtsource.h:43
const uint64_t * uTable
table of 64-bit HEX values
Definition: synthbase.h:1182
void addSynthLabTableSet(SynthLabTableSet *synthLabTableSet)
Adds a new SET of wavetables to the array of 128 tables, one for each MIDI note.
Definition: synthlabwtsource.h:110
This structure defines a set of wavetables that are usually found in .h files and compiled into the s...
Definition: synthbase.h:1075
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: synthlabwtsource.h:106
~DrumWTSource()
empty destructor
Definition: synthlabwtsource.h:152
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: synthlabwtsource.h:32
void addWavetable(const double *_table, uint32_t length, const char *name, double outputComp=1.0)
Adds a new wavetable to the array of 128 tables, one for each MIDI note.
Definition: synthlabwtsource.h:206