1 #ifndef _SynthLabWTSource_h 2 #define _SynthLabWTSource_h 4 #include "synthfunctions.h" 57 inline virtual void selectTable(uint32_t midiNoteNumber)
override 73 double wtData[2] = { 0.0, 0.0 };
79 double dIntPart = 0.0;
80 double fracPart = modf(wtReadLocation, &dIntPart);
81 uint32_t readIndex = (uint32_t)dIntPart;
112 for (uint32_t i = 0; i < NUM_MIDI_NOTES; i++)
118 synthLabTableSet->tableFs);
166 inline virtual void selectTable(uint32_t midiNoteNumber)
override { }
206 inline void addWavetable(
const double* _table, uint32_t length,
const char* name,
double outputComp = 1.0)
223 inline void addWavetable(
const uint64_t* _table, uint32_t length,
const char* name,
double outputComp = 1.0)
uint32_t tableLength
length
Definition: synthbase.h:1184
virtual const char * getWaveformName() override
Definition: synthlabwtsource.h:48
double outputComp
output scaling factor
Definition: synthbase.h:1095
StaticWavetable drumTable
one table per drum
Definition: synthlabwtsource.h:232
Interface for wavetable sources.
Definition: synthbase.h:588
Storage for one static table source, specifically for drums which are pitchless and one-shot...
Definition: synthlabwtsource.h:148
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:98
Structure for holding information about a static wavetable, that is read from a static location...
Definition: synthbase.h:1153
virtual uint32_t getWaveTableLength() override
Definition: synthlabwtsource.h:194
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
virtual void selectTable(uint32_t midiNoteNumber) override
Select a table based on MIDI note number; nothing to do here.
Definition: synthlabwtsource.h:166
virtual const char * getWaveformName() override
Definition: synthlabwtsource.h:157
virtual double readWaveTable(double normalizedPhaseInc) override
Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange ...
Definition: synthlabwtsource.h:176
StaticTableSource()
empty constructor
Definition: synthlabwtsource.h:42
Storage for one static table source; a static table is pre-compiled into the synth, or (optionally) read from a file. The "source" stores a set of these tables to maximize frequency content while prohibiting aliasing.
Definition: synthlabwtsource.h:39
virtual double readWaveTable(double normalizedPhaseInc) override
Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange ...
Definition: synthlabwtsource.h:70
StaticWavetable wavetableSet[NUM_MIDI_NOTES]
— prefab table valid for all MIDI notes
Definition: synthlabwtsource.h:128
const double * dTable
table of 64-bit doubles
Definition: synthbase.h:1183
StaticWavetable selectedTable
— selected table, stored here
Definition: synthlabwtsource.h:129
void addWavetable(const uint64_t *_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:223
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
~DrumWTSource()
empty destructor
Definition: synthlabwtsource.h:152
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
virtual void selectTable(uint32_t midiNoteNumber) override
Select a table based on MIDI note number.
Definition: synthlabwtsource.h:57