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

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

	<digest>
		Define and evaluate splines
	</digest>

	<description>
		Define and evaluate splines in 2D and 3D. Spline types include Bspline, Catmull-Rom, Cardinal, Hermite, Kochanek-Bartels, Cubic, Linear, and Poly-Bezier.<br/>
		Higher order polynomials are interpolated to produce <i>blended</i> shapes and points along the curves.
	</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>
			Recalculate curve.
	    </description>
	</method>
	
	<method name="float">
	    <description>
			<p>Evaluate spline, obtain fractional position along spline. Range: 0. - 1..</p>
	    </description>
	</method>		

	<method name="list">
	    <description>
			<p>Fill input list with control points.</p>
			<p> Points are ordered in tuples (xy or xyz) according to the dimensions-attribute.</p>
	    </description>
	</method>
	
	<method name="set">
	    <description>
			<p>Fill input list with control points.</p>
			<p>Points are ordered in tuples (xy or xyz) according to the dimensions-attribute.</p>
	    </description>
	</method>

	<method name="add">
	    <description>
			<p>Add one or several control point(s) at end of list.</p>
			<p>Points are ordered in tuples (xy or xyz) according to the dimensions-attribute.</p>
			<code>"add" &#60;point coords&#62;...&#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="insert">
	    <description>
			<p>Insert one or several control point(s) at index.</p>
			<p>Points are ordered in tuples (xy or xyz) according to the dimensions-attribute.</p>
			<code>"insert" &#60;index&#62;&#60;point coords&#62;...&#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="replace">
	    <description>
			<p>Replace one or several control point(s) at index.</p>
			<p>Points are ordered in tuples (xy or xyz) according to the dimensions-attribute.</p>
			<code>"replace" &#60;index&#62;&#60;point coords&#62;...&#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="remove">
	    <description>
			<p>Remove one or several control point(s) at index.</p>
			<code>"remove" &#60;index&#62;...&#60;index&#62;</code>
	    </description>
	</method>
	
	<method name="shift">
	    <description>
			<p>Shift control point(s) by steps within list at index.</p>
			<p>Positive steps: forwards; negative steps: backwards</p>
			<code>"shift" &#60;index&#62;&#60;number of steps&#62;</code>
	    </description>
	</method>
	
	<method name="search">
	    <description>
			<p>sSearch for control point index at coordinate.</p>
			<p>see <m>searchbox</m> attribute for size of search zone.</p>
				<code>"search" &#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="move">
	    <description>
			<p>Search for control point index at coordinate.</p>
			<p><i>See <m>searchbox</m> attribute for size of search zone.</i></p>
				<code>"move" &#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="clear">
	    <description>
			<p>Clear all control points.</p>
	    </description>
	</method>
	
	<method name="endpoint">
	    <description>
			<p>Set additional handle points before first and after last control point.</p>
			<code>"endpoint" &#60;index&#62;&#60;point coords&#62;</code>
	    </description>
	</method>	
	
	<method name="getlist">
	    <description>
			<p>Outputs list of control points from 3rd outlet.</p>
	    </description>
	</method>	
	
	<method name="getpoints">
	    <description>
			<p>Outputs points of control points sequentially from 3rd outlet.</p>
			<code>result: &#60;index&#62;&#60;point coords&#62;</code>
	    </description>
	</method>	

	<method name="getpoint">
	    <description>
			<p>Outputs specific point from 3rd outlet.</p>
			<code>"getpoint" &#60;index&#62;</code>
			<code>result: &#60;index&#62;&#60;point coords&#62;</code>
	    </description>
	</method>
	
	<method name="getsize">
	    <description>
			<p>Outputs number of control points from 3rd outlet.</p>
	    </description>
	</method>	

	<method name="getmin">
	    <description>
			<p>Outputs minimum coordinates from 3rd outlet (minimum point of bounding box).</p>
	    </description>
	</method>	
	
	<method name="getmax">
	    <description>
			<p>Outputs maximum coordinates from 3rd outlet (maximum point of bounding box).</p>
	    </description>
	</method>		
	
	<method name="dump">
	    <description>
			<p>Print internal table to Max' console window..</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="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="type" get="0" set="0" type="int" size="1" value="Spline Type">
		    <description>
				<p>The type of spline curve.</p>
				<p>Options are:</p>
				<ul>
					<li>0: Bspline </li>
					<li>1: Catmull-Rom</li>
					<li>2: Cardinal</li>
					<li>3: Hermite</li>
					<li>4: Kochanek-Bartels</li>
					<li>5: Cubic</li>
					<li>6: Linear</li>
					<li>7: Poly-Bezier</li>
				</ul>
		    </description>
		</attribute>
	
		<attribute name="tension" get="0" set="0" type="float" size="1" value="Spline Tension">
		    <description>
				<p>Spline tension.</p>
				<p> Applies to cardinal, hermite, kochanek-bartels spline</p>
		    </description>
		</attribute>
	
		<attribute name="bias" get="0" set="0" type="float" size="1" value="Spline Bias">
		    <description>
				<p>Spline bias.</p>
				<p> Applies to hermite, kochanek-bartels spline</p>
		    </description>
		</attribute>
			
		<attribute name="continuity" get="0" set="0" type="float" size="1" value="Spline Continuity">
		    <description>
				<p>Spline continuity.</p>
				<p> Applies to kochanek-bartels spline</p>
		    </description>
		</attribute>

		<attribute name="closed" get="0" set="0" type="onoff" size="1" value="Closed">
		    <description>
				<p>Connects end point with start point (default: 0).</p>
		    </description>
		</attribute>
		
		<attribute name="constant_speed" get="0" set="0" type="onoff" size="1" value="Constant Speed">
		    <description>
				<p>Evaluate spline with constant speed (default: 1).</p>
		    </description>
		</attribute>			
		
		
		<attribute name="steps" get="0" set="0" type="int" size="1" value="Number of steps">
		    <description>
				<p>number of steps on spline/segment (default: 100).</p>
		    </description>
		</attribute>
		
		<attribute name="degree" get="0" set="0" type="int" size="1" value="Bezier Degree">
		    <description>
				<p>Degree of Bezier evaluation.</p>
		    </description>
		</attribute>
		
		<attribute name="dim" get="0" set="0" type="int" size="1" value="Dimension">
		    <description>
				<p>Dimensions of spline and control point vector.</p>
				<p>Output dimensions (2 xy / 3 xyz )</p>
		    </description>
		</attribute>
		
		<attribute name="active" get="0" set="0" type="int" size="1" value="Active Output">
		    <description>
				<p>Parameter changes actively trigger curve output.</p>
		    </description>
		</attribute>
		
		<attribute name="read_mode" get="0" set="0" type="int" size="1" value="Read Mode">
		    <description>
				<p>The mode of spline evaluation.</p>
				<p>Options are:</p>
				<ul>
					<li>0: position on spline at factor f (default).</li>
					<li>1: y value at intersection point x (like bpf-function)</li>
					<li>2: x value at intersection point y</li>
				</ul>
				<p><i>See alternate mode sub-patcher in help-file</i></p>
		    </description>
		</attribute>
	
	<attribute name="tablesize" get="0" set="0" type="int" size="1" value="Table Size">
	    <description>
			<p>The internal table's size (minimum: 1, default: 1001).</p>
	    </description>
	</attribute>
	
	<attribute name="searchbox" get="0" set="0" type="float" size="1" value="Searchbox Size">
	    <description>
			<p>Size of the region around search coordinates - half width/height (default: 0.1).</p>
	    </description>
	</attribute>

    </attributelist>
	
	
    <misc name = "Input">
	<entry name ="Inlet 1 [bang, int, float, list, anything]">
	    <description>
			<p>Setting internal state and other messages.</p>
	    </description>
	</entry>
    </misc>

    <misc name = "Output">
	<entry name ="Outlet 1 [list]">
	    <description>
			<p>Output of evaluation results.</p>
	    </description>
	</entry>
	<entry name ="Outlet 2 [symbol]">
	    <description>
			<p>Output notification when curve re-calculations or dump processes are finished.</p>
	    </description>
	</entry>
	<entry name ="Outlet 2 [symbol]">
	    <description>
			<p>Output values from get and dump methods.</p>
	    </description>
	</entry>
    </misc>
	
    <misc name = "Keywords">
	<entry name ="">
	    <description>
		icst.spline, spline interpolation, fractional evaluation, animation, easing
	    </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>
