Receive MIDI feedback for button state

Hello. I'm working with OSC buttons controling Cubase functions.

Can someone help me with script, I want to get feedback on toggle buttons in OSC, so when ever I click some button in Cubase, the same function is recognised in OSC. Basically if I turn off button in Cubase with mouse, my button in OSC also goes off. So I want to get this feedback for all buttons.

How to do that?

Thanks!

Hi,

You'll need to setup some generic remotes and/or the remote midi API to send data out from Cubase through a port that OSC is listening to. Let's call that port, "oscDataFromCubase" for now.

A simple idea is to do something like this.

  1. Listen for the port, i.e. "oscDataFromCubase"
  2. Get the value by discerning which value from Cubase belongs to which button
  3. Send that value to it's button inside the OSC Template.

Inside your custom module:

oscInFilter:function(data){
        // Filter outgoing osc messages

        var {address, args, host, port} = data

        if (port === "oscDataFromCubase") {
           receive("/toggleButtonMute", args[0].value)
        }

        // return data if you want the message to be and sent
        return {address, args, host, port}
    },

Inside OSC template, in the value of the button, you could have an OSC listener such as,
OSC{/toggleButtonMute, 0}
This will listen to that address that you can set using receive() in the custom module, using the address ID "/toggleButtonMute".

Then the reverse is, the button in the OSC template, would send midi data out that Cubase would be listening to, to set the button.

This is a simple explanation and requires some harder steps of setting it up to get the correct information from Cubase. The Cubase Remote API will definitely be your aid here, although not easy to set up.

Cheers,
DMDComposer

1 Like

I'm new to this stuff, can you attach some image example of how to do it correctly?

Thanks