Global MIDI Question. Perhaps a Feature Request?

Greetings everyone. Former Forte user. Experimented with v3 and dove into the deep end with v4. Certainly took a while to convert all my different live projects. But man… what a positive difference in work flow, efficiency and stability. A big thank you to the Gig Performer devs as well as the users/members for this forum… an absolutely invaluable resource for GP information. Appreciate everyone sharing their knowledge.

My issue… i have a new rig (an alt rehearsal rig) that includes an instrument (not mine) that outputs multiple midi channels over it’s hardware MIDI out.as a default. I only need to “see” chan 1 for Note On/Off info for this particular gig. And I do not have permission to dig into the menu of the instrument to alter settings. :frowning:

My question… Referencing the setting in Global MIDI called “Only accept program change messages on specific channel” as an example… is there a similar setting or way to only accept/pass Note On/Off on a specific channel on a global scale? Would be great to also be able to set a channel globally regarding CC messages. :wink:

I realize this can be accomplished on a per rackspace level using GP’s simple midi processing and filtering options. In my case that would involve editing 75+ rackspaces, each containing multiple midi blocks. Quite a time consuming task.

Thanks in advance for any help, guidance or assistance ya’ll can provide.
Global MIDI options

1 Like

Are you on Mac?

It is possible to do it with a Gig GPScript, but even if I know how to do it, I would prefer to modify the corresponding MIDI in blocks to filter out anything else than notes messages as well as MIDI channels other than 1. For this operation to be as quick as possible, you could prepare such a MIDI block and save it as a favorite. Than you would only have to adapt the note range and rewire the block.

1 Like

On Windows 10 Paul.

I think this could be done at gig script level.
Here you can catch incomming MIDI from hardware, process it, and then “inject” the processed aka filtered MIDI into the MDI In ports visible in GP.

Tested this for my rig manager MIDI in alias “Wavestation”:

// Define the name of the MIDI in device in the rig manager to be filtered
var Wavestation : MidiInDeviceAlias


//Callback called when a MIDI message is received at some MidiIn device
// m: Complete MIDI message
On MidiEvent(m : MidiMessage) from Wavestation

// Define an integer variable for
var Channel : Integer
// Get the channel of the MIDI message
Channel = GetChannel(m)
// Inject the MIDI message back into the device if channel = 1, only
   if Channel == 1
	then InjectMidiEventViaRigManager(Wavestation, m)
   end

End

PS: Welcome from Forte to Gig Performer!
I converted myself two years ago.

He wanted to filter out everything but notes messages on MIDI channel 1… :wink:

Here you are:

// Define the name of the MIDI in device in the rig manager to be filtered
var Wavestation : MidiInDeviceAlias


//Callback called when a MIDI message is received at some MidiIn device
// m: Complete MIDI message
On MidiEvent(m : MidiMessage) from Wavestation
// Define an integer variable for channel
var Channel : Integer
// Boolean for note messages
var Note: Boolean
// Get the channel of the MIDI message
Channel = GetChannel(m)
// Check if it is a note message
Note = IsNote(m)
// Inject the MIDI message back into the device if channel = 1, only
   if Channel == 1
    then if Note == true
	     then InjectMidiEventViaRigManager(Wavestation, m)
         end
   end
End

Well, now even pitch bend, mod wheel and controllers are filtered out :slight_smile:

Don’t know if this helps. I’m just practicing …

For some best practices tips, I thought I would suggest a few improvements to this

  1. It is never necessary to compare a boolean value with true or false. In other words, instead of writing
if Note == true
  then ...

you can just write

if Note
   then ...
  1. This callback can be made a little more efficient (always worth doing for GigScript functions) with the following version:
// Define the name of the MIDI in device in the rig manager to be filtered
var 
   Wavestation : MidiInDeviceAlias

On MidiEvent(m : MidiMessage) from Wavestation
   if  GetChannel(m) == 1
      then if IsNote(m)
              then  InjectMidiEventViaRigManager(Wavestation, m)
           End
   end
End

Explanation – first check the channel and only if it’s 1 then check to see if it’s a note - also don’t bother saving the channel and whether the message is a note.

  1. However, it’s possible to make the whole process even more efficient if you only want to allow notes through and nothing else (e.g, no pitchbend, aftertouch, CC messages, etc) by providing two callbacks
var
   TopSurface : MidiInDeviceAlias

// This callback only responds to note events so all you need to do is check the channel
On NoteEvent(m : NoteMessage) from TopSurface
    if m.GetChannel() == 1
       then TopSurface.InjectMidiEventViaRigManager(m)
    end        
End

// This callback will respond to all MIDI messages for which there are no
// explicit callbacks.
// Because it has no body inside, all other messages are simply ignored
On MidiEvent(m : MidiMessage) from TopSurface
   // Empty body        
End

The reason this last example is more efficient is because even though GP Script is pretty fast, the underlying tests (what kind of a message do we have) are done in native C++ code

3 Likes

Problem solved! And it turned out to be a pretty simple fix. Wonderful! Thank you David. Thank you Angel.
I do selfishly hope that such a function is at least considered for a future feature update in the global midi area… :wink:

1 Like

Hmmm — Let me just chiming in to tell that I am not sure that it is the best solution to do with a Gig GPScript something that every user we can do with any MIDI in block and a bit of elbow grease. We now have an happy user, that’s fine and I don’t want playing the spoilsport, but a little voice I have in my head tells me that if for each use case that requires a little bit of manpower, we run a GPScript instead, we are not done. :thinking:

I can relate to your doubts

1 Like

To be honest, it’s not obvious that such a function is really needed. This issue only happened because you had already created a large gig file and although time consuming the problem could have been solved (as you noted in your original post) by going through the gig file and blocking the unwanted MIDI channels on each MIDI In block, but obviously that’s time consuming and not necessarily something one wants to deal with at the last minute.

But it seems to me that these are very unusual corner cases. I think it’s probably very rare that one is presented with a keyboard that (a) is sending out on multiple channels and (b) one is not allowed to adjust it.

Further, going forward, you can of course just create a “favorite” MIDI In Block that just has channel 1 enabled and use that favorite going forward.

1 Like

You’re 100% correct David and I 100% understand your rational regarding adding it to a preference menu.