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

match Reference

Watch for a message match, then output the message

match

Description

Watches an incoming stream of ints, floats, symbols, lists, or messages, and outputs the stream after it has met the specification of its arguments.

Examples

Numbers must be the same, and in the same order

Arguments

match-list [list]

The arguments specify numbers to look for, in the proper order. The word nn can be used as a wild card that will match any number.

Attributes

Common Box Attributes

Messages

int

Arguments

input [int]
If the numbers match the arguments, in the proper order, they are sent out as a list.

float

Arguments

input [float]
If the numbers match the arguments, in the proper order, they are sent out as a list.

list

Arguments

input [list]
If the input-list matches the arguments, in the proper order, they are sent out as a list.

anything

Arguments

input [list]
Performs the same as list.

clear

Causes match to forget all numbers it has received up to that time.

set

Arguments

match-list [list]
The word set, followed by a list of numbers, specifies a new series of numbers match will look for.

Output

list

The numbers received in the inlet are compared with the arguments. If the numbers are the same, and in the same order, they are sent out the outlet as a list.

See Also

Name Description
iter
join
pack
select