SynthLab SDK
SynthLab::StaticTableSource Class Reference

Storage for one static table source; a static table is pre-compiled into the synth, or (optionally) read from a file. The "source" stores a set of these tables to maximize frequency content while prohibiting aliasing. More...

#include <synthlabwtsource.h>

Inheritance diagram for SynthLab::StaticTableSource:
SynthLab::IWavetableSource

Public Member Functions

 StaticTableSource ()
 empty constructor
 
 ~StaticTableSource ()
 empty destructor
 
virtual const char * getWaveformName () override
 
virtual void selectTable (uint32_t midiNoteNumber) override
 Select a table based on MIDI note number.
 
virtual double readWaveTable (double normalizedPhaseInc) override
 Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead. More...
 
virtual uint32_t getWaveTableLength () override
 
void addSynthLabTableSet (SynthLabTableSet *synthLabTableSet)
 Adds a new SET of wavetables to the array of 128 tables, one for each MIDI note. More...
 

Protected Attributes

StaticWavetable wavetableSet [NUM_MIDI_NOTES]
 — prefab table valid for all MIDI notes
 
StaticWavetable selectedTable
 — selected table, stored here
 

Detailed Description

Storage for one static table source; a static table is pre-compiled into the synth, or (optionally) read from a file. The "source" stores a set of these tables to maximize frequency content while prohibiting aliasing.

  • exposes the IWavetavleSource interface
  • stores 128 StaticWavetable objects, one for each MIDI note
  • stores a selected table
  • the owning object (a wavetable core) selects the table based on pitch during the update() phase, then makes calls to read the table during the render() phase
  • see also StaticWavetable
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Member Function Documentation

◆ addSynthLabTableSet()

void SynthLab::StaticTableSource::addSynthLabTableSet ( SynthLabTableSet synthLabTableSet)
inline

Adds a new SET of wavetables to the array of 128 tables, one for each MIDI note.

  • uses the SynthLabTableSet to encode the set of pointers to tables
  • tables are stored in .h files and compiled into product
  • you can change this to add tables in whatever format you like
Parameters
synthLabTableSeta set of wavetables that have been setup to maximize frequency content with zero aliasing

◆ getWaveformName()

virtual const char* SynthLab::StaticTableSource::getWaveformName ( )
inlineoverridevirtual
Returns
name of selected string as const char*

Implements SynthLab::IWavetableSource.

◆ getWaveTableLength()

virtual uint32_t SynthLab::StaticTableSource::getWaveTableLength ( )
inlineoverridevirtual
Returns
the length of the selected wavetable

Implements SynthLab::IWavetableSource.

◆ readWaveTable()

virtual double SynthLab::StaticTableSource::readWaveTable ( double  normalizedPhaseInc)
inlineoverridevirtual

Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead.

Parameters
normalizedPhaseIncthe phase increment value; usually this is the mcounter member of a SynthClock object and is fo/fs where fo is the desired oscillator frequency

Implements SynthLab::IWavetableSource.


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