Category Archives: TD tutorials

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.

Nov 12 2014

Join CHOP tutorial.

The Join CHOP. TouchDesigner 088. 2014.
The Join CHOP can append multiple types of incoming channel datatypes. This allows you to sculpt or craft specialty waveforms.

1
00:00:00,800 –> 00:00:04,367
Let’s examine the join CHOP.

2
00:00:04,367 –> 00:00:12,533
I’ve set up 3 example networks
here, each network illustrates
different approaches to using
the join CHOP.

3
00:00:12,533 –> 00:00:17,500
In this network we will append 3
CHOPs together.

4
00:00:17,500 –> 00:00:24,367
We start with the ramp from 0 to
1, and end with a ramp from 1 to
0.

5
00:00:24,367 –> 00:00:27,667
In the middle we have a noise
CHOP.

6
00:00:27,667 –> 00:00:33,900
As you can see, the join CHOP
will stack one CHOP after the
next.

7
00:00:33,900 –> 00:00:44,800
Using the “Preserve Length”
method, with no blending or
overlap interpolation, the CHOPs
are simply appended together.

8
00:00:44,800 –> 00:00:51,767
We can better visualize the join
by changing the seed parameter
of the noise CHOP.

9
00:00:51,767 –> 00:01:00,767
By maintaining an overlap region
of 0, any overlap shape
parameter I choose has no
effect.

10
00:01:00,767 –> 00:01:02,967

11
00:01:02,967 –> 00:01:12,700
In the second example network,
we’ll look at the “Insert Blend
Region” option of the method
parameter.

12
00:01:12,700 –> 00:01:21,400
We join 3 chops with single
sample values of 0, 1, and .5.

13
00:01:21,400 –> 00:01:31,033
We can see that the join CHOP
has interpolated a simple ramp
between the incoming values.

14
00:01:31,033 –> 00:01:40,967
By using the “Insert Blend
Region” method, we can define an
overlap region between each
incoming value.

15
00:01:40,967 –> 00:01:47,567
We can also control the shape of
the overlap blend.

16
00:01:47,567 –> 00:01:59,767
As I increase the overlap
region, you’ll see that the join
CHOP creates a smoother and
smoother interpolation between
the incoming values.

17
00:01:59,767 –> 00:02:06,600
It does this by creating more
samples than the total of the
original inputs.

18
00:02:06,600 –> 00:02:16,533
It uses the extra samples to
create more fine tuned steps
between the original inputs.

19
00:02:16,533 –> 00:02:26,533
In this example we’ll use the
“Overlap Sequences” method to
join the to incoming waveforms.

20
00:02:26,533 –> 00:02:41,500
We’ll join a triangle and a sine
wave, and you’ll notice that
there is a disparity in the end
value of input 1, and the start
value of input 2.

21
00:02:41,500 –> 00:02:49,033
We want to interpolate between
these 2 values, to create a
smooth join.

22
00:02:49,033 –> 00:02:57,067
This is similar to adjusting
Bezier handles on keyframes, or
points on a spline.

23
00:02:57,067 –> 00:03:05,367
As I increase the overlap
region, you’ll see the join
become smoother and smoother.

24
00:03:05,367 –> 00:03:11,733
If I use the “Cubic”
interpolation method, I can
shift the bias.

25
00:03:11,733 –> 00:03:20,133
This will determine the
influence that either the first
or second input will have on the
overlap.

26
00:03:20,133 –> 00:03:30,233
The join CHOP parameters are
very powerful, and will allow
you to fine tune your blends to
an exact specification.

27
00:03:30,233 –> 00:03:32,233

Nov 12 2014

Blend CHOP tutorial.

The Blend CHOP. TouchDesigner 088. 2014.
The Blend CHOP is a special multi-input CHOP. It can combine CHOP Channel values using different weighting calculations.

1
00:00:00,233 –> 00:00:03,133
Let’s examine the blend CHOP.

2
00:00:03,133 –> 00:00:09,533
The blend CHOP is very powerful,
but its usage can be difficult
to understand.

3
00:00:09,533 –> 00:00:18,900
Unlike other CHOPs that combine
multiple inputs, the blend CHOP
uses its first input as a
controller.

4
00:00:18,900 –> 00:00:27,600
The reason for this architecture
is that the blend CHOP can
control an arbitrary amount of
inputs.

5
00:00:27,600 –> 00:00:31,233
The second input is a base
value.

6
00:00:31,233 –> 00:00:35,867
These are the values that all
other inputs will be compared
to.

7
00:00:35,867 –> 00:00:41,067
This network uses 3 states, plus
a base state.

8
00:00:41,067 –> 00:00:47,567
We will use the “Difference”
method for blending the incoming
channels.

9
00:00:47,567 –> 00:01:00,467
The states of “rx”, “ry”, and
“rz” represent rotations, and
they are applied to a geometry
component by using Python
expressions.

10
00:01:00,467 –> 00:01:03,967
The base state is 0 rotation.

