Gin
|
Lookup tables for holding bandlimited waveforms. More...
Public Member Functions | |
BandLimitedLookupTable ()=default | |
BandLimitedLookupTable (std::function< float(float, float, float)> function, float sampleRate, int notesPerTable_=6, int tableSize_=2048) | |
void | reset (std::function< float(float, float, float)> function, float sampleRate, int notesPerTable_=6, int tableSize_=2048) |
int | tableIndexForNote (float note) |
std::vector< float > & | tableForNote (float note) |
float | process (float note, float phase) |
float | processLinear (float note, float phase) |
float | get (int tableIndex, float phase) |
float | getLinear (int tableIndex, float phase) |
void | loadFromBuffer (std::unique_ptr< juce::dsp::FFT > &fft, float playbackSampleRate, juce::AudioSampleBuffer &buffer, float fileSampleRate, int notesPerTable) |
Public Attributes | |
std::vector< std::vector< float > > | tables |
int | tableSize = 0 |
int | notesPerTable = 0 |
Lookup tables for holding bandlimited waveforms.
Holds one waveform for every N number notes
|
default |
BandLimitedLookupTable::BandLimitedLookupTable | ( | std::function< float(float, float, float)> | function, |
float | sampleRate, | ||
int | notesPerTable_ = 6 , |
||
int | tableSize_ = 2048 |
||
) |
References reset().
void BandLimitedLookupTable::reset | ( | std::function< float(float, float, float)> | function, |
float | sampleRate, | ||
int | notesPerTable_ = 6 , |
||
int | tableSize_ = 2048 |
||
) |
References getMidiNoteInHertz(), notesPerTable, tables, and tableSize.
Referenced by BandLimitedLookupTable().
int BandLimitedLookupTable::tableIndexForNote | ( | float | note | ) |
References notesPerTable, and tables.
Referenced by tableForNote().
std::vector<float>& BandLimitedLookupTable::tableForNote | ( | float | note | ) |
References tableIndexForNote(), and tables.
Referenced by process(), and processLinear().
float BandLimitedLookupTable::process | ( | float | note, |
float | phase | ||
) |
References tableForNote(), and tableSize.
float BandLimitedLookupTable::processLinear | ( | float | note, |
float | phase | ||
) |
References tableForNote(), and tableSize.
float BandLimitedLookupTable::getLinear | ( | int | tableIndex, |
float | phase | ||
) |
References tables, and tableSize.
Referenced by BandLimitedLookupTables::processPulse(), BandLimitedLookupTables::processSawDown(), BandLimitedLookupTables::processSawUp(), BandLimitedLookupTables::processSine(), BandLimitedLookupTables::processSquare(), and BandLimitedLookupTables::processTriangle().
void BandLimitedLookupTable::loadFromBuffer | ( | std::unique_ptr< juce::dsp::FFT > & | fft, |
float | playbackSampleRate, | ||
juce::AudioSampleBuffer & | buffer, | ||
float | fileSampleRate, | ||
int | notesPerTable | ||
) |
std::vector<std::vector<float> > BandLimitedLookupTable::tables |
int BandLimitedLookupTable::tableSize = 0 |
Referenced by get(), getLinear(), process(), processLinear(), and reset().
int BandLimitedLookupTable::notesPerTable = 0 |