OSC Control of a Radial Button

Hello Everyone!

I am new to the world of Touch Designer, but inherited a bit of a complicated project. In the panel for this project there is a series of radial buttons that recall different sources that feed a bunch of pixel mapped LED strips.

I would like setup an OSC input to “Push” the buttons. The Touch designer is being fed a video by a d3 video server, so I would like to be able to put the touch designer into the right source for each show.

I have been able get the OSC input into touch designer using the OSC In CHOP and select the correct channel, but actually tying it to the radial button I cant quite wrap my head around.

Thanks!

hey smiPaul - can you post a photo of the radial button you’re working with? Or even just a tox of that component? I’d bet a little Python would get you there, but without seeing exactly what you’re working with it’s hard to give you a nudge in the right direction. :slight_smile:

Here you go!

Out1 of the .tox attached is feeding the index on a switch in another container which does the source selecting.

Thanks!
radio2.tox (10.6 KB)

A chop execute will get you there for sure. The idea is that you’d run a script when your input values change. Here’s what your CHOP execute Code would look like:

[code]def onValueChange(channel, sampleIndex, val, prev):

target = 'radio2/item{}'.format(int(val+1))
op(target).click()

return[/code]

We can start with an unformatted string that represents a the name of our target button, next we use the value returned from the CHOP, convert it to an integer (CHOP channels are floats, so unless we explicitly cast it as an int we’ll get a trailing decimal). I don’t know how your input vals are index - if they start at 0 you’ll want to add one (like above) if they start at 1 you don’t have to add 1.

Next we use the click() method to spoof a click on the button, and tada.

Here’s a tox example:
base_radio_click.tox (9.46 KB)

You should be able to see this function by changing the value on constant1 - I added a set of OSC objects in here to confirm that things would work as expected.

Hope this helps.

Works like a charm!

Thanks raganmd :wink: