A newer version of Max is available. Click here to access the latest version of this document.

unpack

Break a list into individual messages

Description

unpack will take any given list, break up its elements, and send each item out a separate outlet.

Arguments

Name Type Opt Description
message-format/number-of-inlets int float symbol opt The number of outlets is determined by the number of arguments. The arguments can be any combination of ints, floats, and symbols. The argument specifies the output of the unpack object's outlet; the input type is forced to the outlet type (e.g., outlets that correspond to int or float arguments will always output that type of number, converting the input items as necessary). If no argument is typed in, unpack will have two int outlets. Symbol arguments allow symbols to pass through, and change numbers to the empty symbol ("").

Messages

bang Causes each stored item of a list received in the inlet to sent out the corresponding outlet.
int input [int]
The number is sent out the left outlet.
float input [float]
Converted to int, unless the left outlet was initialized with a float argument. The number is sent out the left outlet.
list input [list]
Each item in the list (up to the number of outlets) is sent out the outlet corresponding to its position in the list.
anything input [list]
Performs the same function as list.

Information for box attributes common to all objects

Output

float: If the outlet has been initialized with a float argument, then an int or a symbol from the input list will be converted to float before being sent out that outlet. (A symbol is converted to 0.0.)
int: Each item of the list received in the inlet is sent out the corresponding outlet. The first item in the list is sent out the leftmost outlet, and so on. If an outlet has been initialized with an int argument, then a float or a symbol will be converted to int before being sent out that outlet. (A symbol is converted to 0.)
symbol: A symbol in the input list will be sent out the corresponding outlet if that outlet has been initialized with a symbol argument. If the outlet has been initialized with an int or a float, the symbol will be converted to 0 or 0.0.

Examples

Each item in a list can be sent to a different place

See Also

Name Description
iter Break a list up into a series of numbers
listfunnel Index elements of a list and output them individually
pack Combine numbers and symbols into a list
spray Distribute a value to a numbered outlet
zl Multi-purpose list processing
Max Basic Tutorial 9: Mouse Drawing Max Basic Tutorial 9: Mouse Drawing