So this worked like a charm… once again great scripting David-San! Thank you!
I ended up injecting 10 controls via this Rig Script and then made MIDI Control Aliases in Rig Manager for those controls.
I changed the created CC numbers in the script to numbers that are by default undefined (CC 102-110).
Here’s that script:
Var
XK5 : MidiInDeviceAlias // Define XK5 as a RigManager alias to the real controller
CC_State, CC99, CC98 : Integer = 0;
On ControlChangeEvent(CC_msg:ControlChangeMessage) Matching 99,98,6 from XK5
Select
CC_State == 0 Do if (CC_msg.GetCCNumber()==99) Then CC99 = CC_msg.GetCCValue(); CC_State = 1 Else CC_State = 0 End
CC_State == 1 Do if (CC_msg.GetCCNumber()==98) Then CC98 = CC_msg.GetCCValue(); CC_State = 2 Else CC_State = 0 End
CC_State == 2 Do
if (CC_msg.GetCCNumber()==6)
then
Select
// Leslie Stop => CC#102
CC99 == 6 && CC98 == 9 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(102, CC_msg.GetCCValue()*127, 1));
// Leslie Fast => CC#103
CC99 == 1 && CC98 == 9 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(103, CC_msg.GetCCValue()*127, 1));
// Overdrive Depth => CC#104
CC99 == 2 && CC98 == 48 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(104, CC_msg.GetCCValue(), 1));
// Effect Amount => CC#105
CC99 == 8 && CC98 == 48 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(105, CC_msg.GetCCValue(), 1));
// Reverb Depth => CC#106
CC99 == 2 && CC98 == 10 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(106, CC_msg.GetCCValue(), 1));
// Overdrive => CC#107
CC99 == 0 && CC98 == 48 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(107, CC_msg.GetCCValue()*127, 1));
// Effect => CC#108
CC99 == 4 && CC98 == 48 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(108, CC_msg.GetCCValue()*127, 1));
// Reverb => CC#109
CC99 == 0 && CC98 == 10 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(109, CC_msg.GetCCValue()*127, 1));
// Bypass Leslie => CC#110
CC99 == 0 && CC98 == 9 Do InjectMidiEventViaRigManager(XK5, MakeControlChangeMessageEx(110, CC_msg.GetCCValue()*127, 1));
End
end
CC_State = 0;
End
End
While I am very happy to just use the sounds in the XK-5 now, the B3-X VST does have a controller profile function within it that auto converts these NRPN values to the B3-X from Hammond keyboards, if I want to use the XK to control the B3-X.
That profile feature would make this scripting unnecessary, except in cases where I want the controls to work with a different VST (in my case, having the stop and fast controls operate the TR5 Leslie VST in my global rackspace) or to use controls from the XK-5 that do not have an profile correlation in the B3-X, like the Overdrive, Effects and Reverb controls.
So thanks again, this script is perfect!
For anyone else doing the same thing, here is a full index of all the NRPN values from the XK5:
Parameter Name | CC 99 | CC 98 | CC 6 (value) | TYPE |
---|---|---|---|---|
SPLIT | 0 | 5 | 0/1 | SWITCH |
PEDAL TO LOWER | 0 | 11 | 0/1 | SWITCH |
PEDAL SUSTAIN | 6 | 34 | 0/1 | SWITCH |
UPPER OCTIVE UP | 2 | 5 | 64 | SWITCH |
UPPER OCTIVE DOWN | 2 | 5 | 63 | SWITCH |
LOWER OCTIVE UP | 3 | 11 | 64 | SWITCH |
LOWER OCTIVE DOWN | 3 | 11 | 63 | SWITCH |
UPPER TRANSPOSE UP | 0 | 1 | 64 | SWITCH |
UPPER TRANSPOSE DOWN | 0 | 1 | 63 | SWITCH |
LOWER TRANSPOSE UP | 3 | 11 | 64 | SWITCH |
LOWER TRANSPOSE DOWN | 3 | 11 | 63 | SWITCH |
BYPASS | 0 | 9 | 0/1 | SWITCH |
STOP | 6 | 9 | 0/1 | SWITCH |
FAST | 1 | 9 | 0/1 | SWITCH |
VIBRATO UPPER | 3 | 9 | 0/1 | SWITCH |
VIBRATO LOWER | 4 | 33 | 0/1 | SWITCH |
VIBRATO V1 | 5 | 9 | 0 | 6-WAY |
VIBRATO C1 | 5 | 9 | 3 | 6-WAY |
VIBRATO V2 | 5 | 9 | 1 | 6-WAY |
VIBRATO C2 | 5 | 9 | 4 | 6-WAY |
VIBRATO V3 | 5 | 9 | 2 | 6-WAY |
VIBRATO C3 | 5 | 9 | 5 | 6-WAY |
PERCUSSION | 0 | 8 | 0/1 | SWITCH |
SOFT | 3 | 8 | 0/1 | SWITCH |
FAST | 2 | 8 | 0/1 | SWITCH |
THIRD | 1 | 8 | 0/1 | SWITCH |
BASS | 8 | 3 | 0-127 | ROTARY |
FREQ | 11 | 3 | 0-127 | ROTARY |
GAIN | 9 | 3 | 0-127 | ROTARY |
TREBLE | 10 | 3 | 0-127 | ROTARY |
OVERDRIVE % | 2 | 48 | 0-127 | ROTARY |
EFFECT % | 8 | 48 | 0-127 | ROTARY |
REVERB % | 2 | 10 | 0-127 | ROTARY |
OVERDRIVE | 0 | 48 | 0/1 | SWITCH |
EFFECT | 4 | 48 | 0/1 | SWITCH |
REVERB | 0 | 10 | 0/1 | SWITCH |