<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="selector~" module="msp" category="MSP Routing">
	<digest>
		Assign one of several inputs to an outlet
	</digest>
	<description>
		Use the <o>selector~</o> object to choose between one of several input signals (or none). The <o>selector~</o> is similar to the Max <o>switch</o> object but for signals, however if no input is chosen, it outputs a signal composed of zero values.
		<br />
		When the <o>selector~</o> object is created as <o>mcs.selector~</o> all of its signal inlets are combined into a single multichannel inlet. The behavior of <o>mcs.selector~</o> is otherwise identical to <o>selector~</o> with the exception that <o>mcs.selector~</o> changes its number of inputs (auto-adapts) as the number of inputs in the multi-channel signal connected to its right inlet change.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Routing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="int/signal">
			<digest>
				int/signal Turns Input Off or Routes to Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				(signal) Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="number-of-inputs" optional="1" default="1" type="int">
			<digest>
				Number of inputs
			</digest>
			<description />
		</objarg>
		<objarg name="initially-open-inlet" optional="1" default="0" type="int">
			<digest>
				Initial input selected
			</digest>
			<description>
				Specify which input is initially selected. If 0, where all signals are shut off and a zero signal is sent out.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Cycle to next inlet
			</digest>
			<description>
				Same as the <m>next</m> message.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="open-inlet" optional="0" type="int" />
			</arglist>
			<digest>
				Select an input to route
			</digest>
			<description>
				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.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Select an input to route
			</digest>
			<description>
				Float input is truncated and, like the <m>int</m> message, is used to select which inlet signal is routed to the outlet.
			</description>
		</method>
		<method name="next">
			<arglist />
			<digest>
				Cycle to next inlet
			</digest>
			<description>
				Sending the <m>next</m> message to the left inlet will close the current inlet and open the next one, wrapping accross all inlets. If currently closed (set to 0) or set to the rightmost inlet, inlet 1 will be opened.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: If a signal is connected to the left inlet, <o>selector~</o> 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.
				<br />
				<br />
				In other inlets: Any signal, to be passed through to the <o>selector~</o> 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.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="ramptime" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Time
			</digest>
			<description>
				Sets the ramp time to use for fading connections in milliseconds. When the <at>ramptime</at> attribute is non-zero, <o>selector~</o> will crossfade between inputs when the acive input is switched, fading out the input that was previous active and fading in the input that is becoming active.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="float" size="1" value="0." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Ramp Time" />
			</attributelist>
		</attribute>
		<attribute name="stepmode" get="1" set="1" type="int" size="1">
			<digest>
				Signal Change Increments Input
			</digest>
			<description>
				When enabled, all whole-number changes to a signal value in the left inlet (either increasing and decreasing) will increment the open inlet by 1, wrapping accross the available inlets. A value of zero will stop output.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Signal Change Increments Input" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="selector~.png" caption="Allow only one of several signals to pass optionally turn off unneeded signal objects" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="gate~" />
		<seealso name="crosspatch" />
		<seealso name="mcs.selector~" />
		<seealso name="switch" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The output is the signal coming in the &quot;open&quot; 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.
			</description>
		</entry>
	</misc>
</c74object>