11
00:01:03,967 –> 00:01:08,033
Adjusting its amount with the
controller has no effect.

12
00:01:08,033 –> 00:01:12,000
This is because we are using the
“Difference” method.

13
00:01:12,000 –> 00:01:17,300
Try using the “Proportional”
method to blend in the base
state.

14
00:01:17,300 –> 00:01:22,033
Now I increase the amount of
influence of state 1.

15
00:01:22,033 –> 00:01:30,133
Again, notice that the base
state is only calculated as a
comparative starting point.

16
00:01:30,133 –> 00:01:35,967
I’ll increase the influence of
state 1 to its maximum value.

17
00:01:35,967 –> 00:01:39,733
No other states are influencing
the blend.

18
00:01:39,733 –> 00:01:45,900
In this way the blend CHOP can
be used as a simple switch.

19
00:01:45,900 –> 00:01:50,500
Now I’ll begin combining states.

20
00:01:50,500 –> 00:01:56,933
The blend CHOP calculates state
influences in real time.

21
00:01:56,933 –> 00:01:58,933
It can be used as a way to morph
any type of value or state in
Touch Designer.

Nov 12 2014

Speed CHOP tutorial.

The Speed CHOP. TouchDesigner 088. 2014.
The Speed CHOP can be utilized as the core of complex animation engines in TouchDesigner.

1
00:00:00,100 –> 00:00:02,433
Let’s take a look at the speed
CHOP.

2
00:00:02,433 –> 00:00:08,500
The speed CHOP uses an input
value as a rate of change.

3
00:00:08,500 –> 00:00:11,867
It outputs this change over
time.

4
00:00:11,867 –> 00:00:18,633
In this example, we will use a
constant CHOP to set the rate of
change.

5
00:00:18,633 –> 00:00:26,267
With a value of 1, the rate of
change is 1 times 60 per second.

6
00:00:26,267 –> 00:00:32,000
The output of the speed CHOP
will increase by 1 every second.

7
00:00:32,000 –> 00:00:39,667
With a value of .5, the speed
CHOP will increase by .5 every
second.

8
00:00:39,667 –> 00:00:50,567
We can use the speed CHOP to
easily create time or animation
engines that are independent of
the global frame rate of Touch
Designer.

9
00:00:50,567 –> 00:00:51,300

10
00:00:51,300 –> 00:00:57,533
This example network shows the
basics of a commonly used
animation engine.

11
00:00:57,533 –> 00:01:02,667
We want an animation to be
driven by user input.

12
00:01:02,667 –> 00:01:08,567
When the button is clicked, its
state changes from 0 to 1.

13
00:01:08,567 –> 00:01:16,567
A chop execute DAT will run a
Python expression that resets a
speed CHOP.

14
00:01:16,567 –> 00:01:17,400

15
00:01:17,400 –> 00:01:26,433
We use the output of the speed
CHOP to drive an animation, in
this case the size of a
rectangle.

16
00:01:26,433 –> 00:01:34,000
In the rectangle TOP, I multiply
the speed CHOP value by 20, so
we can better see its effect.

17
00:01:34,000 –> 00:01:39,333
When I click the button, its
state changes from 0 to 1.

18
00:01:39,333 –> 00:01:43,767
I’ve set the speed CHOP’s limit
type to “Clamp”.

19
00:01:43,767 –> 00:01:49,800
This forces the speed CHOP to
hold at a maximum value, in this
case 10.

20
00:01:49,800 –> 00:01:56,967
If the button state is 0, the
“Reset” parameter of the speed
CHOP will be pulsed.

21
00:01:56,967 –> 00:01:59,700
This resets the speed CHOP.

22
00:01:59,700 –> 00:02:01,200

23
00:02:01,200 –> 00:02:09,300
This user interaction can take
place at any point on the Touch
Designer master timeline.

24
00:02:09,300 –> 00:02:11,300

Nov 12 2014

Ramp TOP tutorial.

The Ramp TOP. TouchDesigner 088. 2014.
The Ramp TOP is one of the most widely used Texture Operators.

1
00:00:00,900 –> 00:00:03,267
Let’s examine the ramp TOP.

2
00:00:03,267 –> 00:00:09,333
I’ve set up 5 example networks,
and let’s take a look at the
first one.

3
00:00:09,333 –> 00:00:18,667
The ramp TOP is a powerful
operator that creates gradients,
or ramps, of four distinct types
or styles.

4
00:00:18,667 –> 00:00:22,633
Here’s a ramp TOP with default
settings.

5
00:00:22,633 –> 00:00:28,800
The ramp is comprised of an
arbitrary series of tabs, or
notches.

6
00:00:28,800 –> 00:00:35,433
Each tab has a position and an
RGBA value.

7
00:00:35,433 –> 00:00:41,267
By left clicking in the value
field, I can add new tabs.

8
00:00:41,267 –> 00:00:48,933
Then I adjust the hue,
saturation, and value sliders to
create the colors I desire.

