router

matrixctrl-compatible Max message router

Description

router is a Max object which lets you patch multiple sources of Max data to multiple destinations dynamically (sort of like a series of nested switches and gates). It is designed to work best with the matrixctrl user interface object, and uses a syntax equivalent to the MSP matrix~ object.

Arguments

Name Type Opt Description
number-of-inlets-and-outlets int Obligatory. Two numbers are used to specify the number of inlets and outlets for the router object.

Messages

bang A bang received in any but the leftmost inlet will be sent to all outlets that are connected to that inlet.
int input [int]
An integer received in any but the leftmost inlet will be sent to all outlets that are connected to that inlet.
float input [float]
floating-point number received in any but the leftmost inlet will be sent to all outlets that are connected to that inlet.
list inlet-number outlet-number connection-state (0 or 1) [list]
A list of three numbers received in the left inlet is interpreted as specifying an inlet number, an outlet number, and a 0 or 1 specifying the state of a connection. A list in this form changes the inlet and outlet connections of the router object.

A list received in any other inlet will be sent to all outlets that are connected to that inlet.
anything input [list]
Any Max message received in any but the leftmost inlet will be sent to all outlets that are connected to that inlet.
disconnect inlet-and-outlet-numbers [list]
The word disconnect, followed by two numbers that specify inlet and outlet numbers, disconnects an inlet from an outlet.
dump arguments [list]
Sends the state of the object's switching matrix out the right outlet as a series of single line lists in the form inlet-number outlet-number state.
clear arguments [list]
Clears the state of the switching matrix, All inlets are disconnected from all outlets.
connect inlet-and-outlet-numbers [list]
The word connect, followed by two numbers that specify inlet and outlet numbers, connects an inlet to an outlet. Multiple inlets can be connected to multiple outlets, and vice versa.
patch inlet-and-outlet-numbers [list]
The word patch, followed by two numbers that specify inlet and outlet numbers, connects an inlet to an outlet and disconnects all other inlets that are currently connected to that outlet
print arguments [list]
Prints the state of the switching matrix in the Max window.

Information for box attributes common to all objects

Output

anything: Any message received in any but the leftmost inlet will be routed to the outlet to which the inlet is currently connected. The router objects passes messages only; it will not pass signals or Jitter matrices.
list: Out right outlet: a series of single-line lists (one for each inlet) in the form inlet-number outlet-number state is sent out the right outlet of the router object in response to a dump message.

Examples

See Also

Name Description
matrixctrl Matrix switch control
Max Basic Tutorial 21: Controlling Data Flow Max Basic Tutorial 21: Controlling Data Flow
Tutorial 13: Scissors and Glue Tutorial 13: Scissors and Glue
Tutorial 26: MIDI Control of Video Tutorial 26: MIDI Control of Video