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

pak

Output a combined list when any element changes

Description

The pak object (pronounced "pock") offers much of the functionality of its big brother, pack, but works like a combination of the pack and bondo objects--output of the entire stored list occurs whenever input is received in any inlet.

Arguments

Name Type Opt Description
inlet-initialization int float symbol opt The number of inlets is determined by the number of arguments. Each argument sets an initial type and value for an item in the list stored by the pak object. If a number argument contains a decimal point, that item will be stored as a float. If the argument is a symbol, that item will be stored as a symbol. If there is no argument, there will be two inlets, and the two list items will be set to (int) 0 initially.

Messages

bang In left inlet: Causes pak to send out a list of the items currently stored.
int input [int]
The number is stored in pak as an item in a list, with its position in the list corresponding to the inlet in which it was received, and the entire list is sent out the outlet. If the inlet in which the number is received has been initialized with a float or symbol argument, the incoming number will be converted to a float or a blank symbol, respectively.
float input [float]
The number is stored in pak as an item in a list, with its position in the list corresponding to the inlet in which it was received, and the entire list is sent out the outlet. If the inlet in which the number is received has been initialized with an int or symbol argument, the incoming number will be converted to an int or a (blank) symbol, respectively. If no argument has been typed in, float is converted to int.
list input [list]
Any multi-item message, regardless of whether it begins with a number, is treated as a list by pak. The first item in the incoming list is stored in pak in the location that corresponds to the inlet in which it was received, and each subsequent item is stored as if it had arrived in subsequent inlets (limited by the number of inlets available). The entire stored list to be sent out the outlet.
anything input [list]
If the inlet in which the symbol is received has been initialized with a symbol argument, the symbol is stored in the corresponding location in pak, and the entire list is sent out the outlet. If the inlet has not been initialized with a symbol argument, the symbol is converted to 0 before being stored. A symbol in the left inlet triggers output of the pak object's contents.
set message [list]
The word set, followed by any message, allows that message to be received by pak without triggering any output. A set message may be received in any inlet.

Information for box attributes common to all objects

Output

list: The length of the list is determined by the number of arguments. When input is received in any inlet, the stored list is sent out the outlet.

Examples

See Also

Name Description
bondo Synchronize a group of messages
buddy Synchronize arriving data, output them together
match Look for a series of arguments, output it as a list whenever an input matches
swap Reverse the sequential order of two integers
thresh Combine numbers into a list when received close together
unpack Break a list into individual messages
zl Multi-purpose list processing
Tutorial 3: Math Operations on a Matrix Tutorial 3: Math Operations on a Matrix