|
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::setSampleRate | ( | double | sampleRate | ) |
| 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.
| float BandLimitedLookupTables::processSine | ( | float | phase | ) |
Referenced by process().
| float BandLimitedLookupTables::processTriangle | ( | float | note, |
| float | phase ) |
Referenced by process().
| float BandLimitedLookupTables::processSawUp | ( | float | note, |
| float | phase ) |
Referenced by process().
| float BandLimitedLookupTables::processSawDown | ( | float | note, |
| float | phase ) |
Referenced by process().
| float BandLimitedLookupTables::processSquare | ( | float | note, |
| float | phase ) |
Referenced by process().
| float BandLimitedLookupTables::processPulse | ( | float | note, |
| float | phase, | ||
| float | pw ) |
Referenced by process().
| float BandLimitedLookupTables::process | ( | Wave | wave, |
| float | note, | ||
| float | phase, | ||
| float | pw ) |
References pinkNoise, processPulse(), processSawDown(), processSawUp(), processSine(), processSquare(), processTriangle(), pulse, sawDown, sawUp, silence, sine, square, triangle, and whiteNoise.
| double BandLimitedLookupTables::getSampleRate | ( | ) |