<?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="sync~" module="msp" category="MSP Analysis">
	<digest>
		Synchronize MSP with an external source
	</digest>
	<description>
		<o>sync~</o> outputs a 0-1 ramp, like <o>phasor~</o>. The frequency of the ramp can be specified in beats per minute (BPM), or by sending <o>sync~</o> a tempo reference via tap tempo, MIDI beat clock, or an audio signal containing a 'click track.' Also, <o>sync~</o> generates MIDI beat clock to synchronize external devices.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Analysis
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				synchronization input and messages to sync~
			</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>
				synchronized ramp (0-1)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				BPM and beat detect information
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				MIDI beat clock
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Set the tap tempo
			</digest>
			<description>
				A sequence of <m>bang</m> messages is used to set the tap tempo. A <m>bang</m> message is interpreted as one tap. If the <o>sync~</o> object receives three taps in a row with reasonably consistent timing, it changes the tempo to match them.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="MIDI-data" optional="0" type="int" />
			</arglist>
			<digest>
				Use MIDI beat clock
			</digest>
			<description>
				MIDI beat clock. Integer input is interpreted as MIDI data - you can directly connect the output of an <o>rtin</o> object. <o>sync~</o> responds to MIDI beat clock start/stop (int 250 and 252), and tick (248). All other values are ignored.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="beats-per-minute" optional="0" type="float" />
			</arglist>
			<digest>
				Set the BPM for the clock
			</digest>
			<description>
				Sets the BPM for the clock.
			</description>
		</method>
		<method name="bpm">
			<arglist>
				<arg name="bpm-rate" optional="0" type="float" />
			</arglist>
			<digest>
				Set the output ramp to match a bpm rate
			</digest>
			<description>
				The word <m>bpm</m>, followed by a number, sets the rate of the current output ramp to a frequency corresponding to the specified beats/minute.
			</description>
		</method>
		<method name="midioffset">
			<arglist>
				<arg name="output-phase" optional="0" type="float" />
			</arglist>
			<digest>
				Adjust the MIDI output &quot;phase&quot; of the output ramp
			</digest>
			<description>
				The word <m>offset</m>, followed by a floating point number in the range 0.-1.0, adjusts the MIDI output &quot;phase&quot; of the current output ramp.
			</description>
		</method>
		<method name="offset">
			<arglist>
				<arg name="ramp-phase" optional="0" type="float" />
			</arglist>
			<digest>
				Adjust the output &quot;phase&quot; of the output ramp
			</digest>
			<description>
				The word <m>offset</m>, followed by a floating point number in the range 0.-1.0, adjusts the &quot;phase&quot; of the current output ramp.
			</description>
		</method>
		<method name="ppq">
			<arglist>
				<arg name="number-of-ticks-per-quarter-note" optional="0" type="int" />
			</arglist>
			<digest>
				Set the number of ticks output per quarter note
			</digest>
			<description>
				The word <m>ppq</m> (parts per quarter), followed by a number, specifies the number of ticks output for each quarter note. By default, MIDI beat clock specifies a PPQ of 24. The <m>ppq</m> message is useful mainly for doubling or halving the tempo for an external device that is set to a different time signature. The ramp signal generated by the <o>sync~</o> object can be scaled for output further by using the <o>rate~</o> object.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Set the tempo to match an audio click track input
			</digest>
			<description>
				The <o>sync~</o> object will set its tempo to match an audio click track input. The click track should contain amplitude peaks at quarter-note intervals of the desired tempo. Signal input will affect the tempo only if <o>sync~</o> detects peak values greater than 0.1 and within the tempo range of approximately 30-240 BPM.
			</description>
		</method>
		<method name="start">
			<arglist />
			<digest>
				Stop current ramp output and reset to 0
			</digest>
			<description>
				The word <m>start</m> causes the current output ramp to halt, and resets the ramp to 0. The <m>start</m> message has the same effect as receiving the MIDI beat clock start value (250). When the <m>start</m> message is received, <o>sync~</o> outputs the number 250 from the MIDI beat clock output so that any external devices will also start.
			</description>
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stop current ramp output and remain stationary
			</digest>
			<description>
				The word <m>stop</m> causes the current output ramp to halt, and to remain stationary until a <m>start</m> message is received. It is equivalent to sending the MIDI beat clock stop value (252). When the <m>stop</m> message is received, the <o>sync~</o> object sends the number 252 from its MIDI beat clock output. The <o>sync~</o> object does not send MIDI beat clock ticks while it is stopped.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="sync~.png" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="midiout" />
		<seealso name="phasor~" />
		<seealso name="rate~" />
		<seealso name="rtin" />
		<seealso name="seq" />
		<seealso name="transport" />
		<seealso name="wave~" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				Left outlet: Like the <o>phasor~</o>-object, the <o>sync~</o> object generates a sawtooth waveform that increases from 0 to 1 for each quarter note of the current tempo. This ramp can be scaled as necessary with the <o>rate~</o> object, for use with <o>wave~</o> and other objects.
			</description>
		</entry>
		<entry name="bpm">
			<description>
				Out middle outlet: Whenever the tempo changes, <o>sync~</o> outputs the message <m>bpm</m>, followed by a float value that specifies the new tempo.
			</description>
		</entry>
		<entry name="tap">
			<description>
				Out middle outlet: When the <o>sync~</o> object receives a tap, it sends a <m>tap</m> message out the middle outlet.
			</description>
		</entry>
		<entry name="click">
			<description>
				Out middle outlet: When the <o>sync~</o> object receives an audio click, it sends a <m>click</m> message out the middle outlet.
			</description>
		</entry>
		<entry name="midi">
			<description>
				Out middle outlet: When the <o>sync~</o> object receives a MIDI beat clock tick, it sends a <m>midi</m> message out the middle outlet.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out right outlet: <o>sync~</o> generates a MIDI beat clock stream that matches its output ramp. Typically, when needed, this outlet is connected directly to a <o>midiout</o> object.
			</description>
		</entry>
	</misc>
</c74object>
