TYPE: CHOP
TITLE: Reorder CHOP

This CHOP reorders the first input CHOP's channels by numeric or alphabetic
patterns. Either a channel pattern specifies the new order, or a number
sequence specifies the new order.

If the second input, the "Order Reference" is present, the Numeric Pattern
and Character Pattern are ignored, and the first input CHOP's channels are
reordered to match as well as possible the reference CHOP's. In this case,
Method is not used.

Channel values are never affected.

All examples below assume the Remaining Position is "At Ending" and
the Remaining Order is "Same as Input".

~c(
    Input               Numeric Pattern         Result
    A B C D             3 2 1 0                 D C B A 
    C B D A             3 1                     A B C D 
    A B C D E           [1-5:2]                 A C E B D

    Input               Character Pattern       Result
    A1 A2 B1 B2         *1 *2                   A1 B1 A2 B2
    c4 c2 c3 c1         c[1-4]                  c1 c2 c3 c4

    y1 w0 x2 z3         (Base Name Sort)        w0 x2 y1 z3
    y1 w0 x2 z3         (Numeric Suffix Sort)   w0 y1 x2 z3
~c)

There are no local variables.

Parameters
    Method              - There are 4 different reordering methods, plus
                          the optional second input reference sort.
        Numeric Pattern     - The names are sorted by a numeric pattern, as
                              entered in the 'Numeric Pattern' parameter.
        Character Pattern   - The names are sorted by a character pattern, as
                              entered in the 'Character Pattern' parameter.
        Base Name Sort      - Reorder channels by their alphabetic
                              name first, then their number (ie. chan1 
                              is ordered by "chan", then by 1).
        Numeric Suffix Sort - Reorder channels by their number first,
                              then their name (ie. chan1 is ordered by
                              1, then by "chan").
    Numeric Pattern     - This reorders the channels by channel number.
                          Normally the index order is 0,1,2,3... etc..
                          The first channel is at index 0. Standard numeric
                          patterns are allowed such as "0-6:1,2" or "!*:1,3".
    Character Pattern   - This reorders the channels by channel name.
                          Standard character patterns are allowed such
                          as "ch[XYZ]" or "chan[1-15:2,5]" or "chan? ch*".

                          See Channel Name Matching Options in the manual
                          section, Standard Parameters of CHOPs.

    Remaining Position  - Channels that do not match are called "remaining"
                          and can also be ordered: they can be placed at
                          the "At Beginning" or "At Ending" (in reference
                          to the position of the matched channels), 
    Remaining Order     - The channels that did not match can have the
                          "Same as Input" order, or can be sorted
                          "AlphaNumeric"ally.

See also: Rename, Shuffle
