Speed CHOP

From TouchDesigner 099 Wiki

Summary

The Speed CHOP converts speed (units per second) to distance (units) over a time range. More generally, you give it a rate (the CHOP input) and it outputs a cumulative value. For example, the Speed CHOP converts rotation rate (rotations per second) into the number of rotation turns. ( Math-heads recognize this as an 'integral', which calculates the area under a curve. The curve is the incoming channel values over a time range, the output is the area.)

If you send a Constant CHOP channel that has value 1 into the Speed CHOP, then the Speed CHOP output will increase by 1 every second. If you feed it -2, it will decrease by 2 every second, and if you feed it 0, the output will not change. Use a Trail CHOP to see its results. You can reset the Speed CHOP to 0 by pressing the Reset parameter, or by sending in a channel (whose value is greater than 0) into the second input.

The first input contains the channels to be 'integrated'. By default, the Speed CHOP is time-sliced, so it keeps adding/subtracting to the output each frame it cooks. If you turn off its Time Slice parameter and send it a CHOP with a fixed frame range (like a default Noise CHOP), you can see the cumulative value starting from 0.

The output is calculated by adding the input's channel values for every sample, divided by the samples per second of the Speed CHOP (typically 60), starting with the sample at the Start index. Negative input values reduce the output, positive values increase it. The cumulative values are put in the output channels.

When the CHOP is reset, its output can be set to any value via the Reset Value parameter.

When the second input is used to reset the output, where the second input is greater than 0, the area is reset and held to the reset value. For example, a Wave CHOP (which is negative half the time) when passed into the second input causes the output to be reset for half a cycle.

See also: Lookup CHOP, Timer CHOP, Count CHOP, Event CHOP

PythonIcon.png speedCHOP_Class

Parameters - Speed Page

Order - Determines the order of the integral to use. If the input is a velocity, a First Order integral will return the position. If the input is an acceleration, a Second Order integral will return the position, and a First Order integral will return the velocity.

  • First Constant - Constant to add to the entire result after integrating once.
  • Second Constant - Constant to add to the entire result after integrating twice.
  • Third Constant - Constant to add to the entire result after integrating three times.

Type - The type of limit function to use:

  • Off - Do not limit the values.
  • Clamp - Simply cut the channel value off if it is out of the Maximum/Minimum range, and replace it with the Maximum or Minimum limit value.
  • Loop - Continue the channel at the other end of the interval.
  • Zigzag - Mirror the values back inside the interval.

Minimum - The minimum value the output channel can have.

Maximum - The maximum value the output channel can have.

Reset - This button resets the channel(s) to the Reset Value.

Reset Condition - This menu determines how the Reset input triggers a reset of the channel(s).

  • Off to On - channels are reset when the Reset input goes off to on.
  • While On - channels are reset when the Reset input goes on. The channel will hold the reset value until the input turns off.
  • On to Off - channels are reset when the Reset input goes on to off.
  • While Off - channels are reset when the Reset input goes off. The channel will hold the reset value until the input turns on.

Reset Value - The channel(s) is set to this value when reset.

Example Uses

The Speed CHOP is a very commonly used operator. Usually it is used as a First Order integral to convert a velocity value into position.

Consider an incoming channel from a slider panel. The slider value at the minimum position is 0 and the maximum position is 1. As the slider increases in value, the ramp it generates starts increasing at a faster rate. When the slider is set back to 0, the output value plateaus and does not change until the input channel is above or below zero. In other words, a velocity of 0 means there is no change in position.

Standard Options and Local Variables

$C, $NC