Slope CHOP

From TouchDesigner 099 Wiki

Summary

The Slope CHOP calculates the slope (or "derivative" in math-speak) of the input channels.

If the input CHOP represents position, the slope can be interpreted as speed. By default, the Slope CHOP converts position to speed.

In mathematical terms, the slope is the first derivative of the channel curve. The second and third derivatives can also be calculated. The second derivative can be interpreted as acceleration (and the third derivative could be interpreted as the rate of change in acceleration).

This CHOP can be used in conjunction with the Speed CHOP to manipulate speed or acceleration directly. You can calculate the speed or acceleration of a moving object with a Slope CHOP and manipulate it with other CHOPs. Then you can convert the new speed or acceleration curve back to position data with a Speed CHOP. You may need to adjust the starting position, since the Slope CHOP removes this information. This can be done with the use of the Constant parameters in the Speed CHOP.

The Units option causes the output to be expressed as a change in value per sample, value per frame, or value per second.

PythonIcon.png slopeCHOP_Class

Parameters

Type - The type of slope to calculate.

  • Slope - Calculates the slope of the channels.
  • Acceleration - Calculates the acceleration of the channels.
  • Acceleration of Slope - Calculates the acceleration of the slopes of the channels.

Method - The sample pairs used to calculate the slope.

  • Use Previous And Current Sample - The current sample and the sample before it are used. This is the only method applicable in realtime applications.
  • Use Current And Next Sample - The current and the next samples are used.
  • Use Previous And Next Sample - The previous and the next samples are used, producing slightly more continuous slopes than the other methods.

The slope at a sample is calculated by looking at the values of samples just before, at, and after it.

For the Slope Type, it needs two values, and the options are given to use three combinations, the default being to use the value at the sample and the one before. (before - current) is divided by the time between the samples (determined by the sampling rate). The slope placed in the channel is expressed in the Units of the CHOP.

For the type Acceleration, it uses three consecutive samples around the sample it is computing. The most accurate acceleration is obtained with Use Previous and Next Sample.

Standard Options and Local Variables

There are no local variables.