In which part of the editor should I put conditional OSC remote control messages?

#1

I want to send OSC remote control messages to slave widgets upon specific conditions besides the regular message sent by the controlling widget. In which part of the editor should I put them? In the CSS field?

#2

It depends on what you are trying to achieve. Are you referring to the remote control commands documented here or are you trying to make a widget’s property react to arbitrary osc messages ? In the second case, you can combine the OSC{} syntax and the #{} syntax, both documented here.

Here is an example :

Another example: if you want to hide a widget on a specific osc message, you can set its css as follow:

:host {
  #{ OSC{/hide, 0} ? "display:none;" : "" }
}

Sending /hide 1 will hide the widget, sending /hide 0 will show it.

#3

I am trying to use toggles to select tabs within a container. So if I understand correctly, the “action” code should be put in the receiving widget.

#4

On the side of the master widget, how can I send a specific message besides in parallel with the usual message? Is it possible to send OSC from the CSS?

#5

I am trying to use toggles to select tabs within a container

Ok you don’t need any of these complicated things then: you just need to link the toggle’s and the tab container’s values, either by using their linkId property or by using the toggle’s value in the container’s value property (which defines the active tab) with the @{} syntax.

On the side of the master widget, how can I send a specific message besides in parallel with the usual message?

You can’t do that unless you write a custom module.

Is it possible to send OSC from the CSS?

No

#6

The toggle’s ID does not function as a container’s linkId strangely (I have checked that it does with the toggle’s label itself however so the issue is not on the toggle’s side). But using the toggle’s value in the container’s value field does.

#7

The toggle’s ID does not function as a container’s linkId

It doesn’t work this way, you have to choose an arbitrary identifier, widgets sharing the same linkId will be synced.

1 Like