<?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="count~" module="msp" category="MSP Analysis, MSP Functions">
	<digest>
		Count samples elapsed
	</digest>
	<description>
		Use the <o>count~</o> object count samples elapsed and thus drive processes tightly synchronized to the sample rate. It outputs a signal increasing by 1 for each sample elapsed. It can be set to loop, and can be used to drive objects such as <o>index~</o> with sample accuracy.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Analysis
		</metadata>
		<metadata name="tag">
			MSP Functions
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				int, bang Start Count, stop Stops It
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				int sets Count Limit
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Count Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="initial-value" optional="1" default="0" units="samples" type="int">
			<digest>
				Counter initial value
			</digest>
			<description />
		</objarg>
		<objarg name="count-limit" optional="1" default="0" units="samples" type="int">
			<digest>
				Counter limit
			</digest>
			<description>
				Set a count limit for a looping counter, or 0 for no count limit. Note that the limit value is never reached.
			</description>
		</objarg>
		<objarg name="enable" optional="1" type="int">
			<digest>
				Count enabled flag
			</digest>
			<description>
				Specify whether the <o>count~</o> object is off (0) or on (1) initially.
			</description>
		</objarg>
		<objarg name="autoreset-state" optional="1" type="int">
			<digest>
				Autoreset flag
			</digest>
			<description>
				When enabled, the internal counter is reset to the initial value whenever audio is turned on (see the <m>autoreset</m> message).
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Reset to initial and begin counting
			</digest>
			<description />
		</method>
		<method name="int">
			<arglist>
				<arg name="initial-value" optional="0" units="samples" type="int" />
			</arglist>
			<digest>
				Set initial value, reset, and begin counting
			</digest>
			<description />
		</method>
		<method name="float">
			<arglist>
				<arg name="initial-value/count-limit" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Left inlet: Set initial value without reset
				<br />
				<br />
				Right inlet: Set limit value without reset
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="initial-value" optional="0" units="samples" type="int" />
				<arg name="count-limit" optional="0" units="samples" type="int" />
				<arg name="enable" optional="0" type="int" />
				<arg name="autoreset-state" optional="0" type="int" />
			</arglist>
			<digest>
				Set initial, limit, enable and autoreset state
			</digest>
			<description />
		</method>
		<method name="in1">
			<arglist>
				<arg name="count-limit" optional="0" type="int" />
			</arglist>
			<digest>
				Set counter limit
			</digest>
			<description>
				Set limit value. A value of 0 eliminates the counter limit.
			</description>
		</method>
		<method name="min">
			<arglist>
				<arg name="initial-count" optional="0" type="int" />
			</arglist>
			<digest>
				Set initial value without reset
			</digest>
			<description />
		</method>
		<method name="set">
			<arglist>
				<arg name="initial-count" optional="0" type="int" />
			</arglist>
			<digest>
				Set initial value without reset
			</digest>
			<description />
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Enable counting with non-zero signal
			</digest>
			<description />
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Reset to initial value
			</digest>
			<description />
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="autoreset" get="1" set="1" type="int" size="1">
			<digest>
				Autoreset enable
			</digest>
			<description>
				Reset the counter to the initial value when audio turns on
			</description>
			<attributelist>
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="count~.png" caption="Send out a running count of the passing samples, beginning at a given point" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="index~" />
		<seealso name="mstosamps~" />
		<seealso name="sampstoms~" />
		<seealso name="+=~" />
		<seealso name="counter" />
		<seealso name="07_samplingchapter01" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				When the audio is first turned on, <o>count~</o> always sends out its current initial value. When a <m>bang</m> or <m>int</m> is received, the count begins increasing from the current initial value.
			</description>
		</entry>
	</misc>
</c74object>
