I am Josip Bešlić and this is my firs post so firstly hello to everyone here.
I have a problem with gig script.
I wanted to use 5 buttons from my Midi controller (Novation Sl 61 MkII) to controll next, non built in function in Gig Perfrormer:
Save Gig;
Unhied/Hide global RackSpace;
Open/close ChordPro window.
So I wrote code in gig script editor to control this functions. Only input variableis Novation midi in device declared as ‘‘MidiInDeviceAlias’’ type, as this controller is defined in Rig Manager.
And those 3 functions work perfectly.
But, in the same time I’m using other 3 buttons frome the same Midi controller, on different Midi channel, with different cc numbers to controll bulit in Set List functions ‘‘Next Song’’ and ‘‘Prev Song’’ and Global Midi Function ‘‘Panic’’.
Problem is next:
If code written in Gig Script is compiled/active, built in functions assigned as explained above are not triggered, even the global midi monitor don’t catch any input midi message from my Midi Controller. If I turn the gig script code to one big comment, practicly deactivate it, built in function are triggered by midi in messages from my midi controller again.
When using a Gig Script, if you use a general callback such as On MidiEvent you are intercepting every single midi message from the controller. You have to explicitly send on any messages you want GP to receive. It won’t automatically pass through unused messages.
This is why using a “constrained” callback that is targeting specific CC numbers is often the better option.
Seeing your script will help understand all of these things.
Yes, you are right, it is hard to conclude what is an issue without attached script. So here is my code:
var
Nov_61_SL_Mk2_USB_2: MidiInDeviceAlias;
//Called when a CC message is received at some MidiIn device
On ControlChangeEvent(m : ControlChangeMessage) from Nov_61_SL_Mk2_USB_2
if GetChannel (m) == 16 then
// 1. Funkcija otvaranja i zatvaranja GLOBAL RACKSPACEa:
if GetCCNumber (m) == 51 then
if GetCCValue (m) == 127 then ShowGlobalRackspace(true)
else
if GetCCValue (m) == 0 then ShowGlobalRackspace(false)
end
end
end
end
// 2. Funkcija otvaranja i zatvaranja CHORD PRO:
if GetCCNumber (m) == 52 then
if GetCCValue (m) == 127 then ShowChordProWindow(true)
else
if GetCCValue (m) == 0 then ShowChordProWindow(false)
end
end
end
// 3. Funkcija SPREMANJA gig filea:
if GetCCNumber (m) == 53 then
if GetCCValue (m) == 127 then SaveGigfile() end
end
End
So, if i understood correctly, it will be better to replace On MidiEvent with some more appropriate callback, can you please recommend with what callback exactly.
The only way MIDI messages can disappear from the Global MIDI Monitor is if you’ve programmed a Gig Script. I assume you meant to program a Global Rackspace Script or perhaps I missed something.
For Global Rackspace Script: Var Nov_61_SL_Mk2_USB_2 MidiInBlock
A few other remarks:
Use matching: On ControlChangeEvent(m : ControlChangeMessage) matching 51,52,53 from Nov_61_SL_Mk2_USB_2
When you catch a MIDI Event in a callback you have to send it back when not used, e.g.
if GetChannel (m) == 16 then
else
Nov_61_SL_Mk2_USB_2.SendNow(m)
end