SynthLab SDK
modmatrix.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "guiconstants.h"
5 #include "synthfunctions.h"
6 
7 // -----------------------------
8 // --- SynthLab SDK File --- //
9 // ----------------------------
17 // -----------------------------------------------------------------------------
18 namespace SynthLab
19 {
35  class ModMatrix
36  {
37  public:
39  ModMatrix(std::shared_ptr<ModMatrixParameters> _parameters);
40 
42  virtual ~ModMatrix() {}/* D-TOR */
43 
44  // --- mod-matrix specific functions see .cpp implementation
45  void addModSource(uint32_t sourceArrayIndex, double* sourceModPtr);
46  void clearModSource(uint32_t sourceArrayIndex);
47  void addModDestination(uint32_t destArrayIndex, double* destModPtr, uint32_t transform = kNoMMTransform);
48  void clearModDestination(uint32_t destArrayIndex);
49  void clearModMatrixArrays();
50  void runModMatrix();
51 
53  std::shared_ptr<ModMatrixParameters> getParameters() { return parameters; }
54 
55  protected:
56  // --- parameters
57  std::shared_ptr<ModMatrixParameters> parameters = nullptr;
58 
59  // --- arrays to hold source/destination
60  double* modSourceData[kNumberModSources];
61  double* modDestinationData[kNumberModDestinations];
62  uint32_t modDestTransform[kNumberModDestinations];
63 
64  };
65 
66 }
virtual ~ModMatrix()
Definition: modmatrix.h:42
Very customizable modulation matrix object.
Definition: modmatrix.h:35
void addModDestination(uint32_t destArrayIndex, double *destModPtr, uint32_t transform=kNoMMTransform)
Adds a modulation destination to the matrix.
Definition: modmatrix.cpp:76
void clearModDestination(uint32_t destArrayIndex)
Removes a modulation destination to the matrix.
Definition: modmatrix.cpp:92
Definition: addosccore.cpp:4
void clearModSource(uint32_t sourceArrayIndex)
Removes a modulation source to the matrix.
Definition: modmatrix.cpp:58
ModMatrix(std::shared_ptr< ModMatrixParameters > _parameters)
Clears out matrix arrays for initial state.
Definition: modmatrix.cpp:24
void runModMatrix()
Runs the modulation matrix (see Synth book)
Definition: modmatrix.cpp:123
std::shared_ptr< ModMatrixParameters > getParameters()
Definition: modmatrix.h:53
void clearModMatrixArrays()
Clears out all source and destination pointers from the array.
Definition: modmatrix.cpp:106
void addModSource(uint32_t sourceArrayIndex, double *sourceModPtr)
Adds a modulation source to the matrix.
Definition: modmatrix.cpp:43
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.