Need a little help scripting InjectMidiEventViaRigManager

I need a little help scripting InjectMidiEventViaRigManager

all my dual keyboard gig rigs are set up to
upper midi channel 2
lower midi chanel 1

I have one double manual Crumar keyboard - it has no midi implementation.

channels are fixed at 1 upper . 2 lower . base pedals 3.

I need to have 1 upper set to channel 2 and 2 lower set to channel 1

but I cant get this to compile properly

var
CRUMAR_UPPER : MidiInDeviceAlias
CRUMAR_LOWER : MidiInDeviceAlias

On NoteEvent(m : NoteMessage) from CRUMAR_UPPER
If m.GetChannel() == 1 Then InjectMidiEventViaRigManager(CRUMAR_UPPER, m.WithChannel(2)); End

On NoteEvent(m : NoteMessage) from CRUMAR_LOWER
If m.GetChannel() == 2 Then InjectMidiEventViaRigManager(CRUMAR_LOWER , m.WithChannel(1)); End

You know the MIDI Channel Constrainer?
Bildschirmfoto 2023-05-04 um 11.15.30

Or this way in the MIDI In Block?

Hi.
I would need to change every rack space to get that to work

Yes, but no scripting needed.

var
CRUMAR_UPPER : MidiInDeviceAlias
CRUMAR_LOWER : MidiInDeviceAlias

On NoteEvent(m : NoteMessage) from CRUMAR_UPPER
If m.GetChannel() == 1 Then InjectMidiEventViaRigManager(CRUMAR_UPPER, m.WithChannel(2));
End
end

On NoteEvent(m : NoteMessage) from CRUMAR_LOWER
If m.GetChannel() == 2 Then InjectMidiEventViaRigManager(CRUMAR_LOWER , m.WithChannel(1));
End
end

You forgot 2x the end.

Which is why we recommend that everyone read the documentation and get up to speed with the plugins includes with GP first😉….but yeah, sometimes one has to go back and change everything as one learns more. But it’s generally worth the effort.

Thanks paul - will try laters

Change rackspaces
Yeah thinks that maybe a safer option

+1 for changing Rackspace , recently I found the input muting and output fading found in show Rackspace properties to be a hidden gem , live autotune approach and had an issue bypassing a plugin with an audible artifact . solution for me was change Rackspace , A had the pitch plugin B doesn’t , therefore switching Rackspace and tweaking the input muting and output fading gives a seamless transition from effect on to effect off , the beauty of the Rackspace , a lot of GP built in plugins are BEAST and creatively can do a lot , especially the MIDI in block that’s the heart , it’s powerful !

Not really hidden – completely documented - but glad it works for you