Converting system exclusive to control change

With very few modifications and adding a viscount aliasname in Rig Manager, This is again a good candidate for a Gig Script:

Var
  viscount : MidiInDeviceAlias // Define viscount as a RigManager alias to the viscount controller

var pattern : String
var p : SysexMessage
var SysEx : String
var MidiCh : Int
var msb : Int
var lsb : Int
var value: Int
var ccmesg : ControlChangeMessage
var ccnum : Int
var mypattern: String = "F031"

On SysexEvent(p: SysexMessage) from viscount
   SysEx = p
   MidiCh = SM_GetValue(p,2) - 48
   pattern = CopySubstring(SysEx, 0, 4)
   //Print(“MyPattern= " + mypattern)
   if mypattern == pattern 
      then
         ccnum = SM_GetValue(p,5) + 46
         msb = SM_GetValue(p,6) << 7
         lsb = SM_GetValue(p,7)
         // Combine bytes and scale the CC
         value = (msb + lsb) * 127/255
         // Print (“value = ” + value)
        ccmesg = MakeControlChangeMessageEx(ccnum, value, MidiCh)
        InjectMidiEventViaRigManager(viscount, ccmesg)
   End //if
End // On SysexEvent

Using a Gig Script, GP will only see the converted CC and not the SysEx anymore and you can seamlessly use the Rig Manager.

2 Likes