Gin
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ModMatrix Class Reference

Add one of these to you Synth if you want to support modulation. More...

Classes

class  Listener
 

Public Types

enum  PolarityMode { unipolar , bipolar , sameAsSource }
 
enum  Function {
  linear , quadraticIn , quadraticInOut , quadraticOut ,
  sineIn , sineInOut , sineOut , exponentialIn ,
  exponentialInOut , exponentialOut , invLinear , invQuadraticIn ,
  invQuadraticInOut , invQuadraticOut , invSineIn , invSineInOut ,
  invSineOut , invExponentialIn , invExponentialInOut , invExponentialOut
}
 

Public Member Functions

 ModMatrix ()=default
 
void setDefaultPolarityMode (PolarityMode m)
 
void stateUpdated (const juce::ValueTree &vt)
 
void updateState (juce::ValueTree &vt)
 
float getValue (gin::Parameter *p, bool smoothed=true)
 
float getValue (ModVoice &voice, gin::Parameter *p, bool smoothed=true)
 
juce::Array< float > getLiveValues (gin::Parameter *p)
 
void setMonoValue (ModSrcId id, float value)
 
void setPolyValue (ModVoice &voice, ModSrcId id, float value)
 
void finishBlock (int numSamples)
 
void addVoice (ModVoice *v)
 
ModSrcId addMonoModSource (const juce::String &id, const juce::String &name, bool bipolar)
 
ModSrcId addPolyModSource (const juce::String &id, const juce::String &name, bool bipolar)
 
void addParameter (gin::Parameter *p, bool poly, float smoothingTime=0.02f)
 
void setSampleRate (double sampleRate)
 
void build ()
 
void enableLearn (ModSrcId source)
 
void disableLearn ()
 
ModSrcId getLearn ()
 
int getNumModSources ()
 
juce::String getModSrcName (ModSrcId src)
 
bool getModSrcPoly (ModSrcId src)
 
bool getModSrcBipolar (ModSrcId src)
 
juce::String getModDstName (ModDstId dst)
 
juce::Array< ModSrcIdgetModSources (gin::Parameter *)
 
ParametergetParameter (ModDstId d)
 
bool isModulated (ModDstId param)
 
float getModDepth (ModSrcId src, ModDstId param)
 
std::vector< std::pair< ModDstId, float > > getModDepths (ModSrcId param)
 
std::vector< std::pair< ModSrcId, float > > getModDepths (ModDstId param)
 
void setModDepth (ModSrcId src, ModDstId param, float f)
 
void clearModDepth (ModSrcId src, ModDstId param)
 
Function getModFunction (ModSrcId src, ModDstId param)
 
void setModFunction (ModSrcId src, ModDstId param, Function f)
 
bool getModEnable (ModSrcId src, ModDstId param)
 
void setModEnable (ModSrcId src, ModDstId param, bool b)
 
bool getModBipolarMapping (ModSrcId src, ModDstId param)
 
void setModBipolarMapping (ModSrcId src, ModDstId param, bool b)
 
bool shouldShowLiveModValues ()
 
void setOnlyShowModWhenVoiceActive (bool b)
 
void addListener (Listener *l)
 
void removeListener (Listener *l)
 

Static Public Member Functions

static float shape (float v, Function f, bool biPolarSrc, bool biPolarDst)
 

Detailed Description

Add one of these to you Synth if you want to support modulation.

Then add all your parameters Then add all your mod source. Update your mod sources from your processing loop. Always get your parameter values from the mod matrix

Member Enumeration Documentation

◆ PolarityMode

Enumerator
unipolar 
bipolar 
sameAsSource 

◆ Function

Enumerator
linear 
quadraticIn 
quadraticInOut 
quadraticOut 
sineIn 
sineInOut 
sineOut 
exponentialIn 
exponentialInOut 
exponentialOut 
invLinear 
invQuadraticIn 
invQuadraticInOut 
invQuadraticOut 
invSineIn 
invSineInOut 
invSineOut 
invExponentialIn 
invExponentialInOut 
invExponentialOut 

Constructor & Destructor Documentation

◆ ModMatrix()

ModMatrix::ModMatrix ( )
default

Member Function Documentation

◆ setDefaultPolarityMode()

void ModMatrix::setDefaultPolarityMode ( PolarityMode  m)

◆ stateUpdated()

void ModMatrix::stateUpdated ( const juce::ValueTree &  vt)

◆ updateState()

void ModMatrix::updateState ( juce::ValueTree &  vt)

◆ shape()

