Gin
Loading...
Searching...
No Matches
BandLimitedLookupTables Class Reference

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 ()

Detailed Description

Generate and hold bandlimited lookup tables for all the common waveforms.

Constructor & Destructor Documentation

◆ BandLimitedLookupTables()

BandLimitedLookupTables::BandLimitedLookupTables ( double sampleRate = 44100,
int notesPerTable = 3,
int tableSize = 2048 )

Member Function Documentation

◆ setSampleRate()

void BandLimitedLookupTables::setSampleRate ( double sampleRate)

◆ reset()

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.

◆ processSine()

float BandLimitedLookupTables::processSine ( float phase)

Referenced by process().

◆ processTriangle()

float BandLimitedLookupTables::processTriangle ( float note,
float phase )

Referenced by process().

◆ processSawUp()

float BandLimitedLookupTables::processSawUp ( float note,
float phase )

Referenced by process().

◆ processSawDown()

float BandLimitedLookupTables::processSawDown ( float note,
float phase )

Referenced by process().

◆ processSquare()

float BandLimitedLookupTables::processSquare ( float note,
float phase )

Referenced by process().

◆ processPulse()

float BandLimitedLookupTables::processPulse ( float note,
float phase,
float pw )

Referenced by process().

◆ process()

float BandLimitedLookupTables::process ( Wave wave,
float note,
float phase,
float pw )

◆ getSampleRate()

double BandLimitedLookupTables::getSampleRate ( )

The documentation for this class was generated from the following file: