1 #ifndef _SynthLabWTSource_h 2 #define _SynthLabWTSource_h 4 #include "synthfunctions.h" 9 const uint32_t MAX_WAVE_TABLES = 128;
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);
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:1397
virtual const char * getWaveformName()
Definition: synthlabwtsource.h:94
double outputComp
output scaling factor
Definition: synthbase.h:1308
StaticWavetable drumTable
one table per drum
Definition: synthlabwtsource.h:143
Interface for wavetable sources.
Definition: synthbase.h:801
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
Storage for one static table source, specifically for drums which are pitchless and one-shot...
Definition: synthlabwtsource.h:86
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:1339
double uint64ToDouble(uint64_t u)
maps a uint64 value to a double value without casting or mangling bits
Definition: synthfunctions.h:1837
const char * waveformName
string for the GUI
Definition: synthbase.h:1311
uint32_t wrapMask
wrapping mask = length - 1
Definition: synthbase.h:1398
Definition: synthlabcore.cpp:4
uint64_t ** ppHexTableSet
pointers to sets of hex encoded tables
Definition: synthbase.h:1302
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:1366
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:1401
double outputComp
output scaling factor (NOT volume or attenuation, waveform specific)
Definition: synthbase.h:1399
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:12
StaticWavetable wavetableSet[NUM_MIDI_NOTES]
— prefab table valid for all MIDI notes
Definition: synthlabwtsource.h:81
virtual uint32_t getWaveTableLength()
Definition: synthlabwtsource.h:122
const double * dTable
table of 64-bit doubles
Definition: synthbase.h:1396
StaticWavetable selectedTable
— selected table, stored here
Definition: synthlabwtsource.h:82
uint32_t * tableLengths
pointers to lengths of each of the hex encoded tables
Definition: synthbase.h:1301
const uint64_t * uTable
table of 64-bit HEX values
Definition: synthbase.h:1395
This structure defines a set of wavetables that are usually found in .h files and compiled into the s...
Definition: synthbase.h:1288
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
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