<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<c74object name='MIAP'>

	<digest>
		MIAP Max Panner
	</digest>


	<!--METADATA-->
	<metadatalist>
		<metadata name='author'>Zachary Seldess</metadata>
		<metadata name='tag'>Max</metadata>
		<metadata name='tag'>Panning</metadata>
	</metadatalist>


	<!--INLETS-->
	<!-- <inletlist>
		<inlet id="0" type="message">
			<digest>Messages to MIAP</digest>
		</inlet>
	</inletlist> -->


	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="name" optional="0" type="symbol">
			<digest>MIAP name</digest>
		</objarg>
	</objarglist>


	<!--MESSAGES-->
	<methodlist>
		<method name="read_mapA">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Read map A JSON file
			</digest>
			<description>
				Read map A JSON file.
			</description>
		</method>
		<method name="read_mapB">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Read map B JSON file
			</digest>
			<description>
				Read map B JSON file.
			</description>
		</method>
		<method name="write_mapA">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Write map A JSON file
			</digest>
			<description>
				Write map A JSON file.
			</description>
		</method>
		<method name="write_mapB">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Write map B JSON file
			</digest>
			<description>
				Write map B JSON file.
			</description>
		</method>
		<method name="read_trajectory">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Read trajectory JSON file
			</digest>
			<description>
				Read trajectory JSON file.
			</description>
		</method>
		<method name="write_trajectory">
			<arglist>
				<arg name="filename" optional="1" type="symbol"/>
			</arglist>
			<digest>
				Write trajectory JSON file
			</digest>
			<description>
				Write trajectory JSON file.
			</description>
		</method>
		<method name="dump_mapA">
			<digest>
				Dump map A data out of right outlet
			</digest>
			<description>
				Dump map A data out of right outlet.
			</description>
		</method>
		<method name="dump_mapB">
			<digest>
				Dump map B data out of right outlet
			</digest>
			<description>
				Dump map b data out of right outlet.
			</description>
		</method>
		<method name="dump_trajectory">
			<digest>
				Dump trajectory data out of right outlet
			</digest>
			<description>
				Dump trajectory data out of right outlet.
			</description>
		</method>
		<method name="coords">
			<arglist>
				<arg name="x/y coordinates" optional="0" type="list"/>
			</arglist>
			<digest>
				Set mouse node x/y coordinates
			</digest>
			<description>
				Set mouse node x/y coordinates.
			</description>
		</method>
		<method name="get_coords">
			<digest>
				Get mouse node x/y coordinates from right outlet
			</digest>
			<description>
				Get mouse node x/y coordinates from right outlet.
			</description>
		</method>
		<method name="clear_map">
			<arglist>
				<arg name="map" optional="0" type="int"/>
			</arglist>
			<digest>
				Erase map (0 = A, 1 = B)
			</digest>
			<description>
				Erase map (0 = A, 1 = B).
			</description>
		</method>
		<method name="node_create">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node x" optional="1" type="float"/>
				<arg name="node y" optional="1" type="float"/>
				<arg name="node channel" optional="1" type="int"/>
				<arg name="node type" optional="1" type="int"/>
				<arg name="node trim" optional="1" type="float"/>
			</arglist>
			<digest>
				Create node
			</digest>
			<description>
				Create node (NOTE: node id less than 0 automatically increments id from highest in the map).
				<br />
				Optional args: x, y, channel, type, trim (default 0. 0. 1. 1 1.).
			</description>
		</method>
		<method name="node_delete">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
			</arglist>
			<digest>
				Delete node
			</digest>
			<description>
				Delete node.
			</description>
		</method>
		<method name="triset_create">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="triset id" optional="0" type="int"/>
				<arg name="node id 1" optional="0" type="int"/>
				<arg name="node id 2" optional="0" type="int"/>
				<arg name="node id 3" optional="0" type="int"/>
			</arglist>
			<digest>
				Create triset
			</digest>
			<description>
				Create triset (NOTE: triset id less than 0 automatically increments id from highest in the map).
			</description>
		</method>
		<method name="triset_delete">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="triset id" optional="0" type="int"/>
			</arglist>
			<digest>
				Delete triset
			</digest>
			<description>
				Delete triset.
			</description>
		</method>
		<method name="link_create">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="link node id" optional="0" type="int"/>
				<arg name="target node id" optional="0" type="int"/>
				<arg name="link weight" optional="1" type="float"/>
			</arglist>
			<digest>
				Create link
			</digest>
			<description>
				Create link.
				<br />
				Optional arg: weight (default 1.)
			</description>
		</method>
		<method name="link_delete">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="link node id" optional="0" type="int"/>
				<arg name="target node id" optional="0" type="int"/>
			</arglist>
			<digest>
				Delete link
			</digest>
			<description>
				Delete link.
			</description>
		</method>
		<method name="node_type">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node type" optional="0" type="int"/>
			</arglist>
			<digest>
				Set node type
			</digest>
			<description>
				Set node type (1 = speaker, 2 = virtual, 3 = derived, 4 = silent).
			</description>
		</method>
		<method name="node_channel">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node channel" optional="0" type="int"/>
			</arglist>
			<digest>
				Set node channel
			</digest>
			<description>
				Set node channel.
			</description>
		</method>
		<method name="node_position">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node x" optional="0" type="float"/>
				<arg name="node y" optional="0" type="float"/>
			</arglist>
			<digest>
				Set node x/y position
			</digest>
			<description>
				Set node x/y position.
			</description>
		</method>
		<method name="node_trim">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node trim" optional="0" type="float"/>
			</arglist>
			<digest>
				Set node trim
			</digest>
			<description>
				Set node trim (range 0. to 10.).
			</description>
		</method>
		<method name="node_attenuation">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="node id" optional="0" type="int"/>
				<arg name="node trim" optional="0" type="float"/>
			</arglist>
			<digest>
				Set node trim (Deprecated)
			</digest>
			<description>
				Set node trim (Deprecated: use node_trim instead).
			</description>
		</method>
		<method name="link_weight">
			<arglist>
				<arg name="map" optional="0" type="int"/>
				<arg name="link node id" optional="0" type="int"/>
				<arg name="target node id" optional="0" type="int"/>
				<arg name="link weight" optional="0" type="float"/>
			</arglist>
			<digest>
				Set link weight
			</digest>
			<description>
				Set link weight (range 0. to 10.).
			</description>
		</method>
		<method name="bang">
			<digest>
				Start trajectory from the beginning
			</digest>
			<description>
				Start trajectory from the beginning.
			</description>
		</method>
		<method name="start">
			<digest>
				Start/resume trajectory from the current position
			</digest>
			<description>
				Start/resume trajectory from the current position.
			</description>
		</method>
		<method name="stop">
			<digest>
				Stop/pause trajectory at its current position
			</digest>
			<description>
				Stop/pause trajectory at its current position.
			</description>
		</method>
		<method name="position">
			<arglist>
				<arg name="trajectory position" optional="0" type="float"/>
			</arglist>
			<digest>
				Set trajectory position
			</digest>
			<description>
				Set trajectory position (0. to 100.).
			</description>
		</method>
		<method name="clear_trajectory">
			<digest>
				Erase trajectory
			</digest>
			<description>
				Erase trajectory.
			</description>
		</method>
		<method name="record_trajectory">
			<arglist>
				<arg name="start/stop recording" optional="0" type="int"/>
			</arglist>
			<digest>
				Start/stop recording trajectory based mouse node coordinate changes.
			</digest>
			<description>
				Start/stop recording trajectory based mouse node coordinate changes (1 = start, 0 = stop).
			</description>
		</method>
		<method name="set_trajectory">
			<arglist>
				<arg name="trajectory script" optional="0" type="list"/>
			</arglist>
			<digest>
				Script trajectory.
			</digest>
			<description>
				Script trajectory. 
				<br />
				Message format: <m>x1 y1 msec x2 y2 msec... xN yN</m>
				<br />
				Example: <m>set_trajectory -500 -500 1500 700 300 3000 -200 100 500 0 0</m>
			</description>
		</method>
	</methodlist>


	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name='divergence' get='1' set='1' type='float' size='1'>
			<digest>
				Global power-preserving spread
			</digest>
			<description>
				Global power-preserving spread (range 0. to 1., default 0.).
			</description>
		</attribute>
		<attribute name='pan' get='1' set='1' type='float' size='1'>
			<digest>
				Pan between map A and B
			</digest>
			<description>
				Pan between map A and B (range -1. to 1., default 0.).
			</description>
		</attribute>
		<attribute name='panmode' get='1' set='1' type='int' size='1'>
			<digest>
				Curve used to pan between maps
			</digest>
			<description>
				Curve used to pan between maps: 0 = linear, 1 = cosine, 2 = square root (default 0).
			</description>
		</attribute>
		<attribute name='gainsmode' get='1' set='1' type='int' size='1'>
			<digest>
				Output "speaker" gains in linear amplitude or decibel formats (0 = linear, 1 = dB, default 0)
			</digest>
			<description>
				Output "speaker" gains in linear amplitude or decibel formats (0 = linear, 1 = dB, default 0).
			</description>
		</attribute>
		<attribute name='virtualnodetype' get='1' set='1' type='int' size='1'>
			<digest>
				Manner in which virtual nodes route signal to linked speaker/silent nodes
			</digest>
			<description>
				Manner in which virtual nodes route signal to linked speaker/silent nodes (0 = power-preserving, 1 = linear, default 0).
			</description>
		</attribute>
		<attribute name='derivednodetype' get='1' set='1' type='int' size='1'>
			<digest>
				Manner in which derived nodes derive signal from linked speaker nodes
			</digest>
			<description>
				Manner in which derived nodes derive signal from linked speaker nodes (0 = power-preserving, 1 = linear, default 1).
			</description>
		</attribute>
		<attribute name='barycentricpower' get='1' set='1' type='float' size='1'>
			<digest>
				Raise the barycentric ratios to the specified power
			</digest>
			<description>
				Raise the barycentric ratios to the specified power (effectively pushing the point towards the edge of the triset) to give better dynamic range (range >= 0., default 1.).
			</description>
		</attribute>
		<attribute name='silentnodeweight' get='1' set='1' type='float' size='1'>
			<digest>
				Barycentric weight for silent nodes
			</digest>
			<description>
				Barycentric weight for silent nodes (range >= 0., default 1. [default in Meyer SpaceMap ≈ 3.]).
			</description>
		</attribute>
		<attribute name='grain' get='1' set='1' type='int' size='1'>
			<digest>
				Trajectory output time grain in msecs
			</digest>
			<description>
				Trajectory output time grain in msecs (range >= 1, default 20).
			</description>
		</attribute>
		<attribute name='repetitions' get='1' set='1' type='float' size='1'>
			<digest>
				Number of times to play full trajectory animation when bang or start message received
			</digest>
			<description>
				Number of times to play full trajectory animation when bang or start message received (range >= 0.0, default 1.).
				<br />
				NOTE: Setting repetitions to 0. causes infinite looping of trajectory. 
			</description>
		</attribute>
		<attribute name='rate' get='1' set='1' type='float' size='1'>
			<digest>
				Trajectory playback rate in percent
			</digest>
			<description>
				Trajectory playback rate in percent (range 0. to 100., default 100.).
			</description>
		</attribute>
		<attribute name='rotate' get='1' set='1' type='float' size='1'>
			<digest>
				Trajectory rotation in degrees
			</digest>
			<description>
				Trajectory rotation in degrees (default 0.).
			</description>
		</attribute>
		<attribute name='offset' get='1' set='1' type='float' size='1'>
			<digest>
				Trajectory x/y translation
			</digest>
			<description>
				Trajectory x/y translation (default 0. 0.).
			</description>
		</attribute>
		<attribute name='scale' get='1' set='1' type='float' size='1'>
			<digest>
				Trajectory x/y scale
			</digest>
			<description>
				Trajectory x/y scale (default 1. 1.).
			</description>
		</attribute>
		<attribute name='record_grain' get='1' set='1' type='int' size='1'>
			<digest>
				Trajectory recording grain in msecs
			</digest>
			<description>
				Trajectory recording grain in msecs (range >= 1, default 100).
			</description>
		</attribute>
	</attributelist>


	<misc name="Input">
		<entry name="message">
			<description>
				Messages to <o>MIAP</o>.
			</description>
		</entry>
	</misc>


	<misc name="Output">
		<entry name="list">
			<description>
				<o>MIAP</o> outputs a list of gains in ascending order corresponding to all speaker and derived node channels in mapA and/or mapB.
				<ul>
					<li>
						If both mapA and mapB have nodes, gains from both maps will be combined into one list.
					</li>
					<li>
						Gains of 0. (linear amp) will be inserted for maps with non-contiguous node channel ranges (see 2nd example below).
					</li>
				</ul>
				Example of mapA/B containing node channels 1-4: <m>0.2 0.707 0.9 0.5</m>
				<br />
				<br />
				Example of mapA/B containing node channels 1, and 3-4 (i.e. missing 2): <m>0.2 0. 0.707 0.9 0.5</m>
				<ul>
					<li>
						<b><i>Note the insertion of 0. at the 2nd element of the list, representing the gain for channel 2.</i></b>
					</li>
				</ul>
			</description>
		</entry>
		<entry name="message">
			<description>
				Info outlet (right outlet).
			</description>
		</entry>
	</misc>


	<!--RELATED-->
	<seealsolist>
		<seealso name="miap_overview" module="topics" type="vignette"/>
		<seealso name="miap_map_elements" module="topics" type="vignette"/>
		<seealso name="miap_tutorials" module="miap-tut" type="tutorial"/>
		<!-- <seealso name="MIAP"/> -->
		<seealso name="MIAP~"/>
		<seealso name="MIAP.map"/>
		<seealso name="MIAP.meyer"/>
	</seealsolist>

</c74object>
