select

Select certain inputs, pass the rest on

Description

select will selectively output a bang in response to any input which matches its arguments and will output non-matching messages out its right-most outlet.

Arguments

Name Type Opt Description
outlet-and-message-initialization anything opt The 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. If there is no argument, there is only one other outlet, which is assigned the integer number 0.
inlet-and-message-initialization int If there is a single int argument (or if there are no arguments) a second inlet is created on the right. Numbers received in that inlet are stored in place of the argument. If there is more than one argument, or if the only argument is not an int, the right inlet is not created.

Messages

int input [int]
Performs the same function as anything.
  (inlet1) match-value [int]
In right inlet: Replaces the value of the argument. The right inlet exists only if there is a single int argument.
float input [float]
Performs the same function as anything.
anything input [list]
All input will be selectively output either as a bang from one of its corresponding oulets if it matches the object argument(s) or as it is out the object's right-most outlet.

Information for box attributes common to all objects

Output

anything: If the number or symbol received in the left inlet does not match any of the arguments, it is passed out the rightmost outlet.
bang: If the number or symbol received in the left inlet is the same as one of the arguments, a bang is sent out the outlet that corresponds to that argument.

Examples

Arguments assign names or numbers to the outlets and a bang is sent when the input matches them

See Also

Name Description
if Conditional statement in if/then/else form
match Look for a series of arguments, output it as a list whenever an input matches
route Selectively pass the output out a specific outlet
== Compare two numbers, output 1 if they are equal