<?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="rate~" module="msp" category="MSP Modifiers">
	<digest>
		Time-scale the output of a phasor~
	</digest>
	<description>
		The <o>rate~</o> object accepts an input signal from a <o>phasor~</o> and time scales it by a multiplier received as a float in its right inlet. Numbers less than 1 create several ramps per phase cycle. Numbers greater than 1 create fewer ramps. This can be useful for implementing a <o>phasor~</o>-synchronized system in MSP.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Modifiers
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="float/signal">
			<digest>
				(float/signal) Rate Multiplier
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Time-Scaled Version of the Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="multiplier" optional="1" type="float">
			<digest>
				Multiplier value
			</digest>
			<description>
				The multiplier value used to scale the output signal.
			</description>
		</objarg>
		<objarg name="sync-mode-flag" optional="1" type="int">
			<digest>
				Sync mode
			</digest>
			<description>
				Sets the sync mode (see the <m>sync</m> message).
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="phase/multiplier" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet (<m>int</m> converted to <m>float</m>).
			</digest>
			<description>
				In left inlet: Sets the phase value for the <o>rate~</o> object's signal output.
				<br />
				<br />
				In right inlet: The signal multiplier value used to scale the <o>phasor~</o> signal input. Integer values greater than 1 create fewer ramps. This can be useful for synchronizing multiple processes to a single reference <o>phasor~</o> object, preserving their ratio relationships.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="phase/multiplier" optional="0" type="float" />
			</arglist>
			<digest>
				In left inlet: Sets the phase value for the <o>rate~</o> object's signal output
			</digest>
			<description>
				In left inlet: Sets the phase value for the <o>rate~</o> object's signal output.
				<br />
				<br />
				In right inlet: The signal multiplier value used to scale the <o>phasor~</o> signal input. Float values less than 1.0 create several ramps per phase cycle. Numbers greater than 1.0 create fewer ramps. This can be useful for synchronizing multiple processes to a single reference <o>phasor~</o> object, preserving their ratio relationships.
			</description>
		</method>
		<method name="goto">
			<arglist>
				<arg name="jump-to-value" optional="0" type="float" />
				<arg name="time-of-action" optional="1" type="float" />
			</arglist>
			<digest>
				Jump to a specified value
			</digest>
			<description>
				In left inlet: The word <m>goto</m>, followed by a float, causes the <o>rate~</o> object to jump immediately to the specified value. An optional second argument may be used to specify the time at which to jump to the value (e.g., <m>goto 1.0 .5</m> will output a value of 1.0 at the halfway point of the <o>phasor~</o> object's input signal ramp).
			</description>
		</method>
		<method name="oneshot">
			<arglist>
				<arg name="loop-flag (0 or nonzero)" optional="0" type="int" />
			</arglist>
			<digest>
				Enable output of a single ramp cycle
			</digest>
			<description>
				The message <m>oneshot 1</m> will turn on &quot;oneshot&quot;-mode whereby <o>rate~</o> outputs only one cycle of a ramp. The message <m>oneshot 0</m> will turn &quot;oneshot&quot;-mode off whereby <o>rate~</o> can cycle through ramps continuously when instructed to do so (i.e. by the <m>sync cycle</m> message).
			</description>
		</method>
		<method name="reset">
			<arglist />
			<digest>
				Lock the output to the input on the next reset
			</digest>
			<description>
				In left inlet: The word <m>reset</m> will lock the output to the input on its next reset. It is equivalent to the message <m>goto 0. 0</m>.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: An input signal from a <o>phasor~</o> object.
				<br />
				<br />
				In right inlet: The <o>rate~</o> object time scales the input signal from a <o>phasor~</o> by a multiplier value. The multiplier value can be specified as an argument or received as a float to the <o>rate~</o> object's right inlet.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="sync" get="1" set="1" type="int" size="1">
			<digest>
				Set the sync mode
			</digest>
			<description>
				Sets the sync mode of the <o>rate~</o> object. The sync mode determines whether or not the <o>rate~</o>&quot;in&quot; will stay in phase with the input signal, and the method used for synchronization. When the output of the <o>rate~</o> object is &quot;in phase,&quot; the input and output signals align precisely at the least common multiple of their periods (i.e., they pass through zero and begin a new cycle at precisely the same time). If the signals are in phase, and a new multiplier value is received, the <o>rate~</o> object changes the frequency of its output ramp accordingly. However, the change in multiplier values means that the two signals may be out of phase. The <o>rate~</o> object handles this situation in one of three different ways, depending on the sync mode
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="cycle">
							<digest>
								Set the cycle mode for sync
							</digest>
							<description>
								The arguments <m>@sync 0</m> or <m>@sync cycle</m> set the cycle mode of the <o>rate~</o> object. In cycle mode, the <o>rate~</o> object does not change the phase of its output until the end of the current cycle. When the input ramp reaches its peak and starts over from zero, the <o>rate~</o> object immediately restarts the output ramp, causing a discontinuity in the output signal, and immediate phase synchronization.
							</description>
						</enum>
						<enum name="lock">
							<digest>
								Set the lock mode for sync
							</digest>
							<description>
								The arguments <m>@sync 1</m> or <m>@sync lock</m> set the lock mode of the <o>rate~</o> object. In sync lock mode, the <o>rate~</o> object performs synchronization whenever a new multiplier is received. The <o>rate~</o> object immediately calculates the proper ramp position which corresponds to being &quot;in phase&quot; with the new multiplier value, and jumps to that position.
							</description>
						</enum>
						<enum name="off">
							<digest>
								Disable the sync mode
							</digest>
							<description>
								The arguments <m>@sync 2</m> or <m>@sync off</m> disables the sync mode of the <o>rate~</o> object (the default mode). In this mode <o>rate~</o> never responds to phase differences; when a new multiplier is received, the <o>rate~</o> object adjusts the speed of its output ramps and they continue without interruption. Since this mode never introduces a discontinuous jump in the ramp signal, it may be useful if phase is unimportant.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="rate~.png" caption="Use rate~ to generate synchronized waveforms or control sources" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="phasor~" />
		<seealso name="sync~" />
		<seealso name="techno~" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The synchronized signal is sent out the outlet.
			</description>
		</entry>
	</misc>
</c74object>
