Good approach to implementing modulation matrix? – DSP and Plug-in Development Forum

I’m implementing a modulation matrix for MIDI CC signal based changes and was wondering what might be the best approach to routing those signals from point A to point B.

One way to do it would be to have each destination parameter their own extra variable which would be used whenever that parameter is used in calculations. Then some outside system would keep those parameters updated as the MIDI CC’s come in. This would allow multiple MIDI CCs to affect one parameter as they would simply be added together.

Example: Filter cutoff parameter has an extra variable X, which always gets added to cutoff calculations.

Another way would be to let some outside system handle and update the parameters which come from GUI and go to the synthesis engine. Whenever a GUI knob gets tweaked or MIDI CC comes in, those two are matched, added together and set into the synthesis engine to it’s rightful location. This way there would be only a single variable for each parameter in the synthesis engine, but the outside system would handle the “book keeping” of all those parameters and their modulation sources/destinations.

Example: MIDI CC arrives. System checks where to route the signal: destination should be filter cutoff. The system checks the filter cutoff value (as defined by GUI knob), adds the MIDI CC amount to it and sets the value into the synthesis engine.

The first method might be simpler to implement but probably a bit slower, especially if the number of modulatable parameters gets higher.

The second method should be more efficient, but is more complex to implement.

Are there other useful ways to do this?

Read more here: Source link