<?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="thresh" module="max" category="Lists, Timing">
	<digest>
		Combine numbers and lists when received close together
	</digest>
	<description>
		Collects items into a list if they appear within a certain specifiable amount of time. Each time an item arrives, the time is reset.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Lists
		</metadata>
		<metadata name="tag">
			Timing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Numbers to be Gathered Into list
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Arrival Threshold
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Gathered list
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="threshold" optional="1" type="int">
			<digest>
				Initial threshold time
			</digest>
			<description>
				Sets an initial value for the threshold time. If no argument is present, the initial value is 10 milliseconds.
			</description>
		</objarg>
		<objarg name="threshold-time" optional="1" type="float">
			<digest>
				Initial threshold time
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Append to current list
			</digest>
			<description>
				In left inlet: Numbers and lists are combined into a list if received within a certain time of each other. When the time between incoming numbers is greater than the specified threshold, the list is sent out the outlet, and a new list is started.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Numbers and lists are combined into a list if received within a certain time of each other. When the time between incoming numbers is greater than the specified threshold, the list is sent out the outlet, and a new list is started.
				<br />
				<br />
				In right inlet: The number is stored as the time, in milliseconds, to wait before sending out the compiled list of numbers. If no new number is received in the left inlet within that time, the list is sent out and a new list is started.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Append to current list
			</digest>
			<description>
				In left inlet: The entire list is appended to the list stored in <o>thresh</o>.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="threshold" optional="0" type="int" />
			</arglist>
			<digest>
				Set threshold time
			</digest>
			<description>
				In right inlet: The number is stored as the time, in milliseconds, to wait before sending out the compiled list of numbers. If no new number is received in the left inlet within that time, the list is sent out and a new list is started.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="thresh.png" caption="If threshold time is exceeded without a new number being received, thresh sends out what it holds" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bondo" />
		<seealso name="buddy" />
		<seealso name="iter" />
		<seealso name="join" />
		<seealso name="pack" />
		<seealso name="quickthresh" />
		<seealso name="zl" />
	</seealsolist>
	<misc name="Output">
		<entry name="list">
			<description>
				Each number or lists received in the left inlet is appended to a list stored by <o>thresh</o>. If a certain time passes without a new number being received, <o>thresh</o> sends out the list and starts a new list.
			</description>
		</entry>
	</misc>
</c74object>
