<?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="tempo" module="max" category="Timing">
	<digest>
		Output numbers at a metronomic tempo
	</digest>
	<description>
		Produces metronomic output controllable in beats per minute, and with specifiable whole-note divisions.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</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>
				Tempo in Beats Per Minute
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				Beat Multiplier
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="3" type="INLET_TYPE">
			<digest>
				Beat Divisions of a Whole Note
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Beat Count at Current Tempo
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="tempo" optional="1" type="int or float">
			<digest>
				Initial tempo
			</digest>
			<description>
				The first argument sets an initial tempo, from 5 to 300 beats per minute. If there is no argument, the initial tempo is 120 beats per minute. The second argument is the beat multiplier and is set to <m>1</m> by default. The third argument sets an initial rhythmic value of the output, from a whole note (<m>1</m>) to a 64th note triplet (<m>96</m>). If the argument is not present, the initial value is <m>16</m>.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Start metronome output
			</digest>
			<description>
				In left inlet: Starts the <o>tempo</o> object's metronome process, or restarts it if <o>tempo</o> is already on.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Converted to <m>float</m>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: If the number is not 0, it has the same effect as bang. If the number is 0, it has the same effect as stop.
				<br />
				<br />
				In 2nd inlet: The number is stored as the tempo, in beats per minute (quarter notes per minute).
				<br />
				<br />
				In 3rd inlet: The number is a beat multiplier, which can lengthen the amount of time taken for one beat. It slows the tempo down by a factor. For example, a multiplier of <m>2</m> will make <o>tempo</o> send out its output half as fast.
				<br />
				<br />
				In right inlet: The number is the rhythmic value sent out by <o>tempo</o>, specified as a fraction of a whole note. For example, the number 8 causes <o>tempo</o> to output eighth notes, relative to the specified (quarter note) tempo. The numbers sent out the outlet cycle continuously between 0 and the number 1 less than the rhythmic value. The divisions of a whole note must be between 1 and 96.
			</description>
		</method>
		<method name="clock">
			<arglist>
				<arg name="name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Choose a clock object for timing
			</digest>
			<description>
				The word <m>clock</m>, followed by the name of an existing <m>setclock</m> object, sets the <o>tempo</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>tempo</o> object back to using Max’s regular millisecond clock.
			</description>
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stop metronome output
			</digest>
			<description>
				In left inlet: Stops <o>tempo</o>.
			</description>
		</method>
		<method name="tempo">
			<arglist>
				<arg name="tempo" optional="0" type="list" />
			</arglist>
			<digest>
				Set current tempo
			</digest>
			<description>
				In left inlet: The word <m>tempo</m>, followed by a float, sets the current tempo to the number.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="tempo.png" caption="The tempo (60) defines the speed of a quarter note, division defines the pulse to be sent out" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="clocker" />
		<seealso name="metro" />
		<seealso name="setclock" />
		<seealso name="midichapter04" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				When <o>tempo</o> is started it outputs numbers in a continuous cycle from 0 to the number 1 less than the specified rhythmic value. The speed at which the numbers are sent out is determined by the tempo (quarter note beats per minute) and the rhythmic value of the output (fraction of a whole note).
			</description>
		</entry>
	</misc>
</c74object>
