Gin
Public Member Functions | Public Attributes | List of all members
BandLimitedLookupTable Class Reference

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
 

Detailed Description

Lookup tables for holding bandlimited waveforms.

Holds one waveform for every N number notes

Constructor & Destructor Documentation

◆ BandLimitedLookupTable() [1/2]

BandLimitedLookupTable::BandLimitedLookupTable ( )
default

◆ BandLimitedLookupTable() [2/2]

BandLimitedLookupTable::BandLimitedLookupTable ( std::function< float(float, float, float)>  function,
float  sampleRate,
int  notesPerTable_ = 6,
int  tableSize_ = 2048 
)

References reset().

Member Function Documentation

◆ reset()

void BandLimitedLookupTable::reset ( std::function< float(float, float, float)>  function,
float  sampleRate,
int  notesPerTable_ = 6,
int  tableSize_ = 2048 
)

◆ tableIndexForNote()

int BandLimitedLookupTable::tableIndexForNote ( float  note)

References notesPerTable, and tables.

Referenced by tableForNote().

◆ tableForNote()

std::vector<float>& BandLimitedLookupTable::tableForNote ( float  note)

References tableIndexForNote(), and tables.

Referenced by process(), and processLinear().

◆ process()

float BandLimitedLookupTable::process ( float  note,
float  phase 
)

References tableForNote(), and tableSize.

◆ processLinear()

float BandLimitedLookupTable::processLinear ( float  note,
float  phase 
)

References tableForNote(), and tableSize.

◆ get()

float BandLimitedLookupTable::get ( int  tableIndex,
float  phase 
)

References tables, and tableSize.

◆ getLinear()

float BandLimitedLookupTable::getLinear ( int  tableIndex,
float  phase 
)

◆ loadFromBuffer()

void BandLimitedLookupTable::loadFromBuffer ( std::unique_ptr< juce::dsp::FFT > &  fft,
float  playbackSampleRate,
juce::AudioSampleBuffer &  buffer,
float  fileSampleRate,
int  notesPerTable 
)

Member Data Documentation

◆ tables

std::vector<std::vector<float> > BandLimitedLookupTable::tables

◆ tableSize

int BandLimitedLookupTable::tableSize = 0

◆ notesPerTable

int BandLimitedLookupTable::notesPerTable = 0

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