<?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="phasor~" module="msp" category="MSP Synthesis">
	<digest>
		Generate sawtooth signals
	</digest>
	<description>
		Use the <o>phasor~</o> object to generate sawtooth waves suitable for sample-accurate control and timing tasks. For smoother sounding sawtooth generation, use the bandlimited <o>saw~</o> object instead. The ramp rate can be set by frequency (Hz), or as an interval using the tempo-relative Max <link name="maxtime" module="core" type="vignette">time format</link> syntax.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Synthesis
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal/float/symbol">
			<digest>
				Frequency or Time Period
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="float">
			<digest>
				Phase
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output (ramp cycle from 0 to 1)
			</digest>
			<description>
				Note the output rarely reaches 0 or 1 so that the frequency and phase will remain sample-accurate.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="initial-frequency" optional="1" units="time-value" type="list">
			<digest>
				S Initial frequency
			</digest>
			<description>
				Set the initial frequency in Hz, or as an interval using the tempo-relative Max <link name="maxtime" module="core" type="vignette">time format</link> syntax.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Force frequency to update
			</digest>
			<description>
				When <at>syncupdate</at> is set to 1 <b><i>and</i></b> there is no signal input connected to the left inlet, a bang in the left inlet will force the frequency to update immediately (instead of waiting for the phase cycle to end and jump back to 0).
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="frequency" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Set the frequency of the sawtooth waveform (Hz). If a signal is connected to this inlet, this message is ignored.
				<br />
				<br />
				In right inlet: Set the phase of the waveform (from 0 to 1). Signal output continues from this phase.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="frequency" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Set the frequency of the sawtooth waveform (Hz). If a signal is connected to this inlet, this message is ignored.
				<br />
				<br />
				In right inlet: Set the phase of the waveform (from 0 to 1). Signal output continues from this phase.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="transport/time-settings" optional="0" units="time-value" type="list" />
			</arglist>
			<digest>
				Set ramp interval in Max <link name="maxtime" module="core" type="vignette">time format</link>.
			</digest>
			<description />
		</method>
		<method name="anything">
			<arglist>
				<arg name="transport/time-settings" optional="0" units="time-value" type="list" />
			</arglist>
			<digest>
				Set ramp interval in Max <link name="maxtime" module="core" type="vignette">time format</link>.
			</digest>
			<description />
		</method>
		<method name="reset">
			<arglist />
			<digest>
				Set the phase to the <at>phaseoffset</at> value.
			</digest>
			<description>
				The <m>reset</m> message immediately sets the phase to the value of the <at>phaseoffset</at> attribute.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Set frequency in Hz
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="frequency" get="1" set="1" type="Time Value" size="1">
			<digest>
				Ramp rate or interval
			</digest>
			<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="Frequency" />
				<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="jitter" get="1" set="1" type="float" size="1">
			<digest>
				Frequency Jitter
			</digest>
			<description>
				The <at>jitter</at> attributes sets the range of random frequency variation on each phase reset. The frequency deviation above and below will be 1/100th of the value of <at>jitter</at> times the frequency. Example: if the current frequency is 440 and <at>jitter</at> is 1.0, <o>phasor~</o> will generate random frequencies between 439.56 and 440.44 Hz. <at>jitter</at> only applies when a signal is not connected to the frequency inlet and the <at>lock</at> attribute is disabled.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Frequency Jitter" />
			</attributelist>
		</attribute>
		<attribute name="limit" get="1" set="1" type="float" size="1">
			<digest>
				Jitter Limit
			</digest>
			<description>
				The <at>limit</at> attribute sets an absolute amount by which the frequency can vary from its set value as a result of a non-zero <at>jitter</at> attribute. If <at>jitter</at> is reduced, the frequency may be changed gradually to bring it closer to the set value.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Jitter Limit" />
			</attributelist>
		</attribute>
		<attribute name="lock" get="1" set="1" type="int" size="1">
			<digest>
				Frequency lock enable
			</digest>
			<description>
				When <at>lock</at> is set to 1, the <o>phasor~</o> is synchronized to the Max (or Max for Live) transport. When the transport is off, the <o>phasor~</o> will output a frequency of zero. For accurate timing, 'Scheduler in Overdrive' and 'in Audio Interrupt' must be enabled.  These settings can be changed in 'Options'-&gt; <link name="audio_status" module="core" type="vignette">'Audio Status'</link>. The <at>lock</at> attribute will only accept frequencies specified using notevalues.
			</description>
			<attributelist>
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="phaseoffset" get="1" set="1" type="float" size="1">
			<digest>
				Phase Offset
			</digest>
			<description>
				The <at>phaseoffset</at> attribute sets the initial phase when audio is turned on as well as the phase assigned when <o>phasor~</o> receives the <m>reset</m> message. The <at>phaseoffset</at> is useful when decorrelating multiple instances within an <o>mc.phasor~</o>. If the <at>phaseoffset</at> attribute has never been set or the word <at>phaseoffset</at> is sent with no arguments, the initial phase will nor be changed when audio processing is started. When you set the phase with a <m>float</m> in the right inlet, it is an immediate change but it only happens once. The <at>phaseoffset</at> attribute makes it possible to set up repeatable phase relationships between multiple <o>phasor~</o> objects or when using <o>mc.phasor~</o>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Phase Offset" />
			</attributelist>
		</attribute>
		<attribute name="syncupdate" get="1" set="1" type="int" size="1">
			<digest>
				Sync Frequency Update
			</digest>
			<description>
				When <at>syncupdate</at> is set to 1, the <o>phasor~</o> frequency is only set at the end of its cycle, when the phase jumps to 0. In this mode, <o>phasor~</o> will not instantly change its slope when it receives a frequency change, but will instead wait until the phase resets. This can prevent typical pitch glitches when reading from a buffer.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Sync Frequency Update" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="transport" get="1" set="1" type="symbol" size="1">
			<digest>
				Transport
			</digest>
			<description>
				This attribute names a time <o>transport</o>. If frequency is specified using a 'relative' unit (for example: ticks, bars.beats.units, or notevalues), then the named <o>transport</o> is used to determine the frequency based on tempo, time-signature, and other related information. The default value is the global 'internal' transport.
			</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="frequency" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="phasor~.png" caption="A repeating ramp is useful both at audio and at sub-audio frequencies" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="2d.wave~" />
		<seealso name="cycle~" />
		<seealso name="line~" />
		<seealso name="saw~" />
		<seealso name="sync~" />
		<seealso name="techno~" />
		<seealso name="transport" />
		<seealso name="trapezoid~" />
		<seealso name="triangle~" />
		<seealso name="updown~" />
		<seealso name="wave~" />
		<seealso name="05_mspbasicchapter03" module="msp" type="tutorial" />
		<seealso name="07_samplingchapter04" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				Waveform that increases from 0 to 1 repeatedly at the specified frequency.
			</description>
		</entry>
	</misc>
</c74object>
