Midi Out From Gig File, Scriptlet or Global Rackspace

Hello,

It seems to me that GP provides extensive support for processing incoming MIDI data in scripts, but not as much for outgoing data. I hope I am missing something, but if not, consider this a feature request.

For some background, I have a FCB1010 with the Eureka PROM, which is the only one I know of that allows you to control the LEDs on the FCB1010. The downside is that the PROM uses an unconventional MIDI mapping. Instead of each pedal and LED having its own CC number, all pedals send CC104 when pressed and CC105 when released. The value sent is the pedal number, so pressing pedal 1 sends CC104, value 1. Pedal 2 sends CC104, value 2. Similarly, to control the pedal LEDs, you send CC106 with a value corresponding to the LED number to turn an LED on, and CC107 to turn it off.

This makes it impossible to directly bind the pedals to widgets in GP since each widget expects a unique CC number. I can create a scriptlet that converts incoming midi to something more useable, e.g. when pedal 1 is pressed, the scriptlet converts the incoming CC105, value 1 to CC1, value 127. I can also do this in a Gig file script via InjectMidiEventViaRigManager. However, I can’t find any way to capture midi going to a MidiOutBlock (typically from a widget binding) and convert it before it is sent to the actual MIDI out port. Is this possible?

To summarize, what I need is full bidirectional midi translation between GP4 and an external midi device.

Thanks,
Tom

With scripting you can send MIDI messages to MIDI out Blocks.

Tom have a look at this thread…

It would seem like what the FCB1010 is sending is a simple form of NRPN, sending just one CC # and value per button vs. sending three CC #s per button but I am thinking that the idea is the same.

I think if you can modify the script that @David-san wrote for me in the above thread to the values you are trying to manage into unique CC numbers, you can run a gig-script that converts the FCB1010 into something you can add to the rig manager and map to widgets.

2 Likes

The idea is to react to the incoming MIDI message and reinject it to the MIDI in block BEFORE it enters GP, then you can route it to whatever you want, e.g. a MIDI out block.

If scripting is OK for you, @brandon is right, the Gig script I made for him can be easily modified to do what you want to do. Tell us if you can adapt it to your own needs. :wink:

Thanks to each of you - pianopaul, Brandon, and David-san for the quick replies.

@pianopaul: As I understand it, you can only send midi to a MidiOutBlock in a Rackspace script. For example, this will not compile in a scriptlet or Gig File script:
var fcb_in: MidiInBlock

@brandon and David-san: It looks like your script is input only. I am able to handle input from my FCB1010, it’s the output that I am having trouble with. For example, let’s say my scriptlet converts incoming CC104, value 1 (Pedal 1 pressed) to CC1, value 127. I then bind a widget to CC1. If that widget changes value and sends CC1, value 0 out, I need to convert that to CC105, value 1 before it is sent to the FCB1010. I can’t find a way to do this.

This is getting compiled in a scriptlet:

on NoteEvent (m : NoteMessage)
 SendNowToMidiOutDevice("ABC", m)
end

Correct - rackspaces are the only entities that “know” about MidiOut Blocks. There can be multiple Midi Out blocks in a rackspace – they are all associated with actual MIDI output devices under the covers

Again, same reason.

The Gig Script (and, against my better judgement, scriptlets) “know” about actual MIDI devices. If you want to send MIDI to an external device “outside of a rackspace” then you use the

SendNowToMidiOutDevice(deviceName: String, m: MidiMessage) 

in a Gig Script to send MIDI directly to a MIDI Ouput device

1 Like

Thanks, dhj. SendNowToMidoOutDevice definitely helps, but only with a single Midi configuration. If the Rig Manager had better support for Midi outputs and you could send to an output alias, that would be even better.

What I think would be really handy is to be able to connect a scriptlet to the input pin of a MidiOutBlock in order to modify the Midi data on the way out, just like you can connect a scriptlet to the output pin of a MidiInBlock to modify Midi data on the way in.

