Hello,
this gig script is for a LED widget (not shown here), which could be on any panel, and which indicates some MIDI activity on a chosen port. Such an MIDI activity LED could be much larger than the built-in LED, and by some modifications it could react on spcecific MIDI events, only. Just link the LED widget to the CC generated in this script on the GP local port.
Because it is on gig script level, it still works to display activity for incomming CC mapped to a widget, which would be swallowed, otherwise, and which would not bedisplayed by any scripts or scriptlets on a global or rackspace level.
Inspired by the MIDI LED activity scriptlet by @David-san.
Comments and enhancements are welcome!
// This gig script checks for MIDI activity on one specific port.
// If there is MIDI, a CC is generated.
// This CC is sent to the GP local port for special purposes.
// A LED widget on any panel linked to this CC now can indicate MIDI activity.
// Timer script based on a LED activity scriptlet by David-san.
// Angel von Powerlord, 2021
Var PCRCC : MidiInDevice //Alias MIDI port to monitor. Replace to match yours.
Var Local : MidiInDevice //Alias to GP loacal port
Var MIDI_activity : integer; // Flag for MIDI activity: 0 : no, 127: yes
Var CC : ControlChangeMessage; // CC sent on MIDI activity
// Initalization: No MIDI activity after startup
On SystemEvent Matching GigLoaded
MIDI_activity = 0;
// Create MIDI CC flag. Could be any CC, any value.
// Odd selection to differentiate from usual CCs.
CC = MakeControlChangeMessageEx(99 , MIDI_activity , 13)
InjectMidiEventViaRigManager(Local, CC)
End
// If there is MIDI on the controller port
On MidiEvent(msg : MidiMessage) From PCRCC
// Don't swallow, rather pass on to same port, instead:
InjectMidiEventViaRigManager(PCRCC, msg)
// Set MIDI activity flag
MIDI_activity = 127;
CC = MakeControlChangeMessageEx(99 , MIDI_activity , 13)
// LED button widget on global panel is linked to this CC
InjectMidiEventViaRigManager(Local, CC)
SetTimersRunning(true);
End
// Timer for the LED to go off after a short time
On TimerTick(ms : double)
If MIDI_activity == 127
Then
MIDI_activity = 0;
CC = MakeControlChangeMessageEx(99 , MIDI_activity , 13)
InjectMidiEventViaRigManager(Local, CC)
Else
SetTimersRunning(false);
End;
End