<?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="metro" module="max" category="Timing">
	<digest>
		Output a bang message at regular intervals
	</digest>
	<description>
		Acts as a metronome which outputs <m>bang</m> s at a regular, specified interval. This object uses the Max <link name="maxtime" module="core" type="vignette">time format</link> syntax, so the interval that the <o>metro</o> object uses can be either fixed or tempo-relative.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			time
		</metadata>
		<metadata name="tag">
			Timing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Start/Stop Metronome
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Set Metronome Time Interval
			</digest>
			<description>
				Sets the delay time for the object. Delay time can be specified in any of the <link name="maxtime" module="core" type="vignette">time formats</link> used in Max.
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Output Ticks of Metronome
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="interval" optional="1" units="ms" type="number">
			<digest>
				Output interval
			</digest>
			<description>
				The optional first argument sets an initial value for the time interval at which <o>metro</o> sends its output. This time interval can be either a number which specifies time in milliseconds (e.g. metro 100) or <link name="maxtime_syntax" module="core" type="vignette">notevalue</link> (e.g. metro 4n).
				<br />
				<br />
				Note: While the <o>metro</o> object lets you specify time in any of Max's standard <link name="maxtime" module="core" type="vignette">time formats</link>, the <m>interval</m> attribute argument should be used when specifying time in any other time unit besides milliseconds or notevalues (e.g. <m>metro @interval 11025 samples</m>).
				<br />
				<br />
				If there is no argument, the initial time interval is 5 milliseconds.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Start the clock
			</digest>
			<description>
				In left inlet: starts the <o>metro</o> object.
			</description>
			<attributelist>
				<attribute name="inlet" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Turn metro on/off or set the time interval
			</digest>
			<description>
				In left inlet: Any number other than 0 starts the <o>metro</o> object. At regular intervals, <o>metro</o> sends a <m>bang</m> out the outlet. <m>0</m> stops <o>metro</o>.				<br />
				<br />
				In right inlet: The number is the time interval, in milliseconds, at which <o>metro</o> sends out a <m>bang</m>. A new number in the right inlet does not take effect until the next output is sent.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Set the time interval
			</digest>
			<description>
				Performs the same function as <m>int</m>.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				ITM-time-list
			</digest>
			<description>
				In right inlet: A list may be used to specify time in one of the Max <link name="maxtime" module="core" type="vignette">time formats</link>.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="interval" optional="0" type="list" />
			</arglist>
			<digest>
				ITM-time-list
			</digest>
			<description>
				Same as <m>list</m>.
			</description>
			<attributelist>
				<attribute name="inlet" get="1" set="1" type="int" size="1" value="2" />
			</attributelist>
		</method>
		<method name="clock">
			<arglist>
				<arg name="name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Select a clock source
			</digest>
			<description>
				The word <m>clock</m>, followed by the name of an existing <m>setclock</m> object, sets the <o>metro</o> object to be controlled by that <m>setclock</m> object rather than by Max’s internal millisecond clock. The word <m>clock</m> by itself sets the <o>metro</o> object back to using Max’s regular millisecond clock.
			</description>
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stop the clock
			</digest>
			<description>
				In left inlet: Stops <o>metro</o>.
			</description>
			<attributelist>
				<attribute name="inlet" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="active" get="1" set="1" type="int" size="1">
			<digest>
				Activation flag
			</digest>
			<description>
				Turns the metro on and off.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Active" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="autostart" get="1" set="1" type="int" size="1">
			<digest>
				Automatic activation
			</digest>
			<description>
				If turned on (non-zero) the metro will begin running automatically at the time specified with the autostarttime attribute.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Autostart" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="autostarttime" get="1" set="1" type="atom" size="10">
			<digest>
				Autostart time
			</digest>
			<description>
				If the autostart attribute is enabled (non-zero) the metro will begin running automatically at the time specified with the this attribute. The autostart operates as a <o>timepoint</o> object that is internal to metro.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Autostart Time" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="time" />
				<attribute name="units" get="1" set="1" type="atom" size="3" value="ticks bars.beats.units notevalues" />
			</attributelist>
		</attribute>
		<attribute name="defer" get="1" set="1" type="float" size="1">
			<digest>
				Deferral flag
			</digest>
			<description>
				Turn this on to send output in the low-priority queue.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Defer" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
				<attribute name="timeobj" get="1" set="1" type="atom" size="1" value="interval" />
			</attributelist>
		</attribute>
		<attribute name="interval" get="1" set="1" type="atom" size="10">
			<digest>
				Output time interval
			</digest>
			<description>
				Sets the The time interval at which <o>metro</o> sends out a <m>bang</m>. Time can be specified in any of the <link name="maxtime" module="core" type="vignette">time formats</link> used in Max.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Interval" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="time" />
				<attribute name="units" get="1" set="1" type="atom" size="7" value="ms hh:mm:ss ticks bars.beats.units notevalues hz samples" />
			</attributelist>
		</attribute>
		<attribute name="quantize" get="1" set="1" type="atom" size="10">
			<digest>
				Time quantization
			</digest>
			<description>
				Send output only on the specified time-boundary if appropriate. This is achieved by making internal adjustments to the times used for sending output. The quantization can be specified in the following <link name="maxtime" module="core" type="vignette">time formats</link>: bars.beats.units, ticks or note values.
				<br />
				<br />
				If the applicable time is a 'fixed' unit (for example: ms, seconds, hz, samples, etc.) then this attribute will have no effect.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Quantization" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="time" />
				<attribute name="units" get="1" set="1" type="atom" size="3" value="ticks bars.beats.units notevalues" />
			</attributelist>
		</attribute>
		<attribute name="transport" get="1" set="1" type="symbol" size="1">
			<digest>
				Attached transport name
			</digest>
			<description>
				This attribute names a master time transport. If the time is specified using a 'relative' unit (for example: ticks, bars.beats.units, or notevalues), then the named transport is used to determine delay times based on tempo, time-signature, and other related information.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Transport" />
				<attribute name="timeobj" get="1" set="1" type="atom" size="1" value="interval" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="metro.png" caption="Repeatedly send a message or trigger a process" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="clocker" />
		<seealso name="counter" />
		<seealso name="cpuclock" />
		<seealso name="delay" />
		<seealso name="setclock" />
		<seealso name="tempo" />
		<seealso name="transport" />
		<seealso name="uzi" />
		<seealso name="basicchapter04" module="max" type="tutorial" />
	</seealsolist>
	<discussion>
		The object's output can be quantized using tempo-relative syntax, and if the <i>autostarttime</i> attribute is set, the object can also start at a tempo-relative point.
	</discussion>
	<misc name="Output">
		<entry name="bang">
			<description>
				<m>bang</m> is sent immediately when <o>metro</o> is started, and at regular intervals thereafter.
			</description>
		</entry>
	</misc>
</c74object>
