gate

Pass the input out a specific outlet

Description

gate will pass a given message only through a specified outlet.

Arguments

Name Type Opt Description
number-of-outlets int opt Specifies the number of outlets. If there is no argument, there is only one outlet.
initial-state int opt An optional second argument can be used to specify which outlet is initially open. The default is 0 (i.e., none).

Messages

bang In left inlet: Reports the current open outlet, or 0 if closed, out the left outlet. This message is designed to be used in conjunction with the grab object.
int outlet-number [int]
In left inlet: The number specifies an open outlet through which to pass all messages received in the right inlet. A number in the left inlet does not trigger any output itself.
float outlet-number [float]
In left inlet: Converted to int.

Information for box attributes common to all objects

Output

anything: Messages received in the right inlet are passed out the outlet specified by the number in the left inlet. If the number in the left inlet is 0, or if no outlet number has been received yet, all messages are ignored. If the number in the left inlet is less than 0, messages are sent out the leftmost outlet. If it is greater than the number of existing outlets, messages are sent out the rightmost outlet.

Examples

Message is passed out the specified outlet.... This one closes the door behind itself

See Also

Name Description
ggate Pass the input out one of two outlets
gswitch Receive the input in one of two inlets
route Selectively pass the output out a specific outlet
router matrixctrl-compatible Max message router
send Send messages without patch cords
switch Output messages from a specific inlet
Max Basic Tutorial 9: Mouse Drawing Max Basic Tutorial 9: Mouse Drawing
Max Basic Tutorial 21: Controlling Data Flow Max Basic Tutorial 21: Controlling Data Flow