<?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="gate~" module="msp" category="MSP Routing">
	<digest>
		Route a signal to one of several outlets
	</digest>
	<description>
		Use <o>gate~</o> to route an input signal at the second inlet to one of several outlets, or to no outlet at all. When there is only one outlet (the default case), it acts as a simple switch. Unlike the Max <o>gate</o> object, any outlet which is not selected outputs a signal composed of zero values.
		<br />
		When the <o>gate~</o> object is created as <o>mcs.gate~</o> all of its signal outlets are combined into a single multichannel outlet. The behavior of <o>mcs.gate~</o> is otherwise identical to <o>gate~</o>.
	</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-outlets" optional="1" default="1" type="int">
			<digest>
				Number of outlets
			</digest>
			<description />
		</objarg>
		<objarg name="initial-open-outlet" optional="1" default="0" type="int">
			<digest>
				Initally selected outlet
			</digest>
			<description>
				Set the outlet that is initially selected. If 0, all signals are shut off and zero signals are sent out all outlets.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Cycle to next outlet
			</digest>
			<description>
				Same as the <m>next</m> message
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="outlet-selected" optional="0" type="int" />
			</arglist>
			<digest>
				Select destination outlet
			</digest>
			<description>
				If the number is <m>0</m> or negative a zero signal is sent out all outlets. If the number is greater than the number of outlets, the signal is sent to the rightmost outlet. If a <m>signal</m> is connected to the left inlet, <o>gate~</o> ignores <m>int</m> or <m>float</m> messages.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Select output
			</digest>
			<description>
				Float input is truncated and, like the <m>int</m> message, selects the destination outlet for the signal in the right inlet
			</description>
		</method>
		<method name="next">
			<arglist />
			<digest>
				Cycle to next outlet
			</digest>
			<description>
				Sending the <m>next</m> message to the left inlet closes the current outlet and opens the next one, wrapping accross all outlets. If all outlets are currently closed or the rightmost outlet is currenty open, outlet 1 will be opened.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Selects destination outlet for the input. If the number is <m>0</m> or negative a zero signal is sent out all outlets. If the number is greater than the number of outlets, the signal is sent to the rightmost outlet. If a <m>signal</m> is connected to the left inlet, <o>gate~</o> ignores <m>int</m> or <m>float</m> messages.
				<br />
				<br />
				In right inlet: The input signal to be passed through to one of the <o>gate~</o> object's outlets, according to the most recently received <m>int</m> or <m>float</m> in the left inlet, or the value of the signal coming in the left inlet.
			</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>gate~</o> will crossfade between outputs when the output is switched, fading out the output that was previous active and fading in the output 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 Output
			</digest>
			<description>
				When enabled, all whole-number changes to a signal value in the left inlet (either increasing and decreasing) will increment the open outlet by 1, wrapping accross the available outlets. 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 Output" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="gate~.png" caption="gate~ routes the input signal to one of its outlets, or shuts it off entirely" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="crosspatch" />
		<seealso name="selector~" />
		<seealso name="matrix~" />
		<seealso name="gate" />
		<seealso name="05_mspbasicchapter04" module="msp" type="tutorial" />
		<seealso name="13_panningchapter01" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				Depending on the value of the left inlet (either <m>signal</m> or number), one of the object's outlets will send out the input signal and rest will send out zero signals, or (if the inlet is closed) all outlets will send out zero signals.
			</description>
		</entry>
	</misc>
</c74object>
