SynthLab SDK
SynthLab::SineTableSource Class Reference

Storage for one static sinusoidal table source; stores a single sine table that is used for all notes. More...

#include <sinetablesource.h>

Inheritance diagram for SynthLab::SineTableSource:
SynthLab::IWavetableSource

Public Member Functions

 SineTableSource ()
 Stores the information about the static sinusoidal wavetable (see synthconstants.h) More...
 
 ~SineTableSource ()
 emptu destructor
 
virtual const char * getWaveformName () override
 
virtual void selectTable (uint32_t midiNoteNumber) override
 Nothing to do for this object since there is only one table.
 
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
 

Protected Attributes

StaticWavetable sineWavetable
 // — prefab table valid for all MIDI notes
 

Detailed Description

Storage for one static sinusoidal table source; stores a single sine table that is used for all notes.

  • exposes the IWavetavleSource interface
  • simplest wavetable source example
  • the owning object (a wavetable core) selects the table based on pitch during the update() phase which is ignored since the source only has one table. Then, the owning object 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

Constructor & Destructor Documentation

◆ SineTableSource()

SynthLab::SineTableSource::SineTableSource ( )
inline

Stores the information about the static sinusoidal wavetable (see synthconstants.h)

  • sets up the length and mask

Member Function Documentation

◆ getWaveformName()

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

Implements SynthLab::IWavetableSource.

◆ getWaveTableLength()

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

Implements SynthLab::IWavetableSource.

◆ readWaveTable()

virtual double SynthLab::SineTableSource::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: