CHOPs, short for CHannel OPerators, are a powerful technology which enables the processing of motion, numeric data, audio, MIDI data, and data streamed from input devices. A CHOP contains one or more motion curves or "channels". A CHOP modifies the Channel, and then passes the channels on to the next CHOP in the network. CHOPs are then connected to object motion or any other animated part of TouchDesigner via "exporting" and "channel references".
CHOPs provide a unique way of creating and editing motion and audio. The combination of procedural editing of motion, keyframe animation, motion capture and live controls provides you with a wide range of animation techniques. In keeping with the TouchDesigner procedural paradigm, channel operators combine and refine the data without destroying the original data. CHOPs were designed to reduce the tedium of motion editing and to help build and manage more complex motion. CHOPs enable creators to think about motion at a more creative level and to experiment with motion more than any other animation technology.
Sweet 16 CHOPsedit
Click the video above to watch an overview of all Sweet 16 CHOPs. Watch individual CHOP videos by clicking on the appropriate CHOP's video icon below. The following 16 CHOPs are commonly used, we recommend familiarizing yourself with them.
|Constant||Create new channels.||Pattern|
|LFO||Low Frequency Oscillator.||Audio Oscillator|
|Noise||Create semi-random patterns.|
|Select||Grab a channel from any other CHOP.||Switch, Cross|
|Merge||Merge channels from two or more CHOPs.||Shuffle|
|Math||Add, multiply or scale channels.||Logic, Script|
|Lag||Smooth and delay a channel.||Filter|
|Speed||Use speed to calculate distance.||Count, Slope|
|Lookup||Use one channel to get values from another CHOP.||Keyframe|
|Trail||Watch a time-history of CHOP channels.||Perform|
|SOP to||Record a time-history of channels.||DAT to, TOP to|
|Limit||Restrict channels to a range or certain step values.||Analyze|
|Audio Device In||Get audio from input device.||Audio File In|
|OSC In||Open Sound Control, MIDI.||MIDI In Map|
|Panel||Get state, u, v etc values from any panel gadget.||Info|
|Timer||Run timers, loops, delays and trigger events.||Beat|
All CHOPs are documented in the Category:CHOPs.
CHOPs Create and Process Channelsedit
CHOPs are procedural networks, where "procedural" means the operators are wired together so the output of one CHOP flows into the input of one or more other CHOPs, and the data flows automatically every time the display is updated (by default, 60 times per second).
Some CHOPs, generator CHOPs, create CHOP channels from scratch. Some examples are the Constant CHOP, the Wave CHOP, and the Timing CHOP. CHOPs can also take data from
- on-screen sliders, buttons, menus, XY-controllers, XYZ values from clicking in 3D viewers.
- hardware devices including data via MIDI and OSC protocols.
- other processes/applications feeding TouchDesigner through pipes.
CHOPs process channel data and connect the results to any other part of TouchDesigner.
Parts of a CHOPedit
The channels of a CHOP can represent motion, MIDI, audio, color maps, rolloff curves or lookup tables. Any data that can be represented as a sequence of numbers can be represent in CHOP channels. The sequence of numbers are called samples.
Like all Operators, CHOPs have Parameters used to define the data, plus the data channels, which are input/output from the CHOP as its data stream. The parameters are usually constant-valued, but can be time-dependent expressions.
CHOPs' parameters can be expressed in different CHOP units: samples (indexes), frames or seconds. These units are selected by the user in a menu to the right of such parameters. Each sample index, starting from 0, corresponds to some frame number (based on frames per second), and a moment in time (seconds).
The sample rate (samples per second) is used if the CHOP contains time-dependent motion or audio data. Audio has a high sample rate when compared to animated motion.
Each CHOP has flags:
- The Display flag marks the CHOP to be displayed in a CHOP Viewer.
- The Export flag causes the CHOP channel exports to toggle on and off.
- The Lock flag causes the CHOP to be locked and then can be hand-edited.
- The Bypass flag is a convenient way for a CHOP's effect to be disabled.
CHOPs can have any start/end indexes but all channels in a single CHOP share the same start-end interval. The interval goes from a start index to an end index and is not restricted to the length of any animation or timeline.
Each CHOP also has a comment field to add a note to a CHOP to explain what it is doing in the network. An info pop-up can be opened by middle-clicking on the CHOP, this lists channel names and values, sample rate and intervals.
Extend Conditions determine what numbers you get when you ask for a channel value that is before the CHOP's start time or after its end time. The CHOP may hold its last value, it may cycle, repeat, or be held at a default value. You can see a CHOP's extend conditions in the info pop-up (middle-mouse click on the CHOP), or by looking at a CHOP in the channel viewer outside its start-end range. You will see a Wave CHOP cycles and a Keyframe CHOP holds. You can change the Extend Conditions with an Extend CHOP.
See also Anatomy of a CHOP.
Local CHOP Membersedit
There are local Python members (variables) that are common to several CHOPs.
In Tscript they are:
- $NC The total number of channels in the CHOP.
- $C The channel index that is currently being processed.
- $I The index that is currently being processed.
- $V The current value at the index currently being processed.
Inputs and Outputsedit
Each CHOP receives channels at its inputs. When the CHOP cooks, the channels of the inputs are combined. The CHOP outputs the resulting channels to other CHOPs.
CHOPs output their data channels as arrays of numbers, not keyframed, interpolated segments. Some CHOPs (Keyframe CHOP and Spline CHOP) retain interpolated segments internally, but all CHOPs always output their data as raw samples. If the CHOP's inputs are not changing and the control parameters are not time-dependent, the CHOP will be non-time-dependent and it will not cook every time the animation frame on the timeline advances.
Some CHOPs output or use CHOP attributes, such as channels grouped as quaternion rotation channels.
Importing/Exporting CHOP Channelsedit
- Main article: Export
Parameters of any node are able to get values from CHOP channels with expressions like the following:
chop(CHOPchannelpath) chopi(CHOPchannelpath, index)
However, exporting is preferred where possible. It is faster and involves less typing.
CHOP data channels are exported to Components, SOPs, etc. to drive their parameters. CHOPs can be exported to any TouchDesigner operator's parameter. Each CHOP has an Export flag (and an Export Prefix, infrequently used), causing the CHOP to connect its channels to Components, SOPs, TOPs and so on. The Export flag and Export Prefix can also use automatic matching of channels names to find export destinations. For example, a CHOP "tx" channel could map to an Geometry Component's tx parameter. When a CHOP exports to an object, SOP or TOP, the parameters exported to are said to be overridden.
Difference Between a Sample and a Frameedit
A frame always refers to the timeline, which is expressed in frames or seconds, and frames & seconds are tied via a certain number of "frames per second" or FPS. The default FPS for TouchDesigner is 60, and with FPS of 60, there will always be 60 frames per second. A CHOP range can start at any frame number (or second), and end at any later frame number. A frame will always correspond to a certain time expressed in seconds. Precisely, seconds is (frame-1)/FPS.
The sample index may have no relation to time or frame, as when a CHOP is used as lookup table. But when "index" is tied to time, the CHOP's samples per second (sample rate), determines how many samples per second there are, and even how many samples per frame. Some CHOPs default to 60 samples per second, which is 1 sample per frame. But CHOPs can be created or resampled to any sample rate, so a CHOP's sample rate of 240 samples per second gives 4 samples per frame, and audio at 24,000 samples per second is 400 samples per frame.
Even if a CHOP is shifted in time to start at a frame number like 301 (10 seconds), its sample index always starts at 0. Its
op('wave1').sampleIndex is 0 at its first sample.
NOTE: Set the "frames per second" of the timeline for the project via the bottom of the timeline, the (to be determined) method in python, or the
fps command in Tscript, and it is better to DO IT AT THE START OF A PROJECT, lest you get tripped up. Note each component can have its own timeline its own sample rate. See Timeline.
Sample Index and Valueedit
- The horizontal axis is called the i-axis or the sample index-axis.
- The vertical axis is called the v-axis or the value-axis.
- A sample index is a point along the i-axis,denoted by i.
- A value is a point along the v-axis, denoted by v.
- A sample is an index-value pair (i,v). i.e. the value of a channel at a certain sample index.
- A sample is made of a sample index and a sample value.
- An interval is an index range, which goes from a start index to an end index.
- A value range goes from a start value to an end value.
- The index duration is the end index minus the start index + 1.
- CHOP data channels are arrays of raw samples, in 32-bit floating point format, all computations are done at 64 bits, and parameters are stored as 64 bits.
- Channels in a CHOP may be control (parameter) channels or data channels. CHOPs manipulate the data channels.
- CHOPs can be evaluated at integer and non-integer indexes.
- Frame is used when the index corresponds to time.
- When speaking of animation frames, you can refer to start frame, end frame and frame range.
Note: a "Channel Index" is the channel number of a CHOP, 0 being the first channel.
- channel data, used for animation, logic, controls
- concept of sample rate, frames, seconds
- Import: File In CHOP, Audio Device In CHOP, Pipe In CHOP, OSC In CHOP, MIDI In CHOP, Touch In CHOP
- Export: right-click to save channels, Audio Device Out CHOP, Pipe Out CHOP, Touch Out CHOP