Cubase 12 Midi Remote toggle function not working (javascript)

Does setTypeToggle() work? I for me it doesn’t.

I found this link with the same question, but for the mapping assistant which seems to work: Cubase 12 Midi Remote toggle function not working

How should it work. E.g. for the mute button.
When I send the value 127 mute lights up. When I send 0 mute gets dark.
But I would expect, that whenever I send 127 that the mute button gets toggled. Is that correct?

Are you binding the original buttons or custom variables?

The buttons directly. But the buttons can send, what I want.

We have two types of buttons as you most probably know: Gate and Toggle (I’m not referring to the way Cubase handles these, but to how WE have set them up).

In Gate mode, a button sends a 1 (say 127, upon press) and immediately after, a 0 (upon release). If your button works this way, you should set the setTypeToggle() if of course this is what you want to do, and obviously in the case of solo/mute indeed this is the way we should do it.

In Toggle mode, however, a button sends a 1 upon press/release and a 0 the next time we press/release. If your button is setup this way, then you shouldn’t set the setTypeToggle() because your control does this already, so Cubase receives the 1 (127) and 0 you send and behaves as expected (i.e. upon 1 it sets the value to ON and upon 0 to OFF).

That is exactly what I did. In the first place my button only send 127 upon press and no message on release at all. Then I adapted it to send 127 follow by sending a 0 immediately after 127. I used setTypeToggle(). But with no success. In both cases the Mute button light up but I could not deactivate it again.

Now, I remove the setTypeToggle() and tell the button to send what is necessary. So when Mute lights up, I send a 0 and when the Mute button is dark, I send 127. This is working.

But I did not manage to flip it on a 127[, 0] sequence. Then it was always on. Don’t know, if the time between 127 and 0 has an impect.

You may want to try giving some milliseconds space in between.

The strong point of using the gate approach is that you don’t have to memorize anything in your implementation (solo/mute states and so on). You just click and let DAW perform its task, this is why I’m suggesting you try the delay I’ve mentioned above.

Of cause I could try it, but since I want/have feedback for all buttons, I can handle it. I need to memorize anyway, in case I have to redraw controls.

Just asked the question out of curiosity. Do not really want to spend more time on it. Just thought, that there is someone who knows.

Thought I’ve covered your question. Gates and Toggles are pretty basic stuff.

But is the Toggle working for you in javascript?

Of course! Isn’t this what I’ve tried to tell you?