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

selector~ Reference

Assign one of several inputs to an outlet

selector~

Description

Use the selector~ object to choose between one of several input signals (or none). The selector~ is similar to the Max switch object but for signals, however if no input is chosen, it outputs a signal composed of zero values.

Examples

Allow only one of several signals to pass optionally turn off unneeded signal objects

Arguments

number-of-inputs [int]

Optional

Number of inputs

initially-open-inlet [int]

Optional

Specify which input is initially selected. If 0, where all signals are shut off and a zero signal is sent out.

Attributes

Common Box Attributes

Messages

int

Arguments

open-inlet [int]
Select which input to route to the outlet. If the value is 0 or negative, a zero signal is sent out. If the value is greater than the number of inputs, the right-most input is used. If a signal is connected to the left inlet, this message is ignored.

signal

In left inlet: If a signal is connected to the left inlet, selector~ operates in a mode that uses signal values to determine which of its input signals is to be passed to its outlet. If the signal coming in the left inlet is 0 or negative, the output is shut off and a zero signal is sent out. If it is 1 but less than 2, the signal coming in the first inlet to the right of the leftmost inlet is passed to the outlet. If the signal is 2 but less than 3, the signal coming into the next inlet to the right is used, and so on.

In other inlets: Any signal, to be passed through to the selector~ object's outlet depending on the value of the most recently received int or float in the left inlet, or the signal coming into the left inlet. The first signal inlet to the right of the leftmost inlet is considered input 1, the next to the right input 2, and so on.

Output

signal

The output is the signal coming in the "open" inlet, as specified by a number or signal in the left inlet. The output is a zero signal if all signal inlets are shut off.

See Also

Name Description
gate~
switch