SynthLab SDK
SynthLab::IWavetableSource Class Referenceabstract

Interface for wavetable sources. More...

#include <synthbase.h>

Inheritance diagram for SynthLab::IWavetableSource:
SynthLab::DrumWTSource SynthLab::DynamicTableSource SynthLab::SineTableSource SynthLab::StaticTableSource SynthLab::WavetableSource

Public Member Functions

virtual void selectTable (uint32_t midiNoteNumber)=0
 Objects that access the database will select a table based on the user's waveform selection. More...
 
virtual double readWaveTable (double normalizedPhaseInc)=0
 Read a table at a normalized index where 0.0 is the start of the table and 1.0 is the end of it. More...
 
virtual uint32_t getWaveTableLength ()=0
 
virtual const char * getWaveformName ()=0
 

Detailed Description

Interface for wavetable sources.

  • A wavetable database stores a set of wavetable sources
  • each source represents one waveform generator
  • each wavetable source has a uniqe name string, that is usually the name of the waveform which itself must be unique otherwise the user would be confused
  • the source may consist of a single table (such as the SineTableSource) while others may implement an array of tables, for example to implement bandlimited wavetables across a set of keys
  • The source interface functions allow:
  1. selection of a table (this should mark the table in some way as being the currently selected item)
  2. read the selected wavetable
  3. get the name and length of the table
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

◆ getWaveformName()

virtual const char* SynthLab::IWavetableSource::getWaveformName ( )
pure virtual

◆ getWaveTableLength()

virtual uint32_t SynthLab::IWavetableSource::getWaveTableLength ( )
pure virtual

◆ readWaveTable()

virtual double SynthLab::IWavetableSource::readWaveTable ( double  normalizedPhaseInc)
pure virtual

Read a table at a normalized index where 0.0 is the start of the table and 1.0 is the end of it.

  • the object that overrides this function must also implement any interpolation needed
Parameters
normalizedPhaseIncnormalized index in the table to access
Returns
the output value from the table, usually with interpoltion of some kind

Implemented in SynthLab::DrumWTSource, SynthLab::SineTableSource, SynthLab::DynamicTableSource, SynthLab::StaticTableSource, and SynthLab::WavetableSource.

◆ selectTable()

virtual void SynthLab::IWavetableSource::selectTable ( uint32_t  midiNoteNumber)
pure virtual

Objects that access the database will select a table based on the user's waveform selection.

  • the note number is used to decode the selection to permit bandlimited sets of tables which is the normal operation in SynthLab
Parameters
midiNoteNumberthe note number corresponding to the currently rendered pitch

Implemented in SynthLab::DrumWTSource, SynthLab::SineTableSource, SynthLab::StaticTableSource, SynthLab::DynamicTableSource, and SynthLab::WavetableSource.


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