static float ModMatrix::shape ( float  v,
Function  f,
bool  biPolarSrc,
bool  biPolarDst 
)
static

◆ getValue() [1/2]

float ModMatrix::getValue ( gin::Parameter *  p,
bool  smoothed = true 
)

◆ getValue() [2/2]

float ModMatrix::getValue ( ModVoice voice,
gin::Parameter *  p,
bool  smoothed = true 
)

References Assets::info, shape(), and Assets::voice.

◆ getLiveValues()

juce::Array<float> ModMatrix::getLiveValues ( gin::Parameter *  p)

◆ setMonoValue()

void ModMatrix::setMonoValue ( ModSrcId  id,
float  value 
)

References Assets::info.

◆ setPolyValue()

void ModMatrix::setPolyValue ( ModVoice voice,
ModSrcId  id,
float  value 
)

References Assets::voice.

◆ finishBlock()

void ModMatrix::finishBlock ( int  numSamples)

◆ addVoice()

void ModMatrix::addVoice ( ModVoice v)

◆ addMonoModSource()

ModSrcId ModMatrix::addMonoModSource ( const juce::String &  id,
const juce::String &  name,
bool  bipolar 
)

◆ addPolyModSource()

ModSrcId ModMatrix::addPolyModSource ( const juce::String &  id,
const juce::String &  name,
bool  bipolar 
)

◆ addParameter()

void ModMatrix::addParameter ( gin::Parameter *  p,
bool  poly,
float  smoothingTime = 0.02f 
)

◆ setSampleRate()

void ModMatrix::setSampleRate ( double  sampleRate)

◆ build()

void ModMatrix::build ( )

◆ enableLearn()

void ModMatrix::enableLearn ( ModSrcId  source)

◆ disableLearn()

void ModMatrix::disableLearn ( )

◆ getLearn()

ModSrcId ModMatrix::getLearn ( )

◆ getNumModSources()

int ModMatrix::getNumModSources ( )

◆ getModSrcName()

juce::String ModMatrix::getModSrcName ( ModSrcId  src)

References ModSrcId::id.

◆ getModSrcPoly()

bool ModMatrix::getModSrcPoly ( ModSrcId  src)

References ModSrcId::id.

◆ getModSrcBipolar()

bool ModMatrix::getModSrcBipolar ( ModSrcId  src)

References ModSrcId::id.

◆ getModDstName()

juce::String ModMatrix::getModDstName ( ModDstId  dst)

◆ getModSources()

juce::Array<ModSrcId> ModMatrix::getModSources ( gin::Parameter *  )

◆ getParameter()

Parameter* ModMatrix::getParameter ( ModDstId  d)

◆ isModulated()

bool ModMatrix::isModulated ( ModDstId  param)

◆ getModDepth()

float ModMatrix::getModDepth ( ModSrcId  src,
ModDstId  param 
)

◆ getModDepths() [1/2]

std::vector<std::pair<ModDstId, float> > ModMatrix::getModDepths ( ModSrcId  param)

◆ getModDepths() [2/2]

std::vector<std::pair<ModSrcId, float> > ModMatrix::getModDepths ( ModDstId  param)

◆ setModDepth()

void ModMatrix::setModDepth ( ModSrcId  src,
ModDstId  param,
float  f 
)

◆ clearModDepth()

void ModMatrix::clearModDepth ( ModSrcId  src,
ModDstId  param 
)

◆ getModFunction()

Function ModMatrix::getModFunction ( ModSrcId  src,
ModDstId  param 
)

◆ setModFunction()

void ModMatrix::setModFunction ( ModSrcId  src,
ModDstId  param,
Function  f 
)

◆ getModEnable()

bool ModMatrix::getModEnable ( ModSrcId  src,
ModDstId  param 
)

◆ setModEnable()

void ModMatrix::setModEnable ( ModSrcId  src,
ModDstId  param,
bool  b 
)

◆ getModBipolarMapping()

bool ModMatrix::getModBipolarMapping ( ModSrcId  src,
ModDstId  param 
)

◆ setModBipolarMapping()

void ModMatrix::setModBipolarMapping ( ModSrcId  src,
ModDstId  param,
bool  b 
)

◆ shouldShowLiveModValues()

bool ModMatrix::shouldShowLiveModValues ( )

◆ setOnlyShowModWhenVoiceActive()

void ModMatrix::setOnlyShowModWhenVoiceActive ( bool  b)

◆ addListener()

void ModMatrix::addListener ( Listener l)

◆ removeListener()

void ModMatrix::removeListener ( Listener l)

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