Converting system exclusive to control change

Hi, I have a Viscount organ which I am using to control an organ plugin in Gig Performer 4. The drawbars only send sys ex data when used and I have been trying to get this to work with drawbar widgets in GP. I have struggled a bit with the manual’s instructions for using the OSC function. Would anyone be able to supply a step-by-step instruction for using sys ex messages to control widgets? I have been considering using an external program like midipipe, but I am sure GP can do this function.

Cheers

I wonder which one you have. I have a viscount legend and it uses CC messages for the drawbars, not sysex messages

If your drawbars really only generate sysex messages, then you’re going to have to identify them all and use a gigscript to convert them to CC (say) messages

I have the Viscount DB5. I see the midi light flashing when I move them, but when I view the activity in the midi monitor, it is all sys ex. I also checked the midi implementation chart for the DB5 and it does not send control change for the draw bars. I was after how i would go about using the GP script to be able get widgets to respond to sys ex.

Hi @ritchieb, welcome to the GP community forum :wink:

Yes, the idea is to use a gig script to convert from SysEx to CC « before it enters GP ». Are the SysEx for the drawbar described in your manual? We need to know that or we will have to do some kind of reverse engineering.

Thanks David, i am a novice when it comes to sys ex. I have used midi since the early 90s but always avoided sys ex!! I do have the sys ex data information in the organ manual shown in the picture included. Also in the midi implementation table, it show sys ex messages as received and transmitted.

I took a look and it should be possible.
What drawbar should send what CC Message?

Thanks that’s perfect, we still need to figure out the xx yy coding of the value. Could you please do the following:

  • mode the 16" drawbar to 0
  • open the GP Global MIDI monitor
  • if necessary clear the GP Global MIDI monitor window with the using appropriate button
  • move the 16" drawbar to the max
  • take a screenshot of the GP Global MIDI monitor window and post it here

Ok here it is. Hope this helps.

1 Like

Just to drop a useful link in here:
Parameters Controllable By Means System Exclusive - Viscount DB-5 Operating Manual [Page 39] | ManualsLib

Also see the next page…

1 Like

Looks like an 8 bit value converted to two 7 bit bytes, so some scaling would be required to make it a CC value to make it 7 bits. It also looks like if you move the drawbar fast, it might miss sending some values. Interesting most of my drawbar devices send SysEx with a byte value of only 9 values 0-8. Also I don’t see a 9th drawbar here in the table so maybe this device does not use the high drawbar.

Steve

Although I’m not an expert in scripting, this should get you started.

We convert to CC 100-107. I do not check for other SysEx event types. I just look at the first two bytes
of sysex to determine if it is valid. More should be added if you don’t want non-drawbar sysex.

It should be installed as a Scriptlet. It will inject CC’s into the local GP port.

// Created by Steve Caldwell
// 2022-05-11


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) 
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)
    InjectMidiEvent("Local GP Port",ccmesg)
  End
End

Note: You need to unblock SysEX on the MIDI IN Block that you are using.

Steve

1 Like

Steve, thanks for writing this — I have just reformatted it so that indentation is clear and I also converted those non-standard double-quotes to ASCI double-quotes so that the code can be copy/pasted directly into a scriptlet

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)
   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)
        InjectMidiEvent("Local GP Port", ccmesg)
   End //if
End // On SysexEvent

1 Like

Sounds good @dhj

Thank you guys. I will give this script a go. I appreciate your help.

Interesting that the documentation doesn’t call out the 2’ drawbar but I’m pretty sure the device has one based on the pictures I’ve looked at. It would be interesting to check what that drawbar sends when you move it. The documentation only calls out 8 drawbars but I’m pretty sure there are actually 9.

Steve

1 Like

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

Thank you guys for your suggestions.

You are welcome, but your feedback will be appreciated. :wink:

2 Likes

Apologies for my late reply. I will copy and paste the script and run it shortly and will let you know how it goes.

I have some good use cases for this Gig Script :wink: (thanks @David-san )

I see it working nicely !!

2 Likes