How to control switch by input data

Hello guys, I am a beginner. I’ve got some questions I’d like to ask you. It’s about switch and math. I wish I could type in some number like 1.2 or 2.12, and then I could control the switch to play different images.

1 Like

Did you figure this out? I am a beginner as well and am trying to synthesize a way to switch through a large sequence of images based on an input value. Say there’s 30 images/frames, then I want to map the range of a noise chop or bass drum of a song to that 1-30 range and feed that as the control for which image is being shown. Not sure how to approach this and haven’t found anything online similar to it.

Hey @BADSKULL,

you can load in image sequences via the Movie File In TOP and then proceed in controlling it’s index parameter. Have a look at the Movie File In TOP’s OP Snippets - there is an example for controlling the index.

How to create the index value really depends on what data you are using - is the index in a single channel like from a Noise CHOP? Then use a Math CHOP to change the range or set the values appropriately in the Noise CHOP’s parameters.
If it’s coming in as multiple on/off channels, check out the Snippets for the Fan CHOP to see how a multi channel can be converted into a index channel.

For a general introduction to TouchDesigner I would also recommend our learning platform at
learn.derivative.ca
It’s a great resource covering simple but important concepts.

Cheers
Markus