CHOPs, short for CHannel OPerators, are a powerful technology which enables the processing of motion data, audio, on-screen controls, MIDI data, and controls from input devices. A CHOP contains one or more motion curves or "channels". A CHOP modifies the channels, 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".
See the full set of CHOP Operators.
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 puppeteering provides you with a wide range of animation techniques. In keeping with the TouchDesigner procedural paradigm, channel operators combine and refine the motion 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.
CHOPs Create and Process Channels
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 CHOP
A CHOP contains a set of channels, plus control parameters, a sample rate, some on/off flags, and a start/end interval.
The channels of a CHOP can represent motion, MIDI, audio, color maps, rolloff curves or lookup tables. Any data that can be represented in numbers can be represent in CHOP channels.
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 index, starting from 0, corresponds to some frame number (based on frames per second), and a moment in time (seconds).
The sample rate 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, 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.
There are local variables that are common to many CHOPs. 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 Outputs
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 Channels
- 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 Frame
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.
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 index always starts at 0. Its $I is 0 at its first sample.
NOTE: Set the "frames per second" of the timeline for the project via the "fps" command, and DO IT AT THE START OF A PROJECT, lest you get tripped up.
Channel Index and Value
- The horizontal axis is called the i-axis or the index-axis.
- The vertical axis is called the v-axis or the value-axis.
- An 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 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.
- 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.