SynthLab SDK
SynthLab::Modulators Class Reference

Implements a modulator object. More...

#include <synthbase.h>

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

Public Member Functions

 Modulators ()
 constructs the modulator object More...
 
virtual double * getModArrayPtr (uint32_t index)
 get a pointer to a slot in the modulation array More...
 
virtual double getModValue (uint32_t index)
 get a value from a slot in the modulation array More...
 
virtual void setModValue (uint32_t index, double value)
 set a value into a slot in the modulation array More...
 
void clear ()
 fast clearing of modulator array
 
void initInputValues ()
 set default values in modulator array More...
 
IModulatorgetModulatorPtr ()
 

Protected Attributes

double modArray [MAX_MODULATION_CHANNELS]
 

Detailed Description

Implements a modulator object.

  • exposes the IModulator interface
  • each SynthModule owns two Modulators objects, one for the modulation input values (that come from modulation sources) and one for the modulation outputs, if the module writes to them (i.e. if the module is a modulator object)
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

◆ Modulators()

SynthLab::Modulators::Modulators ( )

constructs the modulator object

  • initializes input value to "proper" settings for a note-on event

Member Function Documentation

◆ getModArrayPtr()

double * SynthLab::Modulators::getModArrayPtr ( uint32_t  index)
virtual

get a pointer to a slot in the modulation array

for modulation matrix to have instant access to the input array

Parameters
indexthe index of the slot in the array

Implements SynthLab::IModulator.

◆ getModulatorPtr()

IModulator* SynthLab::Modulators::getModulatorPtr ( )
inline

helper function to return pointer to interface

◆ getModValue()

double SynthLab::Modulators::getModValue ( uint32_t  index)
virtual

get a value from a slot in the modulation array

Parameters
indexthe index of the slot in the array

Implements SynthLab::IModulator.

◆ initInputValues()

void SynthLab::Modulators::initInputValues ( )

set default values in modulator array

set defaults to avoid accidental note-off state, e.g. MIDI volume is accidentally initialized to 0.0

  • initializes input value to "proper" settings for a note-on event

◆ setModValue()

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

set a value into a slot in the modulation array

Parameters
indexthe index of the slot in the array

Implements SynthLab::IModulator.


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