<< Click to Display Table of Contents >> Navigation: Callbacks > MIDI Events > Using Rig Manager aliases |
We saw an example of using a constraint with the ControlChange event callback. Here it is again
On ControlChangeEvent (c : ControlChangeMessage) Matching 1,7,14 From <MidiIn block name>
// This event is only called for controller numbers
// 1, 7 or 14
End
However, if you are using the Rig Manager to because you have to use different keyboards or control surfaces then you may have a problem if you switch to a different surface whose knobs, sliders and/buttons transmit CC messages with different numbers. In such a situation a script that uses a hard-coded CC number will fail.
To address this problem, the ControlChangeEvent callback now allows you to use Rig Manager defined control aliases instead of explicit numbers in the "Matching" clause of the callback. If you have defined the name UpperKnob1 (for example) to represent the first knob of your control surface, then you can write the following:
On ControlChangeEvent (c : ControlChangeMessage) Matching "UpperKnob1" From <MidiIn block name>
// This event is called when a CC message arrives from UpperKnob
End
At compile time, the Rig Manager will be searched to find the correct CC number for the device being used. If you change your gear and consequently update the Rig Manager, scripts will be recompiled automatically so as to reflect the change.
Note that the alias name is specified as a string constant.