ScriptModulationMatrix: Multiple Targets For One Component?
-
I've been digging around the ModulationMatrixTutorial snippet, and am curious about a particular use case.
Let's say we have a dual-synth setup, with a filter on each synth. A single UI slider should control the frequency of both filters, and (ideally) the slider's right-click menu should assign a modulator to both filters. We can't use a control callback for the slider, as it won't work with addModulatorTarget.
What if we duplicate the addModulatorTarget, changing the Target but keeping the same component and ID (so it shows up as a single entity in the matrix view)?
matrix.addModulatorTarget({ "Target": "OSC 1 Filter", "Chain": matrix.Frequency, "ID": "OSC 1 Frequency", "Component": "Knob5", "Slots": [2, 2, 1] }); matrix.addModulatorTarget({ "Target": "OSC 2 Filter", "Chain": matrix.Frequency, "ID": "OSC 1 Frequency", "Component": "Knob5", "Slots": [2, 2, 1] });
Chaos ensues. The slider affects Filter 2 only. Modulation activates for Filter 1 only. getModValue is lost in the slider's LAF. The mod matrix shows 2 instances of the same ID. The right-click menu doesn't reflect the currently active modulators.
I'm exploring workarounds in Broadcasters or Macros, but so far am unable to produce a solution that retains the UE of the ModMatrix system + allows (sample-accurate) modulation of multiple targets from a single component. Am I missing something obvious here?