Sorry if this is a basic question… I’m new to TouchDesigner.
I have a CHOP connected to serial to receive an input from an Arduino. The input comes in as a number 0, 1, 2, 3. As that serial input gives me the 10 latest results, I use a select CHOP to get the latest number (0, 1, 2, 3). It looks like below:
For my audio selection, I have 4 audio files that go into a switch CHOP and then to an output (laptop speaker). Looks like below.
I want to use the switch CHOP to select the right index based on the data from my select CHOP. Looks like this:
How do I select the input corresponding to the input from the Select CHOP above?
Thanks for reading to this point – I’d appreciate the help!
the screenshots are a bit tiny but I think I can make out that you are very close to the solution.
There are 2 ways:
since you have the Switch CHOP’s “First Input is Index” parameter toggled on, the first input to the Switch should actually be the Select CHOP that holds the index from the Arduino followed by the remaining Audio File In CHOPs.
you can also toggle off the Switch CHOP’s “First Input is Index” parameter and now control the “Index” parameter directly by either exporting or referencing the index channel from the Select CHOP.
For triggering the Play state of each Audio File In CHOP, have a look at the OP Snippets and how the Fan CHOP could help you here.
if I can see that correctly on the screenshot, the Switch CHOP is currently disabled. (the grey arrow on the left side below the orange flag that is also turned on.)
generally I would advise not to resize operators but make use of zooming the network when trying to inspect operators. This will keep your network tidy.
You can reset the operator size of all operators in your network by right clicking somewhere in the network pane, then first selecting “Normalize Node Sizes” and then “Reset Node Sizes”