SynthLab SDK
SynthLab::IModulator Class Referenceabstract

Interface for modulator objects. More...

#include <synthbase.h>

Inheritance diagram for SynthLab::IModulator:
SynthLab::Modulators

Public Member Functions

virtual double * getModArrayPtr (uint32_t index)=0
 Used for the modulation matrix to have instant access to the array. More...
 
virtual double getModValue (uint32_t index)=0
 get a modulation value from the array for a certain channel More...
 
virtual void setModValue (uint32_t index, double value)=0
 set a modulation value to the array for a certain channel More...
 

Detailed Description

Interface for modulator objects.

  • Modulator objects have multiple "channels" implemented as slots in an array of doubles
  • each slot in the array (channel) corresponds to a modulation source value (e.g. normal LFO output) or a modulation destination location (e.g. bi-polar modulation value that will connect to an oscillator)
  • there are MAX_MODULATION_CHANNELS per Modulator (you may easily change this constant)
  • this interface is used to allow access to specific modulation values or an entire array of values on a given channel
  • this is one of a handful of objects that uses naked pointers; this is necessary here because pointers to the modulation arrays must be able to cross a thunk barrier when used with the module-core paradigm, not possible with std::unique or shared pointers.
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

◆ getModArrayPtr()

virtual double* SynthLab::IModulator::getModArrayPtr ( uint32_t  index)
pure virtual

Used for the modulation matrix to have instant access to the array.

  • example:
  • double* pValue = lfo[0]->getModulationOutput()->getModArrayPtr(kLFONormalOutput))
Parameters
indexthe index of the channel for the modulator

Implemented in SynthLab::Modulators.

◆ getModValue()

virtual double SynthLab::IModulator::getModValue ( uint32_t  index)
pure virtual

get a modulation value from the array for a certain channel

  • example:
  • double modulationValue = lfo[0]->getModulationOutput()->getModValue(kLFONormalOutput))
Parameters
indexthe index of the channel for the modulator

Implemented in SynthLab::Modulators.

◆ setModValue()

virtual void SynthLab::IModulator::setModValue ( uint32_t  index,
double  value 
)
pure virtual

set a modulation value to the array for a certain channel

  • example:
  • lfo[0]->getModulationOutput()->setModValue(kLFONormalOutput, 0.1234))
Parameters
indexthe index of the channel for the modulator
valuethe modulation value to set

Implemented in SynthLab::Modulators.


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