<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<c74object box="0" name="Jitter Matrix Operators" category="Unlisted" module="jit">
	<digest>
		Messages and attributes common to Jitter matrix operators
	</digest>
	<description>
		<p>
			Since the matrix is Jitter's focus, it is not surprising that the majority of Jitter objects fall in this category of Matrix Operators. Every Matrix operator has some number of matrix inputs and some number of matrix outputs. Matrix inputs are referred to by the names &quot;in&quot;, &quot;in2&quot;, &quot;in3&quot;, etc., from left to right, and matrix outputs are referred to by the names &quot;out&quot;, &quot;out2&quot;, &quot;out3&quot;, etc., from left to right--i.e. the names are appended by the input/output number except for the first (leftmost) input and first (leftmost) output which are simply named &quot;in&quot; and &quot;out&quot;. We will refer to the input or output name names as the &quot;I/O-name&quot;.
		</p>
		<p>
			Matrix inputs and outputs typically each have their own matrices internally where information is kept. This is necessary because Jitter is an asynchronous framework (i.e. all the matrices don't arrive at all inputs at the same time). Various aspects of matrix inputs and outputs can be set using the command [I/O-name] combined with one of the following suffixes: &quot;_dim&quot; which will set the dimensions of the specified I/O matrix, &quot;_type&quot; which will set the type of the specified matrix, &quot;_planecount&quot; which will set the plane of the specified matrix, or &quot;_name&quot; which will set the name of the specified matrix. There is one special case which does not have an internal matrix and this is the first input &quot;in&quot;. This is the case since this special input actually triggers the calculation of the matrix operator, so it doesn't need to be cached until a calulation takes place, unlike the other inputs. Therefore there is no mechanism to set the dim, planecount, type, or name of &quot;in&quot;.
		</p>
		<p>
			Matrix operators accept what we'll refer to as &quot;matrix args&quot;--i.e. <m>[planecount (int)] [ <i>type</i> (symbol)] [dim (int list)]</m>. if these arguments are present, the <m>adapt</m> attribute will be turned off, otherwise it will be turned on. If adapt mode is turned on, each time a matrix is received in the first input, there will also be the equivalent of setting the <m>dim</m>, <m>planecount</m>, and <m>type</m> attributes to that of the input matrix. If the other inputs and outputs are linked to these attributes, this will affect their linked attributes as well. See the &quot;MOP&quot; table to determine which inputs and outputs will be linked to which attributes when adapt mode is turned on. For the leftmost input this is not applicable, and hence all columns are labelled &quot;n/a&quot;.
		</p>
		<p>
			The <o>jit.matrix</o> object is a named matrix which may be used to matrix data storage and retrieval, resampling, and matrix type and planecount conversion operations.
		</p>
	</description>
	<!--METADATA -->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Jitter
		</metadata>
	</metadatalist>
	<inletlist />
	<outletlist />
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="planecount" optional="1" type="int">
			<digest>
				Number of planes
			</digest>
			<description>
				Explicitly sets the number of planes for the output and any righthand inputs. If this is absent, the Matrix Operator will typically adapt to the lefthand incoming matrix attributes, except for special case operators.
			</description>
		</objarg>
		<objarg name="type" optional="1" type="symbol">
			<digest>
				Matrix type
			</digest>
			<description>
				Explicitly sets the type of the matrix for the output and any righthand inputs. If this is absent, the Matrix Operator will typically adapt to the lefthand incoming matrix attributes, except for special case operators.
			</description>
		</objarg>
		<objarg name="dimensions" optional="1" type="list">
			<digest>
				Matrix dimensions
			</digest>
			<description>
				Explicitly sets the dimensions of the matrix for the output and any righthand inputs. If this is absent, the Matrix Operator will typically adapt to the lefthand incoming matrix attributes, except for special case operators.
			</description>
		</objarg>
	</objarglist>
	<!-- ===================================================
      METHODS
  =================================================== -->
	<methodlist>
		<method name="bang">
			<digest>
				Equivalent to the <m>outputmatrix</m> message.
			</digest>
			<description>
				Equivalent to the <m>outputmatrix</m> message.
			</description>
		</method>
		<method name="clear">
			<digest>
				Sets all cell values in a matrix to zero.
			</digest>
			<description>
				Sets all cell values in a matrix to zero.
			</description>
		</method>
		<method name="exportattrs">
			<arglist>
				<arg name="filename" type="symbol" />
			</arglist>
			<digest>
				Exports an object's current attributes values in XML format.
			</digest>
			<description>
				Exports an object's current attributes values in XML format. If no filename is specified, a file dialog will open to let you choose a file.
			</description>
		</method>
		<method name="getattributes">
			<digest />
			<description>
				Sends a sequence of lists out the object's right outlet describing the object's attributes, one line per attribute. Each line listing line takes the form <m>attribute</m>  <i>attribute-name</i>  <m>get</m>  <i>get-value</i>  <m>set</m>  <i>foo</i> set-value <m>data-type(s)</m>  <i>number-of-values</i>.
			</description>
		</method>
		<method name="getstate">
			<digest>
				Sends a sequence of lists describing the object's state out the object's right outlet, one line per attribute.
			</digest>
			<description>
				Sends a sequence of lists describing the object's state out the object's right outlet, one line per attribute. Each line listing line takes the form <m>attribute-name</m>  <i>attribute-value1</i>  <i>attribute-value2</i>... <i>attribute-valueN</i>.
			</description>
		</method>
		<method name="importattrs">
			<arglist>
				<arg name="filename" type="symbol" />
			</arglist>
			<digest>
				Imports attributes specified in XML format to set the object's attributes.
			</digest>
			<description>
				Imports attributes specified in XML format to set the object's attributes. If no filename is specified, a file dialog will open to let you choose a file.
			</description>
		</method>
		<method name="jit_matrix">
			<arglist>
				<arg name="matrix-name" type="symbol" />
			</arglist>
			<digest>
				Handles input for the named matrix.
			</digest>
			<description>
				Handles input for the named matrix. If this messages is received in the left inlet, output is typically triggered. If this message is received in any other inlet, the data is typically cached until the <m>jit_matrix</m> message is received in the left inlet.
			</description>
		</method>
		<method name="outputmatrix">
			<digest>
				Sends the matrix out the left outlet.
			</digest>
			<description>
				Sends the matrix out the left outlet.
			</description>
		</method>
		<method name="summary">
			<digest>
				Sends a sequence of lists describing the object and it attributes and messages out the rightmost outlet of the object.
			</digest>
			<description>
				Sends a sequence of lists describing the object and it attributes and messages out the rightmost outlet of the object.
			</description>
			<description>
				The first output line takes the form <m>summary objectname</m>  <i>object-name</i>.
			</description>
			<description>
				The second and third lines describe the number of inlets and outlets for the object in the form <m>summary (matrixinputcount/matrixoutletcount)</m>  <i>number-of-(inlets/outlets)</i>.
			</description>
			<description>
				The fourth line describes the matrixoutput in the form <m>summary matrixoutput</m>  <i>descriptor</i>  <m>planelink</m>  <i>planelink-value</i>  <m>typelink</m>  <i>typelink-value</i>  <m>dimlink</m>  <i>dimlink-value</i>  <m>types</m>  <i>data-type(s)</i>.
			</description>
			<description>
				Each attribute for the object is then listed, one attribute per line. Each line listing takes the form <m>summary attribute</m>  <i>attribute-name attribute-value1 attribute-value2 ... attribute-valueN</i>.
			</description>
		</method>
	</methodlist>
	<!-- ===================================================
      ATTRIBUTES
  =================================================== -->
	<attributelist>
		<attribute get="1" name="adapt" size="1" set="1" type="int">
			<digest>
				Matrix adaptation flag
			</digest>
			<description>
				Matrix adaptation flag (default = 0 if matrix arguments are present, otherwise 1) When the flag is set, the <o>jit.matrix</o> object will adapt to the incoming matrix planecount, type, and dimensions.
			</description>
		</attribute>
		<attribute get="1" name="[in/out]_dim" size="32" set="1" type="int">
			<digest>
				The input or output matrix data dimensions
			</digest>
			<description>
				The matrix data dimensions (default = 1 1)
			</description>
		</attribute>
		<attribute get="1" name="[in/out]_name" size="1" set="1" type="symbol">
			<digest>
				The input or output name of the matrix
			</digest>
			<description>
				The input or output name of the matrix (default = UID)
			</description>
		</attribute>
		<attribute get="1" name="[in/out]_planecount" size="1" set="1" type="int">
			<digest>
				The number of planes in matrix input or output data
			</digest>
			<description>
				The number of planes in matrix input our output data. Except in special cases, this value is equal to the <m>planecount</m>.
			</description>
		</attribute>
		<attribute get="1" name="[in/out]_type" size="1" set="1" type="symbol">
			<digest>
				The matrix data type
			</digest>
			<description>
				The input or output matrix data type. Except in special cases, this value is equal to <m>type</m>.
			</description>
		</attribute>
		<attribute get="1" name="[in/out]_type" size="1" set="1" type="symbol">
			<digest>
				The matrix data type
			</digest>
			<description>
				The input or output matrix data type. Except in special cases, this value is equal to <m>type</m>.
			</description>
		</attribute>
		<attribute get="1" name="outputmode" size="1" set="1" type="int">
			<digest>
				The matrix output mode
			</digest>
			<description>
				Output mode (default = 1 (calculate and output matrix))
				<br />
				0 = No output
				<br />
				1 = Calculate and output the matrix
				<br />
				2 = Pass input (no calculation)
				<br />
				3 = Pass output (no calculation)
			</description>
		</attribute>
		<attribute get="1" name="type" size="1" set="1" type="int">
			<digest>
				The matrix data type (default = <m>char</m> 				<br />
				Supported data types are <m>char</m>, <m>long</m>, <m>float32</m>, or <m>float64</m>.
			</digest>
			<description>
				The matrix data type (default = <m>char</m> 				<br />
				Supported data types are <m>char</m>, <m>long</m>, <m>float32</m>, or <m>float64</m>.
			</description>
		</attribute>
	</attributelist>
</c74object>
