select Reference

Output bangs based on input matching

select

Description

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

Examples

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

Arguments

selectors [anything]

Optional

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 [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.

Attributes

exact [int]8.1.2

When exact is set to 1, the select object performs float comparison. When set to 0, floats are ignored.

Common Box Attributes

Messages

bang

Performs the same function as anything. The bang message matches a 'bang' symbol in the arguments.

int

Arguments

input [int]
Performs the same function as anything.

Note: If an int is listed multiple times as an argument, a bang message will be sent out the leftmost outlet only.

  (inlet1)

Arguments

value [int]
In right inlet: Replaces the value of the argument. The right inlet exists only if there is a single int argument.

float

Arguments

input [float]
Performs the same function as anything.

Note: If a float is listed multiple times as an argument, a bang message will be sent out the leftmost outlet only.

list

Arguments

input [list]
Performs the same function as anything.

anything

Arguments

input [list]
All input will be selectively output either as a bang from one of its corresponding outlets if the first element in the list matches the object argument(s) or as it is out the object's right-most outlet.

symbol

Arguments

input [symbol]
Performs the same function as anything.

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.

See Also

Name Description
MIDI MIDI
if
match
route
==