<?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="change" module="max" category="Control">
	<digest>
		Filter out repetitions of a number
	</digest>
	<description>
		Output a number only if it is different from the stored number and will reset the stored number to that differing input number. Alternate modes of operation also identify greater-than or less-than the conditions.
	</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>
				Repeated to Output if Number Changes
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Number if it Changes
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				1 for Logical Transition from 0 to Non-Zero
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				1 for Logical Transition from Non-Zero to 0
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="initial-value" optional="1" type="int or float">
			<digest>
				Set the initial stored value
			</digest>
			<description>
				Sets the initial value for comparison to incoming numbers. If there is no argument, the initial value is <m>0</m>.
			</description>
		</objarg>
		<objarg name="mode" optional="1" type="symbol">
			<digest>
				Set detection mode
			</digest>
			<description>
				A second argument may be <m>+</m> or <m>-</m>, a change to <m>mode +</m> or <m>mode -</m>. Subsequent <m>mode</m> messages can change this behavior.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Send value if changed
			</digest>
			<description>
				The number is sent out the outlet only if it is different from the currently stored value. Replaces the stored value.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Send value if changed
			</digest>
			<description>
				Outputs the number only if it is different from the currently stored value. Replaces the stored value.
			</description>
		</method>
		<method name="mode">
			<arglist>
				<arg name="flag (+ or -)" optional="0" type="symbol" />
			</arglist>
			<digest>
				Set detection mode
			</digest>
			<description>
				Sets the detection mode of <o>change</o>. The word <m>mode</m>, followed by a <m>+</m>, causes <o>change</o> to send a <m>1</m> out its left outlet if the received number is greater than the previously received number.
				<br />
				The word <m>mode</m>, followed by a <m>-</m>, causes <o>change</o> to send out a <m>-1</m> if the received number is less than the previously received number.
				<br />
				The word <m>mode</m> by itself returns <o>change</o> to its default mode of sending out received values that differ from the previously received input.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="stored value" optional="0" type="number" />
			</arglist>
			<digest>
				Replace stored value
			</digest>
			<description>
				Replaces the stored value without triggering output.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="change.png" caption="Filter out undesirable repetitions" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="peak" />
		<seealso name="togedge" />
		<seealso name="trough" />
		<seealso name="basicchapter15" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: The number received in the inlet is sent out only if it is different from the stored value.
				<br />
				<br />
				Out middle outlet: If the stored value is 0 and the input is not 0, <m>1</m> is sent out; otherwise nothing is sent out.
				<br />
				<br />
				Out right outlet: If the stored value is not 0 and the input is 0, <m>1</m> is sent out; otherwise nothing is sent out.
			</description>
		</entry>
	</misc>
</c74object>
