TYPE: CHOP
TITLE: Logic CHOP

This CHOP converts channels of all its input CHOPs into binary channels
and combines them using a variety of logic operations. 0 is off, 1 is on.

Once converted, Channel Pre OP is a unary operation on each input sample:
    Invert        - Turns 0 to 1, and 1 to 0.
    Toggle        - Causes each 0 to 1 transition of the input channel to
                    switch the current state between 0 and 1.
    Radio Button  - Only one channel per input can be on at once. If another
                    channel turns on, the previously "on" channel is turned off.

Combine Channels takes the first input and combines its channels, then
the second input and combines its channels, etc..

Combine CHOPs combines the first channel of each CHOP, the second channel of
each CHOP, etc.. Channels between inputs can be combined by number or name.

The combining operations are:
~c(
    And                On if all inputs are on, otherwise off.
    Or                 On if at least one input is on, otherwise off.
    Exclusive Or       On if one input on, but not more than one.
    Not And            Off if all inputs are on, otherwise on.
    Not Or             Off if at least one input is on, otherwise on.
    Equivalence        On if inputs are equal (all on or off), otherwise off.
    First Channel On   Returns the index of the channel that was the first
                       on, or -1 if no channels are on.
    Last Channel On    Returns the index of the channel that was the last
                       on, or -1 if no channels are on.
~c)

Logic has two ways of cooking, set with Cook To Current Frame. When off,
each cook of the Logic CHOP cooks the whole interval. When on, Logic only
updates the channels between the current time and the last cook time. 

This CHOP may be time sliced by enabling the Time Slice flag in the Common page.

Parameters:
Logic
    Convert Input    - The method to convert inputs to binary on/off.
	Off When Zero         - zero->0, non-zero->1
	Off When Zero Or Less - negative or zero->0, positive->1
    Channel Pre OP   - Unary operations can be applied to each channel.
    Combine Channels - Operation applied between channels within each input.
    Combine CHOPs    - Operation applied between corresponding channels of
		       multiple inputs.
    Match By         - Channels matched between inputs by number or index.
    Align            - Inputs that don't start at same frame can be aligned.

Script
    Off To On        - The script executed when an output channel switches
		       from off to on, called at the first "on" frame.
		       You can use variables like $C and $I in the command.
    While On         - The script executed when an output channel is on.
		       Called once per channel that is on, each frame.
    On To Off        - The script executed when an output channel switches
		       from on to off, called at the first "off" frame.
    While Off        - The script executed when an output channel is off.
		       Called once per channel that is off, each frame.
Local Variables
    V     - the current value
    I     - the current index
    C, NC - the current channel (0 to NC-1), the total number of channels

See also: Function, Math
