# Expression CHOP

## Summary

The Expression CHOP allows you to modify input channels by using math expressions. Up to six expressions are available. Each input channel is modified by exactly one expression, and the expressions are looped for multiple channels.

The output is the same length and set of channels as the first input, but its sample values are changed according to the expressions.

An expression is applied to each keyframe value or raw sample. There are up to six expressions. If there are more channels coming from input 0, the expressions are recycled. A repeat parameter controls how many channels to apply the first expression to before going on to the second expression.

## Parameters - Group Page

Channels Per Expr `/chanperexpr` - The number of channels that use the current expression before the next expression is selected.

Num Expressions `/numexpr` - The total number of expressions that are defined.

## Parameters - Expr Page

Expression 1-6 `/expr[0-5]` - Enter your expressions here.

## Using Expression Functions to Access Other Input CHOPs

The power of this CHOP extends when using special expression functions to access the other input CHOPs.

``` ic(input#, channel#, index)
```

The above expression function gets the value at the specified index of the specified channel of the specified input CHOP (all 0-relative).

Some available functions include:

• `ic()` - can use local variables: `\$C` (channel #), and `\$I` (index).
• `oc(chan_index, samp_index)` - gets the output CHOP's samples as they are being built. Like in calculus integration, you need a value from the previous output sample to generate the next one.
• `ics(input#)` - gets the start index of any input CHOP. Similarly for `ice() ` and `icl()`.
• `icr()` - gives the sample rate.

For more details on CHOP-related expression functions, see CHOP Expression Functions.

## Examples

subtract 1 from the values of the incoming samples:

```\$V - 1
```

square root of incoming values:

```sqrt(abs(\$V))
```

maximum of two CHOP inputs:

``` max(ic(0, \$C, \$I), ic(1, \$C, \$I))
```

## Standard Options and Local Variables

Local Variables: \$C \$NC \$I \$V