9
00:00:48,933 –> 00:00:58,033
The four types of gradient
shapes are vertical, horizontal,
radial, and circular.

10
00:00:58,033 –> 00:01:05,767
Now let’s examine another ramp
TOP parameter, the “Interpolate
Notches” setting.

11
00:01:05,767 –> 00:01:15,633
Our first example used a linear
interpolation method, which
creates a smooth blend across
the ramp tabs, or keys.

12
00:01:15,633 –> 00:01:25,200
In this example, we use the step
method, which creates discrete
hard-edged steps from value to
value.

13
00:01:25,200 –> 00:01:34,367
The ramp TOP uses a specially
formatted table DAT to supply
it’s ramp key settings.

14
00:01:34,367 –> 00:01:43,833
By changing values in the cells,
we can directly manipulate the
ramp TOP without using the
parameters panel.

15
00:01:43,833 –> 00:01:55,933
I’ll adjust the positional steps
between my 4 key entries to
specific positions, creating
exactly 4 subdivisions of 25%
each.

16
00:01:55,933 –> 00:01:58,433

17
00:01:58,433 –> 00:02:04,333
Next, I’ll adjust the RGBA
values to very specific numbers.

18
00:02:04,333 –> 00:02:10,067
This method allows us to create
extremely accurate color fields.

19
00:02:10,067 –> 00:02:14,233

20
00:02:14,233 –> 00:02:22,033
This network is designed to help
us visualize the “Extend”
parameters of the ramp TOP.

21
00:02:22,033 –> 00:02:27,900
We’re using a slider to animate
the “Phase” parameter of the
ramp TOP.

22
00:02:27,900 –> 00:02:35,367
As I move the slider from left
to right, watch the colour field
in the parameters panel.

23
00:02:35,367 –> 00:02:42,600
You’ll see we are offsetting the
reference points that are the
beginning and end of the ramp.

24
00:02:42,600 –> 00:02:54,367
The gradient created by the ramp
TOP has a beginning and an end,
but we can move the ramp in 2D
space past its natural edges.

25
00:02:54,367 –> 00:03:01,733
Therefore, we need to decide how
we should fill the extra space
in the 2D rendering.

26
00:03:01,733 –> 00:03:05,400
This is the function of the
“Extend” parameter.

27
00:03:05,400 –> 00:03:08,367
I’ll set the extend to “Hold”.

28
00:03:08,367 –> 00:03:14,267
This condition will cause the
ramp TOP to repeat the first and
last values forever.

29
00:03:14,267 –> 00:03:26,967
When I set the extend to “Zero”,
the ramp TOP renders any value
out of the initial ramp value
range as a zero RGBA value.

30
00:03:26,967 –> 00:03:31,600
The other two extend options are
“Mirror” and “Repeat”,

31
00:03:31,600 –> 00:03:43,100
and depending on your
application, using and mastering
the extend parameters can help
you create amazing effects with
the ramp TOP.

32
00:03:43,100 –> 00:03:44,200

33
00:03:44,200 –> 00:03:51,433
This example Illustrates a
simple way to visualize time
with a clock style graphic.

34
00:03:51,433 –> 00:04:04,067
The network uses a clock CHOP to
generate an increasing value
each millisecond, and ends with
a ramp TOP of radial type.

35
00:04:04,067 –> 00:04:11,700
The “Interpolate Notches”
parameter is set to step, and
we use 3 key values.

36
00:04:11,700 –> 00:04:20,900
The position of the middle key
value moves from 1 to 0 over the
course of each second.

37
00:04:20,900 –> 00:04:33,533
I’ve set the “Phase” parameter
to .25, because the ramp TOP
defaults to placing the start of
the radial ramp at the 3 o’clock
position.

38
00:04:33,533 –> 00:04:43,733
The clock CHOP generates the
milliseconds, then we use a math
CHOP to re-range, or normalize
the values.

39
00:04:43,733 –> 00:04:48,467
Next, we use a chop execute DAT.

40
00:04:48,467 –> 00:04:57,567
This is a DAT operator whose
contents can be set to run when
the state of a specified CHOP
changes.

41
00:04:57,567 –> 00:05:02,800
In this case, a single line
Python snippet will run.

42
00:05:02,800 –> 00:05:08,667
I’ve commented the Python script
to show exactly how the code
works.

43
00:05:08,667 –> 00:05:20,600
We extract the normalized value
from the math CHOP, and place it
in the appropriate cell of the
ramp’s table DAT.

44
00:05:20,600 –> 00:05:29,233
As with many techniques in Touch
Designer, there are several
possible ways to achieve the
same results.

45
00:05:29,233 –> 00:05:31,800

46
00:05:31,800 –> 00:05:44,867
In this example, we will create
a rudimentary audio visualizer
using a similar technique as our
last example.

47
00:05:44,867 –> 00:05:46,867
We start with an audio file in
CHOP, then we normalize the
value range with a math CHOP,
and then apply the value to the
middle key of a 3 step ramp TOP.

Posted In
Tagged