|
Gin
|
Generate and hold bandlimited lookup tables for all the common waveforms. More...
#include <gin_bandlimitedlookuptable.h>
Public Member Functions | |
| BandLimitedLookupTables (double sampleRate=44100, int notesPerTable=3, int tableSize=2048) | |
| void | setSampleRate (double sampleRate) |
| void | reset (double sampleRate, int notesPerTable=-1, int tableSize=-1) |
| Rebuild the tables. | |
| float | processSine (float phase) |
| float | processTriangle (float note, float phase) |
| float | processSawUp (float note, float phase) |
| float | processSawDown (float note, float phase) |
| float | processSquare (float note, float phase) |
| float | processPulse (float note, float phase, float pw) |
| float | process (Wave wave, float note, float phase, float pw) |
| double | getSampleRate () |
Generate and hold bandlimited lookup tables for all the common waveforms.
| BandLimitedLookupTables::BandLimitedLookupTables | ( | double | sampleRate = 44100, |
| int | notesPerTable = 3, |
||
| int | tableSize = 2048 |
||
| ) |
| void BandLimitedLookupTables::reset | ( | double | sampleRate, |
| int | notesPerTable = -1, |
||
| int | tableSize = -1 |
||
| ) |
Rebuild the tables.
Does nothing if the parameters are unchanged, so it is safe to call from prepareToPlay. Pass -1 for notesPerTable or tableSize to keep the current value.
Building the tables is expensive; to defer the cost until the real sample rate is known, construct with a tiny table (e.g. notesPerTable 127, tableSize 1) then call reset later.
References BandLimitedLookupTable::getLinear().
Referenced by process().
References BandLimitedLookupTable::getLinear(), BandLimitedLookupTable::notesPerTable, and BandLimitedLookupTable::tables.
Referenced by process().
References BandLimitedLookupTable::getLinear(), BandLimitedLookupTable::notesPerTable, and BandLimitedLookupTable::tables.
Referenced by process().
References BandLimitedLookupTable::getLinear(), BandLimitedLookupTable::notesPerTable, and BandLimitedLookupTable::tables.
Referenced by process().
References BandLimitedLookupTable::getLinear(), BandLimitedLookupTable::notesPerTable, and BandLimitedLookupTable::tables.
Referenced by process().
References BandLimitedLookupTable::getLinear(), BandLimitedLookupTable::notesPerTable, and BandLimitedLookupTable::tables.
Referenced by process().
References WhiteNoise::nextSample(), PinkNoise::nextSample(), pinkNoise, processPulse(), processSawDown(), processSawUp(), processSine(), processSquare(), processTriangle(), pulse, sawDown, sawUp, silence, sine, square, triangle, and whiteNoise.
Referenced by StereoOscillator::processAdding().
| double BandLimitedLookupTables::getSampleRate | ( | ) |