<?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="trough" module="max" category="Control">
	<digest>
		Output a number if it is less than previous numbers
	</digest>
	<description>
		Compares an input value to the stored value and, if it's smaller it sends the input to the output and sets it as the new trough.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Control
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Find the lowest number (the trough)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Sets the trough
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				The lowest number so far
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Goes high for a new trough
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Goes high for a number that isn't a new trough
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="value" optional="1" type="float">
			<digest>
				Initial trough value and format
			</digest>
			<description>
				The initial value stored in <o>trough</o> is <m>128</m>. Providing a float argument will cause trough to operate on floating-point values instead of integers.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				In left inlet: Sends the currently stored minimum value out the left outlet.
			</digest>
			<description>
				In left inlet: Sends the currently stored minimum value out the left outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Compare and cause output
			</digest>
			<description>
				In left inlet: If the input is less than the value currently stored in <o>trough</o>, it is stored as the new minimum value and is sent out.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Compare and cause output
			</digest>
			<description>
				In left inlet: If the input is less than the value currently stored in <o>trough</o>, it is stored as the new minimum value and is sent out.
			</description>
		</method>
		<method name="ft1">
			<arglist>
				<arg name="trough" optional="0" type="float" />
			</arglist>
			<digest>
				Set a new trough value
			</digest>
			<description>
				In right inlet: The input is stored in <o>trough</o> as the new minimum value, and is sent out.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="trough" optional="0" type="int" />
			</arglist>
			<digest>
				Set a new trough value
			</digest>
			<description>
				In right inlet: The input is stored in <o>trough</o> as the new minimum value, and is sent out.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="trough.png" caption="Find the smallest in a series of numbers... Number in right inlet always sets a new trough" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="minimum" />
		<seealso name="peak" />
		<seealso name="&lt;" />
		<seealso name="datachapter02" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: New minimum values are sent out. (Numbers received in the right inlet are always the new minimum value.)
				<br />
				<br />
				Out middle outlet: If the number received is a new minimum value, the output is <m>1</m>. If the number received in the left inlet is not a new minimum value, the output is <m>0</m>.				<br />
				<br />
				Out right outlet: If the number received is a new minimum value, the output is <m>0</m>. If the number received in the left inlet is not a new minimum value, the output is <m>1</m>.
			</description>
		</entry>
	</misc>
</c74object>
