<?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="mcs.matrix~" module="msp" category="MSP Routing">
	<digest>
		Signal routing and mixing matrix (multichannel I/O)
	</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.
		<br />
		When the <o>matrix~</o> object is created as <o>mcs.matrix~</o> all of its signal inlets are combined into a single multichannel inlet and all of its signal outlets are combined into a single multichannel outlet. The behavior of <o>mcs.matrix~</o> is otherwise identical to <o>matrix~</o>.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="multi-channel signal">
			<digest>
				Input, connect (list), disconnect (list), ramp (int), clear
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal">
			<digest>
				Input, connect (list), disconnect (list), ramp (int), clear
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="multi-channel signal">
			<digest>
				Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="list">
			<digest>
				inlets outlets gains
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--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="default-connect-gain" optional="1" type="float">
			<digest>
				Default gain for connections
			</digest>
			<description>
				If a float value is provided as a third argument, it sets a default gain to be used for the <m>connect</m> message when a gain argument to <m>connect</m> is not supplied.
			</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
			</digest>
			<description>
				In left inlet: A list of three numbers connects inputs and outputs. The first number specifies the input channel, the second number specifies the output channel. If the third number is 0, the input is disconnected from the output. If the third number is non-zero it is interprted as a gain for the connection between the input and output.
				<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>mcs.matrix~</o> object. However, subsequent list messages can alter the gain of connections formed with the <m>connect</m> message.
				<br />
				<bar />
				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. Example: <m>1 2 .8 500</m> would connect the first input to the second output 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. If the last item in the list is a float, it will set the gain for all specified connections.
			</description>
		</method>
		<method name="dictionary">
			<arglist>
				<arg name="dict-name" type="symbol" optional="0" />
			</arglist>
			<digest>
				Configure the state of <o>mcs.matrix~</o> with a dictionary
			</digest>
			<description>
				The <o>mcs.matrix~</o> object can receive dictionaries to configure its state. When receiving a dictionary, all previous connections are cleared and replaced by the connections in the dictionary. You can also set some attributes with a dictionary, including the default gain and ramp time.
			</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 input specified by the first int to the output or outputs 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>mcs.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 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="dumpconnections">
			<arglist />
			<digest>
				Send connections out the right outlet as a dictionary
			</digest>
			<description>
				In left inlet: The word <m>dumpconnections</m> causes the current contents of the <o>matrix~</o> object to be sent out the rightmost outlet of the object as a dictionary.
			</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>mcs.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 input and output, followed by a float which specifies the target gain for the connection. Note that 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>mcs.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 input and output, followed by a float which specifies the gain for the connection.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="numouts" get="1" set="1" type="int" size="1">
			<digest>
				Output Count
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Output Count" />
			</attributelist>
		</attribute>
		<attribute name="ramp" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Time (ms)
			</digest>
			<description>
				Sets the ramp time in milliseconds, switching signals without creating audible clicks.
			</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="crosspatch" />
		<seealso name="gate~" />
		<seealso name="mcs.matrix~" />
		<seealso name="matrix" />
		<seealso name="matrixctrl" />
		<seealso name="receive~" />
		<seealso name="router" />
		<seealso name="selector~" />
		<seealso name="send~" />
	</seealsolist>
	<discussion>
		Connections between inputs and outputs can have their own gains, and each connection can include a ramp time to avoid 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>
