<?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="rect~" module="msp" category="MSP Synthesis">
	<digest>
		Antialiased rectangular (pulse) oscillator
	</digest>
	<description>
		Use the <o>rect~</o> object to generate an anti-aliased rectangle wave.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			oscillator
		</metadata>
		<metadata name="tag">
			MSP Synthesis
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal/float">
			<digest>
				(signal/float) frequency
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				(signal/float) duty cycle
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal">
			<digest>
				(signal) sync input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="frequency" optional="1" type="number">
			<digest>
				Initial frequency
			</digest>
			<description>
				First argument sets the initial frequency of the oscillator. The default is 0.
			</description>
		</objarg>
		<objarg name="pulse-width" optional="1" type="number">
			<digest>
				Pulse width
			</digest>
			<description>
				An optional second argument sets the pulse width. The default is 0.5.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="frequency" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Sets the frequency of the oscillator.
				<br />
				<br />
				In middle inlet: Sets the pulse width of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="frequency" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Sets the frequency of the oscillator.
				<br />
				<br />
				In middle inlet: Sets the pulse width of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Sets the frequency of the oscillator.
				<br />
				<br />
				In middle inlet: Sets the pulse width of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.
				<br />
				<br />
				In right inlet: (optional) A sync signal. When the control signal crosses from below 0.5 to above 0.5, the oscillator resets itself. A <o>phasor~</o> object works well for this purpose. The classic use is to set this control signal to your fundamental frequency and &quot;sweep&quot; the left frequency input in a range somewhere several octaves higher than the fundamental.
			</description>
		</method>
		<method name="synctrig">
			<arglist>
				<arg name="sync-value (0 through 1)" optional="0" type="float" />
			</arglist>
			<digest>
				Set the retrigger/reset threshold
			</digest>
			<description>
				The word <m>synctrig</m> followed by a floating-point number changes the value at which the object resets itself (i.e., when the input signal crosses from below the specified number to being above it, <o>rect~</o> will reset itself).
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="rect~.png" caption="Spectral comparison of rect~ and an ideal rectangular wave driven by a phasor~" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="cycle~" />
		<seealso name="phasor~" />
		<seealso name="saw~" />
		<seealso name="techno~" />
		<seealso name="tri~" />
		<seealso name="05_mspbasicchapter03" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				An antialiased rectangular waveform. An ideal, straight-line rectangular wave generated in a computer contains aliased frequencies that can sound irritating. <o>rect~</o> produces a nice, analog-esque output waveform.
			</description>
		</entry>
	</misc>
</c74object>
