New vs. Old MIDI RX | Intech Studio
💬 general GridGeneral

New vs. Old MIDI RX

bo
bo · · 26 replies

my fully functioning PBF4 setup doesn't work anymore after the update. I'm using it with Bitwig which sends data via RX. Are the new and old way of MIDI RX mutually exclusive?
the issue is, I need space in System->Setup to declare some globals. if I have to do the stuff previously done in Sytem->MIDI RX in Setup there is not enough space.

Replies (26)

Hybrid Hybrid ·

Hi! I can't give a definitive answer about the old vs new methods but that seems to be the case from my little bit of testing (see here).

Without seeing your full config, it's hard to give a complete answer but you might find this forum post useful. The order of initialisation for the Lua blocks changed recently and that can cause problems with existing setups. While this might not be impacting you directly, we can use some knowledge from that post.

Considering that you're running out of space in the System -> Setup, could you move some of your globals to another element? To ensure that the globals are registered in time, you can use this snippet from the forum post at the start of your System -> Setup block:

for i = 0, #element - 1 do
    element[i]:ini()
end

Ideally, you'd put the globals in the Setup block of the lowest numbered element you can. Then they'll be processed as the module boots up (hopefully giving you the same result while freeing up space in the System -> Setup). Does that make sense?

These character limits are frustrating and the Intech team are working to increase it but it's not a trivial problem to solve from what I understand...

Hybrid Hybrid ·

I just had another thought: if you need to have the MIDI RX callback outside the System -> Setup block, I wonder if it could be rewritten to accommodate that. 🤔

Instead of this in your System -> Setup:

function self.midirx_cb(self, event, header)
  -- (your code here)
end

You could try moving the MIDI RX callback to a different element (any other element's Setup) and rewrite the callback code to reference the System -> Setup element instead of using the self variable. Assuming element[12] is your System element on the PBF4, the code would look like this:

sys = element[12]
sys.midirx_cb = function(sys, event, header)
  -- (your code here)
end

I don't have a PBF4 but a quick test on a different module with this code seems to work and it leaves the System -> Setup clear for other code. Worth a try!

bo bo ·

thank you @user I'll digest that and have a deeper look at my code again later. I'll get back to you....

bo bo ·

Just a quick question while I'm divinng in. The System->MIDI RX tab is now completely useless?

Hybrid Hybrid ·

I'm not sure about that – I haven't worked out what it should be used for. I know there is a lot of development work happening on the Grid Editor at the moment and I imagine the interface and documentation will be updated soon to make it clearer.

bo bo ·

I used it before for the RX stuff but with the switch to midirx.cb() it looks like it's depricated

Hybrid Hybrid ·

Looking at Github, it seems there were issues with the way the MIDI RX worked and it had to be changed to prevent overload/crashes.

The new MIDI RX docs don't mention anything about the change to using the Setup action but I guess it's related to when the callback gets set up and triggered.

Let's ask @user about the MIDI RX tab since he wrote those docs... 🙂 Is this going to be removed from the UI?

bo bo ·

I'm trying to refactor and juggle stuff around but the character limit ...

bo bo ·

:Painnn_tlm:

Hybrid Hybrid ·

I feel your pain getting things to fit – you have to get very creative sometimes. Once you understand how the code gets executed and how to reference elements and functions correctly, it opens up the possibilities.

If you get stuck making something fit, you can share it here and someone might be able to suggest an alternative approach.

Greg-Orca Greg-Orca ·

Hey, yes—unfortunately we had to rearrange the MIDI RX to make automatic assignments possible in the future and simplify the workflow. But right now, it’s in a bit of an in-between state.

Check the profiles which I made: Buttons MIDIRX EN16 MIDIRX Basic MIDIRX

Hybrid Hybrid ·

Thanks for your reply @user!

Since it's currently in an bit of an in-between state, does that mean the MIDI RX tab will disappear from the System element?

I checked out the profiles you made and they are very helpful – the only comment is that they use up a lot of characters in the System -> Setup event. Of course, they could be compacted but I'm curious to know what you think of this approach where the MIDI RX callback can be put in the Setup event of another element:

sys = element[12]
sys.midirx_cb = function(sys, event, header)
  -- (your code here)
end

This seems to work but is there anything wrong with taking this approach?

Greg-Orca Greg-Orca ·

Yes MIDI RX tab will disappear

Greg-Orca Greg-Orca ·

You can assign this function to any Setup element

Hybrid Hybrid ·

Great, thank you for confirming @user 🙂

bo bo ·

This is gold. Sorry for not chiming in regularly, I'm off/on scripting depending on my mood. XD

bo bo ·

OK, it took me a looooong long time, I changed the logic a bit and rewrote a function in the Bitwig java extension, adpated the lua and had chatGPT help me a bit with compacting etc.

Now it's working like before the RX changes. Still way to go but that's different story.
Thanks @user & @user .

bo bo ·

It was about sending the colors of Bitwig tracks to th eLEDs of EN16 and PBF4 btw.

Hybrid Hybrid ·

Glad you got it working like before @bo 🙂
Sounds like a sophisticated setup you have there... You might also be interested in this: https://discord.com/channels/761513181696098335/761519567745974272/1396088201306701874

bo bo ·

at first I had the Bitwig extension send an ID for each color, then identify it in the grid via global lookup. I just need 4 colors , one for every track/column of controls on the devices but lookup is some overhead since it stores 10 colors to choose from.
I then switched the logic to sending out MIDI CC in 4ths: track, r, g, b.

Hybrid Hybrid ·

That sounds like a flexible solution and if I understood correctly, you can have a huge number of tracks and colour variations 🌈 😎

bo bo ·

actually it's always a bank of 4 tracks so 4 colors at a time only but it can be any rgb value

bo bo ·

I filter primary-ish colors though beacuse of discernability

bo bo ·

too many weird mixed tones don't translate well on the LEDs

bo bo ·

they are weak on Red i.e., I have to add a bit to make orange orange and yellow not green

Hybrid Hybrid ·

True, I haven't experimented enough with the LED colours yet but I also noticed that about certain mixtures of colours.

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →