Receive Sysex from Bitwig Studio Controller Script

Hi there,

I’m developing a custom bitwig studio controller script to use with my grid setup. So far everything works fine. I can send MIDI CC and MIDI Note messages from my controller to the script and also the other way around.

Right now I’m sending MIDI CC messages from my bitwig script to the grid controller to control the brightness of the different leds and this also works just fine.

For some future features I also want to set the color of leds from my bitwig script. For that I want to use SysEx messages instead of CC messages, because I need to send information that is too big for 7 bit CC messages.

And that’s where I’m stuck. I’m already sending sysex messages from my bitwig script to the grid but it seems like they’re not recognized.

I have the following code on the setup page of the system element:

I tried sending Sysex commands from my bitwig script and also from SysEx Librarian, but it does not work.

I also tried adding a SysEx block to one of my buttons and this works. So it seems like the it’s working when the SysEx message ist emitted by the grid itself, but it’s not working when sending SysEx from an external source.

Any help would be much appreciated! This is driving me nuts right now :smiley:

I also checked if the SysEx message is been sent properly by the bitwig script.

I changed the MIDI output port for my script to this MIDI Monitor tool and tried to send a SysEx message. Works as expected:

I also checked the midi monitor within the grid editor. It seems like the message is indeed received, but it looks very odd.

If I send the command “f00010101010f7” it will show this information:

Also it won’t appear in the bottom under “System Exclusive Messages”, so it seems to me like it’s not forwarded to the part of the system that handles SysEx messages.

Here’s how I built this specific message:

  • f0 → start of SysEx
  • 00 → manufacturer (00 = unknown)
  • 10 → 1st data byte
  • 10 → 2nd data byte
  • 10 → 3rd data byte
  • 10 → 4th data byte
  • f7 → end of SysEx

Hi, glad to see someone using Grid for SysEx!

Unfortunately a lot of things need updating about SysEx on the documentation, but we’re working on that.

A couple of things about sysexrx_cb:

The function syntax should be included in the new Function Action in Editor, looks like this:

So your parameters were in the wrong order, maybe it’s wrong in the Cloud too, tell me where you got that code and I’ll fix it!

The sysex itself is in the form of a string, wher received, but when sent it has to be properly formatted like so: 0xAAwhere AA is two hexadecimal characters. When sending multiples of these in a SysEx from Grid it would have to look like this: 0xF0,0x01,0x31,0x02,0x07,0x13,0x0C,0xF7 (this is an example Program Data Dump Request message for the Prophet-5).

1 Like

Hi @narayb and thank you for your fast reply :slight_smile:

I got the code snippet from this page: MIDI RX: Receiving MIDI | Intech Studio Documentation

But it seems like you already updated the section :slight_smile:

I tried the example from your post and it seems to be working now. I also updated grid editor to the newest version and all my modules to the newest firmware.

So it was probably a combination of old firmwares and old documentation.

Thank you very much! I’ll go ahead and implement some of the features I need SysEx for.

In my case it’s just about receiving SysEx on the grid controller, not about sending.

1 Like

Alright, works like a charm :slight_smile:

I’m sending SysExMessages in this format:

F0 → Start of SysEx
00 → Manufacurere (00 = unknown)
xx → byte for red
xx → byte for green
xx → byte for blue
xx → byte for brightness
xx → byte for the channel (not MIDI Channel, I need this to find the right grid controller)
xx → byte for the ledIndex on the found grid controller
F7 → End of SysEx

And here’s how I parse it and use the values for controlling leds:

Right now I’m only using 7 bit resolution for every color and the brightness (values 0-127). Maybe I’ll use two bytes for every value in the future to get the full 8 bit resolution. But for now this seems sufficient.

The problem is that within the SysEx body I can only use 7 Bits of every byte for my data, but that’s just how MIDI works.

Now I have full control over every LEDs color and brightness from my script. That’s awesome!

1 Like