Gin
|
Lookup tables for holding bandlimited waveforms. More...
#include <gin_bandlimitedlookuptable.h>
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) |
Load from an audio sample buffer, using an FFT to rerove high frequencies. | |
void | loadFromBuffer (float playbackSampleRate, juce::AudioSampleBuffer &buffer, float fileSampleRate, float fileFreq, int notesPerTable) |
Load from an audio sample buffer, using low pass filter to rerove high frequencies. | |
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().
References notesPerTable, and tables.
Referenced by tableForNote().
References tableIndexForNote(), and tables.
Referenced by process(), and processLinear().
References tableForNote(), and tableSize.
References tableForNote(), and tableSize.
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 | ||
) |
Load from an audio sample buffer, using an FFT to rerove high frequencies.
Usefull for wavetables.
void BandLimitedLookupTable::loadFromBuffer | ( | float | playbackSampleRate, |
juce::AudioSampleBuffer & | buffer, | ||
float | fileSampleRate, | ||
float | fileFreq, | ||
int | notesPerTable | ||
) |
Load from an audio sample buffer, using low pass filter to rerove high frequencies.
Usefull for samples.
std::vector<std::vector<float> > BandLimitedLookupTable::tables |
int BandLimitedLookupTable::tableSize = 0 |
Referenced by get(), getLinear(), process(), processLinear(), and reset().
int BandLimitedLookupTable::notesPerTable = 0 |