<?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="matrix~" module="msp" category="MSP Routing">
	<digest>
		Signal routing and mixing matrix
	</digest>
	<description>
		<o>matrix~</o> is an array of signal connectors and mixers (adders). It can have any number of inlets and outlets. Signals entering at each inlet can be routed to one or more of the outlets, with a variable amount of gain. If an outlet is connected to more than one inlet, its output signal is the sum of the signals from the inlets.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Routing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<!--OUTLETS-->
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="inlets" optional="0" type="int">
			<digest>
				Number of inlets
			</digest>
			<description>
				The first argument specifies the number of inlets.
			</description>
		</objarg>
		<objarg name="outlets" optional="0" type="int">
			<digest>
				Number of outlets
			</digest>
			<description>
				The second argument specifies the number of outlets.
			</description>
		</objarg>
		<objarg name="connection-gain" optional="1" type="float">
			<digest>
				Nonbinary connection gain
			</digest>
			<description>
				If a float value is provided as a third argument, <o>matrix~</o> operates in its non-binary mode. The argument sets the gain value that will be used when connections are created.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="list">
			<arglist>
				<arg name="inlet-to-outlet indices" optional="0" type="list" />
			</arglist>
			<digest>
				Connect inlets and outlets in binary mode
			</digest>
			<description>
				In left inlet: A list of three ints may be used to connect inlets and outlets when the <o>matrix~</o> object is in binary mode. The first int specifies the inlet, the second int specifies the outlet, and a third int is used to specify connection or disconnection. If the third int is nonzero value, the inlet of the first int will be connected to the outlet specified by the second int. A zero value for the third int in the list disconnects the inlet-outlet pair.
				<br />
				<br />
				If the <o>matrix~</o> object is operating in non-binary mode, A list of two ints followed by a float sets the gain of the connection between inlet i and outlet o to the value specified by the float.
				<br />
				<br />
				Note: To specify the gain of individual connections, you must use three-element list messages rather than the <m>connect</m> message. Connections formed with the <m>connect</m> message always have a gain specified by the third argument initially given to the <o>matrix~</o> object. However, subsequent list messages can alter the gain of connections formed with the <m>connect</m> message. The addition of an optional fourth element to the list message can be used to specify a ramp time, in milliseconds, for the individual connection (e.g., <m>1 2 .8 500</m> would connect the first inlet to the second outlet and specify a gain of .8 and a ramp time of .5 seconds).
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Remove all connections
			</digest>
			<description>
				In left inlet: The word <m>clear</m> removes all connections.
			</description>
		</method>
		<method name="connect">
			<arglist>
				<arg name="inlet-to-outlet indices" optional="0" type="list" />
			</arglist>
			<digest>
				Connect an inlet to an outlet
			</digest>
			<description>
				In left inlet: The word <m>connect</m>, followed by one or more ints, will connect any inlet specified by the first int to the outlet or outlets specified by the remaining ints in the list. Inlets and outlets are numbered from left to right, starting at zero. For example, the message <m>connect 0 0 1</m> would connect the first inlet from the left to the leftmost outlet and the second outlet from the left.
			</description>
		</method>
		<method name="disconnect">
			<arglist>
				<arg name="inlet-to-outlet indices" optional="0" type="list" />
			</arglist>
			<digest>
				Disconnect an inlet from outlets
			</digest>
			<description>
				In left inlet: The word <m>disconnect</m>, followed by one or more ints, will disconnect any inlet specified by the first int to the outlet or outlets specified by the remaining ints in the list.
			</description>
		</method>
		<method name="dump">
			<arglist />
			<digest>
				Send connection information out the right outlet
			</digest>
			<description>
				In left inlet: The word <m>dump</m> causes the current state of all <o>matrix~</o> object connections to be sent out the rightmost outlet of the object in the form of a list for each connection. The list consists of two numbers which specify the inlet and outlet, followed by a float which specifies the gain for the connection. Note that in non-binary mode the current gains are not necessarily the same as the target gains of all <o>matrix~</o> object connections, since a connection's gain can ramp to its new target over time.
			</description>
		</method>
		<method name="dumptarget">
			<arglist />
			<digest>
				Send target state information out the right outlet
			</digest>
			<description>
				In left inlet: The word <m>dumptarget</m> causes the target state of all <o>matrix~</o> object connections to be sent out the rightmost outlet of the object in the form of a list for each connection. The list consists of two numbers which specify the inlet and outlet, followed by a float which specifies the target gain for the connection. Note that in non-binary mode the target gains are not necessarily the same as the current gains, which can be accessed with the <m>dump</m> message.
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Print a connection list to the Max Console
			</digest>
			<description>
				In left inlet: The word <m>print</m> causes the current state of all <o>matrix~</o> object connections to be printed in the Max Console in the form of a list for each connection. The list consists of two numbers which specify the inlet and outlet, followed by a float which specifies the gain for the connection.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="ramp" get="1" set="1" type="atom_long" size="1">
			<digest>
				Ramp Time (ms)
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Ramp Time (ms)" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="matrix~.png" caption="Multichannel audio routing" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="gate~" />
		<seealso name="matrixctrl" />
		<seealso name="receive~" />
		<seealso name="router" />
		<seealso name="selector~" />
		<seealso name="send~" />
	</seealsolist>
	<discussion>
		The <o>matrix~</o> object has two modes of operation: &quot;binary&quot; and non-binary. In binary mode, connections act like simple switches, and always have unity gain. This mode is faster, but audible clicks will occur if you're listening to the outputs of this object when connections are made and broken. In non-binary mode, connections are gain stages, i.e. they can scale the signal by some amount other than zero and one. They also provide an adjustable ramping time over which the gain values are changed. This allows signals to be switched without creating audible clicks.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				The output signals for each outlet are the sum of their connected inputs, scaled by the gain values of the connections.
			</description>
		</entry>
		<entry name="list">
			<description>
				Out right outlet: A set of lists describing the current or target state of all <o>matrix~</o> object connections will be sent out the right outlet in response to a <m>dump</m> or <m>dumptarget</m> message.
			</description>
		</entry>
	</misc>
</c74object>
