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

<c74object name="icst.map" module="ICST Ambisonics">

    <digest>
	Remap value from curve, table, buffer or list.
    </digest>

    <description>
		Remap value from curve, table, buffer or list. Using a table-based input system, the process scales and clips value ranges.<br/>
	</description>

    <!--METADATA-->
    <metadatalist>
	<metadata name="author">ICST | Zurich University of the Arts</metadata>
	<metadata name="tag">ICST Ambisonics</metadata>
	<metadata name="copyright">
	 © 2009 - 2021 ICST | Zurich University of the Arts
	</metadata>
	<metadata name="version">
	1.2 (Build 02/2021)
	</metadata>
    </metadatalist>

    <!--DISCUSSION-->
    <discussion>

    </discussion>

    <!--INLETS-->
    <!--do not use-->
    <inletlist>
    </inletlist>

    <!--OUTLETS-->
    <!--do not use-->
    <outletlist>
    </outletlist>

    <!--ARGUMENTS-->
    <!-- <objarglist>
    </objarglist> -->

    <!--MESSAGES-->
    <methodlist>
	<method name="bang">
	    <description>
			Outputs last value.
	    </description>
	</method>
	
	<method name="int">
	    <description>
			<p>Maps input value to output range.</p>
	    </description>
	</method>	

	<method name="float">
	    <description>
			<p>Maps input value to output range.</p>
	    </description>
	</method>		

	<method name="list">
	    <description>
			<p>Fill input table with points.</p>
			<ul>
				<li>input mode 0: individual points x, y, (z)</li>
				<li>input mode 1: list of points x , y pairs &#8212; fill with more than 3 elements</li>
				<li>input mode 2: list of points in line format: y , delta x; </li>
				<li>input mode 3: list of points in multislider format: y , no x; </li>
			</ul>
	    </description>
	</method>
	
	
	<method name="anything">
	    <description>
			<p>Export internal tables to named reference dictionary:</p>
			<ul>	
				<li>export_to_dict_in &#8212; export input table</li>
				<li>export_to_dict_map &#8212; export mapping table. NB: the table contains one million elements, diplaying in dict-editor or console will choke max.</li>

			</ul>
	    </description>
	</method>
	
	<method name="set">
	    <description>
			<p>Set value into table with incrementing counter index. Used for <m>table</m> input.</p>
	    </description>
	</method>
	
	<method name="calc">
	    <description>
			<p>Calculate the internal value table, applying border modes, etc..</p>
	    </description>
	</method>
	
	<method name="reset">
	    <description>
			<p>Reset input points to two defaults: 0.0 0.0 and 1.0 1.0 respectively, recalculate internal value table.</p>
	    </description>
	</method>
	
	<method name="intable_dump">
	    <description>
			<p>Obsolete (deactivated): use export to named reference dictionary instad</p>
			<p>Dumps input table to 2nd outlet.</p>
	    </description>
	</method>
	
	<method name="clear">
	    <description>
			<p>Clear input table.</p>
	    </description>
	</method>
		
	<method name="maptable_dump">
	    <description>
			<p>Obsolete (deactivated): use export to named reference dictionary instad</p>
			<p>Dumps internal value table table to 2nd outlet (format: &#60;index&#62; &#60;value&#62;.</p>
	    </description>
	</method>
	
	<method name="version">
	    <description>
			Print version information to Max' console window.
	    </description>
	</method>
	
	<method name="report">
	    <description>
			Print version information to Max' console window.
	    </description>
	</method>
    </methodlist>

    <!--ATTRIBUTES-->
    <attributelist>
	
	
		<attribute name="in_min" get="0" set="0" type="float" size="1" value="Input Minimum">
		    <description>
				<p>Lower bounds of input range (default: 0.0).</p>
		    </description>
		</attribute>
		

		<attribute name="in_max" get="0" set="0" type="float" size="1" value="Input Maximum">
		    <description>
				<p>Upper bounds of input range (default: 1.0).</p>
		    </description>
		</attribute>		
		
		<attribute name="out_min" get="0" set="0" type="float" size="1" value="Output Minimum">
		    <description>
				<p>Lower bounds of output range (default: 0.0).</p>
		    </description>
		</attribute>
		

		<attribute name="out_max" get="0" set="0" type="float" size="1" value="Output Maximum">
		    <description>
				<p>Upper bounds of output range (default: 1.0).</p>
		    </description>
		</attribute>		
		
		
		
	<attribute name="input_mode" get="0" set="0" type="int" size="1" value="Input Mode">
	    <description>
			<p>The method for breakpoint input.</p>
			<p>Options are:</p>
			<ul>
				<li>0: single xy(z) points &#8212; individual points x , y, z pairs;</li>
				<li>1: list of xy pairs &#8212; fill with more than 3 elements</li>
				<li>2: <m>line</m> format: y , delta x &#8212;  </li>
				<li>3: <m>multislider format</m>: y , no x &#8212;  </li>
			</ul>
	    </description>
	</attribute>
	
	<attribute name="border_mode" get="0" set="0" type="symbol" size="1" value="Border Mode">
	    <description>
			<p>The behaviour at the edge of the range.</p>
			<p>Options are:</p>
			<ul>
				<li>slope &#8212; extrapolates the slope at each edge of the range. the slopes are calculated as a weighted function of all points within border_width.</li>
				<li>gradient &#8212; extrapolates outside the range by using the overall gradient between the low and high edges of the range.</li>
				<li>clip &#8212; clips values to the edges of the range. </li>
				<li>wrap &#8212; wraps values around the edges of the range. </li>
			</ul>
	    </description>
	</attribute>
	
	<attribute name="calc_mode" get="0" set="0" type="symbol" size="1" value="Calculation Mode">
	    <description>
			<p>The method for calculating the remapped value.</p>
			<p>Options are:</p>
			<ul>
				<li>fast &#8212; to get output, this mode uses a straight table look-up, the value jumps to the nearest point in the map-table..</li>
				<li>smooth &#8212; to get output, this mode interpolates between the two closest points in the map-table.</li>
				<li>ignore &#8212; this mode completely ignores the look-up table and scales input to output range, extrapolating if out of range. This is equivalent to using the standard <m>scale</m>object.</li>
			</ul>
	    </description>
	</attribute>
	
	<attribute name="border_width" get="0" set="0" type="float" size="1" value="Border Width">
	    <description>
			<p>The width of the edge zone (default: 1.0). <b>buggy, don't touch!</b></p>
	    </description>
	</attribute>
	
	<attribute name="file" get="0" set="0" type="file" size="1" value="File">
	    <description>
			<p>A text file containing input table points.</p> 
	    </description>
	</attribute>
	
	<attribute name="buffer" get="0" set="0" type="file" size="1" value="Buffer">
	    <description>
			<p>A <m>buffer~</m> used as floating point table with input table points.</p> 
	    </description>
	</attribute>
	
	<attribute name="channel" get="0" set="0" type="float" size="1" value="Buffer Channel">
	    <description>
			<p>The buffer-channel to read from (default: 0).</p>
	    </description>
	</attribute>	
		
	
    </attributelist>
	
	
    <misc name = "Input">
	<entry name ="Inlet 1 [bang, int, float, list, anything]">
	    <description>
			<p>Values for setting and querying internal state and output; other messages.</p>
	    </description>
	</entry>
    </misc>

    <misc name = "Output">
	<entry name ="Outlet 1 [int]">
	    <description>
			<p>Output of internal state value (float).</p>
	    </description>
	</entry>
	<entry name ="Outlet 2 [symbol]">
	    <description>
			<p>Output table values in dump methods.</p>
	    </description>
	</entry>
    </misc>
	
    <misc name = "Keywords">
	<entry name ="">
	    <description>
		icst.map, range remapping, tables, curves, breakpoint functions
	    </description>
	</entry>
    </misc>
	
    <!--SEEALSO-->
	<seealsolist>

		<!-- <seealso name="icst.map"/> -->
		<seealso name="icst.random"/>
		<seealso name="icst.spline"/>
		<!-- <seealso name="splines"/> -->
		
		<seealso name="icst.button"/>
		<seealso name="icst.intui"/>
		<seealso name="icst.floatui"/>
		<seealso name="icst.listui"/>
		
		<seealso name="ambimonitor"/>
		<seealso name="ambicontrol"/>
		<seealso name="ambipoint"/>

		<seealso name="ambiencode~"/>
		<seealso name="ambidecode~"/>
		<seealso name="ambipanning~"/>
				
		<seealso name="mc.ambiencode~"/>
		<seealso name="mc.ambidecode~"/>
		<seealso name="mc.ambipanning~"/>
		
	</seealsolist>

</c74object>
