<?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="peak" module="max" category="Control">
	<digest>
		Output larger numbers
	</digest>
	<description>
		Compares a number to a previous peak-value and, if larger, it is sent out the output while the new peak-value is set to that number.
	</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 highest number (the peak)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Sets the peak
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				The highest number so far
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Goes high for a new peak
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Goes high for a number that isn't a new peak
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="format" optional="1" type="float">
			<digest>
				Floating-point output
			</digest>
			<description>
				The initial value stored in <o>peak</o> is <m>0</m>. Providing a float argument will cause peak to operate with floating point numbers instead of integers.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Send current peak value
			</digest>
			<description>
				Sends the currently stored peak value out the left outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Output if peak value
			</digest>
			<description>
				In left inlet: If the input is greater than the value currently stored in <o>peak</o>, it is stored as the new peak value and is sent out.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Output if peak value
			</digest>
			<description>
				In left inlet: If the input is greater than the value currently stored in <o>peak</o>, it is stored as the new peak value and is sent out.
			</description>
		</method>
		<method name="ft1">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Set new peak value
			</digest>
			<description>
				In right inlet: The number is stored in peak as the new peak value, and is sent out.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Set new peak value
			</digest>
			<description>
				In right inlet: The number is stored in peak as the new peak value, and is sent out.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="number" />
				<arg name="peak" optional="0" type="number" />
			</arglist>
			<digest>
				Input both values
			</digest>
			<description>
				In left inlet: The second number is stored as the new peak value and is sent out, then the first number is received in the left inlet.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="peak.png" caption="Find the greatest in a series of numbers... A number in the right inlet always sets a new peak" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="maximum" />
		<seealso name="past" />
		<seealso name="trough" />
		<seealso name="&gt;" />
		<seealso name="datachapter02" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: New peak values are sent out. (A number received in the right inlet is always the new peak value.)
				<br />
				<br />
				Out middle outlet: If the number received is a new peak value, the output is <m>1</m>. If the number received in the left inlet is not a new peak value, the output is <m>0</m>.				<br />
				<br />
				Out right outlet: If the number received is a new peak value, the output is <m>0</m>. If the number received in the left inlet is not a new peak value, the output is <m>1</m>.
			</description>
		</entry>
	</misc>
</c74object>
