<?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="hostsync~" module="msp" category="MSP Plug-ins">
	<digest>
		Get transport control info from a ReWire host
	</digest>
	<description>
		The <o>hostsync~</o> object provides information about the current state of the ReWire host.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Plug-ins
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				bang polls info
			</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="int">
			<digest>
				Transport State (1 = Play, 0 = Off)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="int">
			<digest>
				Current bar count (1 = song start)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="int">
			<digest>
				Current beat count (1 = measure start)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="float">
			<digest>
				Fractional position within a beat (0 - 1)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="4" type="list">
			<digest>
				Time Signature (num den)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="5" type="float">
			<digest>
				Tempo (samples per beat)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="6" type="float">
			<digest>
				Ticks from song start (1 PPQ)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="7" type="int">
			<digest>
				Sample count
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="8" type="list">
			<digest>
				Loop info (state startpos stoppos)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="9" type="int">
			<digest>
				Flags indicating which data are valid
			</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>
				Report the transport state
			</digest>
			<description>
				<m>bang</m> will cause the <o>hostsync~</o> object to report its transport state.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="hostcontrol~" />
		<seealso name="hostphasor~" />
	</seealsolist>
	<discussion>
		Sample count information is available in any host; even Max. The validity of the other information output by the object is dependent upon what synchronization capabilities the ReWire host implements; the value from the flags (10th) outlet tells you what information is valid. Output from <o>hostsync~</o> is continuous when the scheduler is running. Alternatively, you can bang its inlet to report the current values.
	</discussion>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: <m>1</m> if the ReWire host's transport is currently running; <m>0</m> if it is stopped or paused.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 2nd outlet: The current bar count in the ReWire host sequence, starting at 1 for the first bar. If the ReWire host does not support synchronization, there is no output from this outlet.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 3rd outlet: The current beat count in the ReWire host sequence, starting at 1 for the first beat. If the ReWire host does not support synchronization, there is no output from this outlet.
			</description>
		</entry>
		<entry name="float">
			<description>
				Out 4nd outlet: The current beat fraction, from 0 to 1.0. If the ReWire host does not support synchronization, there is no output from this outlet.
			</description>
		</entry>
		<entry name="list">
			<description>
				Out 5th outlet: The current time signature as a list containing numerator followed by denominator. For instance, 3/4 time would be output as the list <m>3 4</m>. If the ReWire host does not support time signature information, there is no output from this outlet.
			</description>
		</entry>
		<entry name="float">
			<description>
				Out 6th outlet: The current tempo in samples per beat. This number can be converted to beats per minute using the following formula: (sampling-rate / samples-per-beat) * 60. If the ReWire host does not support synchronization, there is no output from this outlet.
			</description>
		</entry>
		<entry name="float">
			<description>
				Out 7th outlet: The current number of beats, expressed in 1 PPQ. This number will contain a fractional part between beats. If the ReWire host does not support synchronization, there is no output from this outlet.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 8th outlet: The current sample count, as defined by the ReWire host.
			</description>
		</entry>
		<entry name="list">
			<description>
				Out 9th outlet: The loop info output as a list of three numbers containing loop on/off state (0,1), the loop start point (in 1PPQ ticks), and the loop stop point (in 1PPQ ticks). For example, if the time signature was 4/4 and looping was on from the start of the fifth measure for four bars the list would be 1 16 32.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 10th outlet: A number representing the validity of the other information coming from <o>hostsync~</o>. Mask with the following values to determine if the information from <o>hostsync~</o> will be valid.
				<br />
				<br />
				Sample Count Valid 1 (always true)
				<br />
				<br />
				Beats Valid 2 (2nd, 3rd, 4th, and 7th outlets valid)
				<br />
				<br />
				Time Signature Valid 4 (5th outlet valid)
				<br />
				<br />
				Tempo Valid 8 (6th outlet valid)
				<br />
				<br />
				Transport Valid 16 (left outlet valid)
				<br />
				<br />
				Loop Info Valid 64 (9th outlet valid)
			</description>
		</entry>
	</misc>
</c74object>
