Math
channel node
Perform a variety of arithmetic operations on and between channels.
This CHOP allows you to perform a variety of arithmetic operations on and between channels. Channels of a CHOP can be combined, and several CHOPs can be combined.
Unary Operations
Unary operations are performed on individual channels. Unary operations are:
|
Off |
Don’t do anything to the channel. |
|
Negate |
Take the negative value of each sample of the channel. |
|
Positive |
Make negative values of the channel positive (absolute). |
|
Root |
Take the square root of all values in the channel. |
|
Square |
Square all the values in the channel. |
|
Inverse |
Take the inverse (1/x) of all values in the channel. |
Combine Channels
Operations between channels can be done within an input or between inputs. The operations are done on a sample by sample basis:
|
Off |
Don’t combine the channels. |
|
Add |
Sum all the channels. |
|
Subtract |
Subtract all the channels from the first. |
|
Multiply |
Take the product of all the channels. |
|
Divide |
Divide the first channel by all the rest. |
|
Average |
Take the average of all the channels. |
|
Maximum |
Take the maximum value of all the channels. |
|
Minimum |
Take the minimum value of all the channels. |
|
Length |
Assume the channels are a vector and compute its length. |
Parameters
OP
|
Channel Pre OP |
A menu of unary operations that are performed on single channels as they come in to the Math CHOP. |
|
Combine Channels |
A menu of operations that is performed between the channels of a single input CHOP, for each input. |
|
Combine CHOPs |
A menu of operations that is performed between the input CHOPs, combining several CHOPs into one. |
|
Channel Post OP |
A menu of more unary operations that is performed on the channels resulting from the above operations. |
|
Match By |
Match channels between inputs by name or number. When matching by name, the number of output channels is the number of channels from the first input. For each channel of the first input, the channel of the same name is taken from the other inputs. If a channel name cannot be found, then it is omitted. Only the channels whose names occur in the first input will be used to generate the output channels. Channels whose names do not occur in the first input will not affect the output channels. When matching by number, the number of output channels is the maximum number of channels out of all the inputs. Then for each input, the original sequence of channels is repeated to match the number of output channels. |
|
Align |
The alignment to use when aligning channels from different inputs. See the help for the Merge CHOP. |
Mult-Add
|
Pre-Add |
First, add value to each new channel. |
|
Multiply |
Then multiply by this value. |
|
Post-Add |
Then add this value. |
Range
|
From/To Range |
Another way to multiply/add. Converts from one low-high range to another range. |
Common
Some of these parameters may not be avaiable on all CHOP nodes.
|
Scope |
To determine which channels get affected, some CHOPs have a scope string. Patterns can be used in the scope, for example The following are examples of possible channel name matching options:
|
||||||||||||||||||
|
Sample Rate Match |
The Sample Rate Match Options handle cases where multiple input CHOPs’ sample rates are different.
|
||||||||||||||||||
|
Units |
The units for which time parameters are specified. For example, you can specify the amount of time a lag should last for in seconds (default), frames (at the Houdini FPS), or samples (in the CHOP’s sample rate). Note
When you change the Units parameter, it does not convert the existing parameters to the new units. |
||||||||||||||||||
|
Time Slice |
Time Slicing is a feature which boosts cooking performance and reduces memory usage. Traditionally, CHOPs calculate the channel over its entire frame range. If the channel does need to be evaluated every frame, then cooking the entire range of the channel is unnecessary. It is more efficient to calculate only the fraction of the channel that is needed. This fraction is known as a Time Slice. |
||||||||||||||||||
|
Unload |
Causes the memory consumed by a CHOP to be released after it is cooked and the data passed to the next CHOP. |
||||||||||||||||||
|
Export Prefix |
The Export prefix is prepended to CHOP channel names to determine where to export to. For example, if the CHOP channel was named Note
You can leave the Export Prefix blank, but then your CHOP track names need to be absolute paths, such as |
||||||||||||||||||
|
Graph Color |
Every CHOP has this option. Each CHOP gets a default color assigned for display in the Graph port, but you can override the color in the Common page under Graph Color. There are 36 RGB color combinations in the Palette. |
||||||||||||||||||
|
Graph Color Step |
When the graph displays the animation curves and a CHOP has two or more channels, this defines the difference in color from one channel to the next, giving a rainbow spectrum of colors. |
Local variables
|
I |
The current index. |
|
V |
The current value. |
|
C |
Current channel index (0 to NC-1). |
|
NC |
Total number of channels. |
Example files
MathBasic
$HFS/houdini/help/examples/nodes/chop/math/MathBasic.cmd
These examples demonstrate the ability of the Math CHOP to combine multiple channels together.
The first example shows two different methods of controlling the amplitude of a sine wave. The second example shows three different channels combined into one.