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

route Reference

Select outlet based on input matching

route

Description

Tries to match a message's first argument to the route object's own arguments. The rightmost outlet passes any message that matched no other choice, so you may gang route objects to get more choices

Examples

Arguments assign names or numbers to the outlets, and route the input to the correct outlet

Arguments

selectors [anything]

Optional

Arguments can be a mix of ints, floats, or symbols. The number of arguments determines the number of outlets, in addition to the rightmost outlet. Each argument assigns a name or a number to an outlet. If there is no argument, there is one other outlet, which is assigned the number 0.

Attributes

Common Box Attributes

Messages

bang

Performs the same function as anything.

int

Arguments

input [int]
Performs the same function as anything.

float

Arguments

input [float]
Performs the same function as anything.

list

Arguments

input [list]
Performs the same function as anything.

anything

Arguments

input [list]
If the first item of the message is the same as one of the arguments of route, the rest of the message is sent out the outlet that corresponds to that argument. If the first item does not match any of the arguments, the entire message is passed out the rightmost outlet.

Output

anything

The first item of any message received in the inlet is compared with the arguments. If it matches one of the arguments, the rest of the message is sent out the specified outlet. Otherwise, the entire message is passed out the rightmost outlet.

bang

If the first item of a message matches one of the arguments, but the message has no additional items, bang is sent out the specified outlet.

See Also

Name Description
MC MC
bucket
forward
gate
join
pack
receive
routepass
select
send
sprintf
zl
Max Basic Tutorial 18: Data Collections Max Basic Tutorial 18: Data Collections