Tag Archives: channel

Nov 12 2014

Switch CHOP tutorial.

The Switch CHOP. TouchDesigner 088. 2014.
The Switch CHOP is a fundamental multi-input Channel Operator.

1
00:00:00,267 –> 00:00:03,533
Let’s take a look at the switch
CHOP.

2
00:00:03,533 –> 00:00:07,400
The switch CHOP is a commonly
used operator.

3
00:00:07,400 –> 00:00:11,767
It allows for the switching of
any different type of CHOP.

4
00:00:11,767 –> 00:00:15,567
It has a minimal set of
parameters.

5
00:00:15,567 –> 00:00:20,633
Its inputs are indexed starting
with 0.

6
00:00:20,633 –> 00:00:27,133
Index entries that are higher
than the number of inputs are
ignored.

7
00:00:27,133 –> 00:00:33,667
Fractional entries are rounded
down to the closest integer.

8
00:00:33,667 –> 00:00:39,000
Here I use the index .5, which
rounds down to 0.

9
00:00:39,000 –> 00:00:45,967
I’ve built this network to
further illustrate the concept
of channels and samples.

10
00:00:45,967 –> 00:00:57,767
We have a circle TOP whose R, G,
and B parameters are set to
evaluate the 20th sample of the
switch CHOP.

11
00:00:57,767 –> 00:01:07,767
CHOPs can hold any arbitrary
number of channels, and each
channel can hold any arbitrary
number of samples.

12
00:01:07,767 –> 00:01:15,267
Therefore, the switch CHOP will
hold the exact number of
incoming channels and samples.

13
00:01:15,267 –> 00:01:22,800
I’ll change the Python
expression to evaluate only the
1st sample of the switch CHOP.

14
00:01:22,800 –> 00:01:27,700
When the index set to 0, we
select the 1st input.

15
00:01:27,700 –> 00:01:30,533
It only has 1 sample.

16
00:01:30,533 –> 00:01:35,200
Index 1 will select the 2nd
input.

17
00:01:35,200 –> 00:01:42,533
We can middle mouse click on the
CHOP to determine how many
samples it holds.

18
00:01:42,533 –> 00:01:51,900
It has 600 samples, and we are
evaluating only the 1st, in this
case a value of 0.

19
00:01:51,900 –> 00:01:58,500
The 3rd CHOP has sixty samples,
also starting with a value of 0.

20
00:01:58,500 –> 00:02:05,233
I’ll set the Python expression
to evaluate the 500th sample.

21
00:02:05,233 –> 00:02:12,733
Since only the 2nd input to the
switch CHOP has at least 500
samples,

22
00:02:12,733 –> 00:02:20,667
the Python expression will give
us the last available sample
from the other inputs.

23
00:02:20,667 –> 00:02:29,767
Input 1 has only 1 sample,
therefore the Python expression
evaluates to the value .5.

24
00:02:29,767 –> 00:02:34,567
But what about the 3rd input,
index 2?

25
00:02:34,567 –> 00:02:41,600
Shouldn’t it evaluate to a value
of 0, which is the value of the
last sample?

26
00:02:41,600 –> 00:02:45,567
We should have a black circle,
but it’s grey.

27
00:02:45,567 –> 00:02:54,200
Touch Designer gives us the
ability to change the way
out-of-range samples are
evaluated.

28
00:02:54,200 –> 00:03:01,067
I’ll change the “Extend Left”
and “Extend Right” parameters to
“Hold”.

29
00:03:01,067 –> 00:03:08,400
Imagine now a straight line
instead of a repeating cycle of
sample values.

30
00:03:08,400 –> 00:03:10,400
Now the 500th sample evaluates
to 0, which is the last actual
sample value in the 3rd input.