This tutorial introduces Channel Operators (CHOPs) in TouchDesigner, explaining how they manipulate sequences of numbers called channels.
What Are CHOPs?
CHOPs (Channel Operators) are used to manipulate channels in TouchDesigner. A channel is a sequence of numbers - sometimes just a single value, but it can also represent a list of values (samples).
Understanding Channels with Examples
Constant CHOP
The simplest CHOP is the Constant CHOP, which by default holds only one sample. When you manipulate its value parameter, that single value changes. You can convert this to a DAT (using CHOP to DAT) to see the value represented as a single row in a table.
Pattern CHOP
The Pattern CHOP demonstrates how channels can hold multiple samples. By setting the length parameter to 50 samples and enabling “dots per sample” view, you can see a dot for every sample in the channel. Converting this to a DAT shows a row for every sample - each dot corresponds to a single row.
Mouse In CHOP
The Mouse In CHOP captures the position of your mouse on screen. When connected to a Trail CHOP, you can see a history of the channel values over time. The Trail CHOP displays:
- X position in the first channel
- Y position in the second channel
Setting the length to one second and enabling “dots per sample” view provides a visual history of mouse movement.
Practical Example: Countdown Timer
The tutorial demonstrates building a countdown timer display:
-
Add a Timer CHOP - This provides timing information for various operations
-
Extract Timer Info - Right-click on the Timer output and add an Info DAT to get detailed timer data in table format
-
Display with Text TOP - Add a Text TOP (texture operator) and:
- Clear the text parameter
- Drag the Info DAT into the DAT parameter
- Select row 0, column 2 to display the countdown value
-
Configure the Timer - Set the length to 5 seconds, reinitialize, and start to see the countdown from 5 to 0
Advanced: Controlling Opacity with Timer State
The tutorial extends the example by using the timer’s “done” state to control text visibility:
-
Select CHOP - Add a Select CHOP to extract just the “done” channel from the timer
-
Math CHOP - Add a Math CHOP to invert the range from 0-1 to 1-0
-
Null CHOP - End the chain with a Null CHOP for clean referencing
-
Connect to Text TOP - Drag the done channel onto the Text TOP’s Font Alpha parameter and select “CHOP reference”
Now when the timer runs, the text is visible (alpha = 1), and when the timer completes (done = 1, inverted to 0), the text fades out.
Key Concepts
- Channels are sequences of numbers (samples)
- Samples can be visualized as dots or rows in a table
- CHOPs can be chained together for complex data processing
- CHOP to DAT conversion helps visualize channel data
- CHOP references allow dynamic parameter control from channel values
- Math CHOP can invert or remap value ranges
- Select CHOP extracts specific channels from multi-channel sources
This foundation enables creative uses of channel data for animations, interactive controls, and data-driven visuals in TouchDesigner.
本教程介绍TouchDesigner中的通道操作符(CHOPs),解释它们如何操作称为通道的数字序列。
什么是CHOPs?
CHOPs(通道操作符)用于在TouchDesigner中操作通道。通道是一系列数字——有时只是单个值,但也可以表示一组值(样本)。
通过示例理解通道
Constant CHOP
最简单的CHOP是Constant CHOP,默认只保存一个样本。当你操作其value参数时,这个单一值会改变。你可以将其转换为DAT(使用CHOP to DAT)来查看以表格单行形式表示的值。
Pattern CHOP
Pattern CHOP展示了通道如何保存多个样本。将length参数设置为50个样本并启用”dots per sample”视图,你可以看到通道中每个样本对应一个点。将其转换为DAT会显示每个样本对应一行——每个点对应表格中的一行。
Mouse In CHOP
Mouse In CHOP捕获鼠标在屏幕上的位置。当连接到Trail CHOP时,你可以看到通道值随时间的历史记录。Trail CHOP显示:
- 第一个通道中的X位置
- 第二个通道中的Y位置
将长度设置为一秒并启用”dots per sample”视图,可以提供鼠标移动的可视化历史。
实践示例:倒计时器
教程演示了如何构建倒计时显示:
-
添加Timer CHOP - 为各种操作提供计时信息
-
提取计时器信息 - 右键点击Timer输出并添加Info DAT,以表格形式获取详细的计时器数据
-
使用Text TOP显示 - 添加Text TOP(纹理操作符)并:
- 清除text参数
- 将Info DAT拖入DAT参数
- 选择第0行、第2列来显示倒计时值
-
配置计时器 - 将长度设置为5秒,重新初始化并启动,即可看到从5到0的倒计时
进阶:使用计时器状态控制透明度
教程扩展了示例,使用计时器的”done”状态来控制文本可见性:
-
Select CHOP - 添加Select CHOP从计时器中仅提取”done”通道
-
Math CHOP - 添加Math CHOP将范围从0-1反转为1-0
-
Null CHOP - 以Null CHOP结束链条,便于干净地引用
-
连接到Text TOP - 将done通道拖到Text TOP的Font Alpha参数上,选择”CHOP reference”
现在当计时器运行时,文本可见(alpha = 1),当计时器完成时(done = 1,反转为0),文本淡出。
核心概念
- 通道是数字(样本)的序列
- 样本可以可视化为点或表格中的行
- CHOPs可以链接在一起进行复杂的数据处理
- CHOP to DAT转换有助于可视化通道数据
- CHOP引用允许从通道值动态控制参数
- Math CHOP可以反转或重新映射值范围
- Select CHOP从多通道源中提取特定通道
这些基础知识使你能够在TouchDesigner中创造性地使用通道数据进行动画、交互控制和数据驱动的视觉效果。