I don’t understand. You can do that.

I think he has to use the Gig script, reinject in the MIDI in block and connect the MIDI in block to a MIDI out block (or any other plugin).

1 Like

I think he wishes to manipulate midi messages which are sent to the midi out by a scriptlet and this manipulated midi then goes to the midi out.

Wow, really? I tried that and it didn’t seem to work although I may have had something wrong. I am out of town now but will try that when I get back tomorrow.

That last message was in response to dhj.

pianopaul, you have it correct.

Not sure what you’re trying to do but the output of a scriptlet is MIDI and so can be connected to anything that accepts MIDI messages, whether it’s a synth or a MIDI Out block.

Yes, but will that scriplet intercept other midi data that is being sent to the MidiOutBlock?

The message at the top of this thread explains what I’m trying to accomplish.

@tombo86 is the purpose of the Midi Out messages that you’re discussing here only to keep the FCB1010 led’s in sync with GP?

Scriptlets do not intercept messages - you connect them in series to your destination and they can see messages coming in. Instead of sending to your MIDI Out and trying to “intercept” - send to the Scripltlet and connect the output of that Scriptlet to anything else (e.g. MIDI Out block).

I guess this is where we get confused - is this not working somehow for you?

I think he wants to capture MIDI events sent to the MIDI Out.
In this use case I included a MIDI OUT IAC-Bus 1

When rackspaces are switched then GP sends some MIDI messages to all included MIDI Out blocks
Bildschirmfoto 2021-11-26 um 13.49.17

Now the wish is that for example the All Notes Off Message can be captured and not sent out.
or the Hold Pedal gets captured and sent with a different value.

Maybe ideally. But if it’s just a question of re-translating a widget value back to the format that the fcb1010 expects and sending to a midi out port, then that can be achieved easily.

Thank you to each of you for trying to help solve this issue. I think it may help if I back up and explain the original issue in more detail as this thread seems to be going in circles. I tried to keep my original message concise, but probably made things more confusing instead. However, the fact that this is such a difficult question to answer definitely seems to prove my point that translating MIDI coming into GP is easy, but translating it on the way out is much harder.

My core issue is that my FCB1010 (a midi pedal board) has a custom ROM (called Eureka) which uses an unconventional MIDI implementation. Instead of each pedal having its own CC number, all pedals send out CC104 when pressed and CC105 when released. The value (3rd byte) of the MIDI message indicates which pedal was pressed or released. So, pressing pedal 3 sends CC104, value 3. Similarly, the pedal LEDs are turned on/off with CC106 or CC107, with the value representing which LED to turn on/off. Of course, GP widgets are designed to be linked to a unique CC number, so some MIDI translation is required to bind pedals and their corresponding LEDs on the FCB1010 to a widget.

I currently have a rackspace script that handles all of this translation and it works perfectly. However, the script relies on a lot of “On WidgetValueChanged()” callbacks to create the proper MIDI messages to send out to the FCB for LED state changes. It is effectively hard-coded to the specific set of plugins and widgets in the rackspace. It is very large and is difficult to edit if the rackspace configuration changes, and even harder if I create a new rackspace with different plugins and widgets.

What would be much simpler is if there were a way to globally translate all MIDI messages to/from the FCB1010. Then, widgets could be assigned to unique CC numbers and minimal additional scripting would be needed.

The global input translation is easy:
1- Use a scriptlet connected to the midi input from the FCB1010.
2- Use a Gig File script that listens for midi events and uses InjectMidiEventViaRigManager() to inject the translated message back to the input port.

Both of these methods effectively “intercept” incoming messages and convert them before any of GP’s widgets see them. However, I have not been able to figure out a way to globally translate midi messages (primarily sent by widgets) back to the FCB1010 message format. That is the problem I am trying to solve.

Another way to look at this is that I could use Bome Midi Translator to do all of the translating back and forth outside of GP, but it would be nice to keep it all within GP instead of needing to open another app every time I use GP.

Does this make things clearer?