<?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="cycle~" module="msp" category="MSP Synthesis">
	<digest>
		Sinusoidal oscillator
	</digest>
	<description>
		Use the <o>cycle~</o> object to generate a periodic waveform. The default waveform is one cycle of a cosine wave. You can also use the <o>wave~</o> object, which offers additional flexibility though slightly less optimization.
	</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>
				Frequency
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				Phase (0-1)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="frequency" optional="1" units="hz" type="number">
			<digest>
				Oscillator frequency (initial)
			</digest>
			<digest>
				The initial frequency of the oscillator
			</digest>
		</objarg>
		<objarg name="buffer-name" optional="1" type="symbol">
			<digest>
				Buffer name
			</digest>
			<description>
				The name of a <o>buffer~</o> object used to define the oscillator's wavetable. If a frequency argument is present, the <o>buffer~</o> name follows the frequency. If no <o>buffer~</o> name is given, <o>cycle~</o> uses an internal 64-bit 16K cosine wavetable.
			</description>
		</objarg>
		<objarg name="sample-offset" optional="1" type="int">
			<digest>
				Offset into the buffer (wavetable start)
			</digest>
			<description>
				If a <o>buffer~</o> name has been given, this defines the sample offset into the named <o>buffer~</o> object's sample memory. <o>cycle~</o> only uses the first channel of a multi-channel <o>buffer~</o>.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="float">
			<arglist>
				<arg name="frequency-or-phase" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Left inlet: frequency of the oscillator
				<br />
				Right inlet: phase of the oscillator in the range 0.0 to 1.0
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Double-click to display <o>buffer~</o> contents
			</digest>
			<description>
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="buffer-name" optional="1" type="symbol" />
				<arg name="sample-offset" optional="1" type="int" />
			</arglist>
			<digest>
				Use 512 samples of a <o>buffer~</o> as a wavetable
			</digest>
			<description>
				Set a <o>buffer~</o> object to use as the wavetable, using the first 512 samples. If no name is given, the internal cosine wavetable with 16K samples will be used. Use the <m>setall</m> message to use an entire <o>buffer~</o> as a wavetable.
			</description>
		</method>
		<method name="setall">
			<arglist>
				<arg name="value" optional="0" type="symbol" />
			</arglist>
			<digest>
				Use the entire contents of a <o>buffer~</o> as a wavetable
			</digest>
			<description>
				Set a <o>buffer~</o> object to use as the wavetable, using the entire <o>buffer~</o> length. This is in contrast to the <m>set</m> message which only uses the first 512 samples of the <o>buffer~</o>.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Left inlet: frequency of the oscillator
				<br />
				Right inlet: phase of the oscillator in the range 0.0 to 1.0
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="buffer" get="1" set="1" type="symbol" size="1">
			<digest>
				Buffer name
			</digest>
			<description>
				Buffer containing an external waveform. Setting the <o>buffer~</o> with the attribute is analogous to sending the <m>setall</m> message.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="External buffer~" />
			</attributelist>
		</attribute>
		<attribute name="buffer_offset" get="1" set="1" type="atom_long" size="1">
			<digest>
				First sample of a buffer (if an external buffer is providing the waveform)
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Offset into buffer~" />
			</attributelist>
		</attribute>
		<attribute name="buffer_sizeinsamps" get="1" set="1" type="atom_long" size="1">
			<digest>
				Buffer size override flag
			</digest>
			<description>
				Override the size of the buffer used for the wavetable. If using the <m>set</m> message the size will be 512, or if using the <m>setall</m> message the size will be the whole <o>buffer~</o> length. Use this attribute to define a different size (the size should be a power of two). Setting this size to 0 will result in an effective size of 512 and setting it to -1 will result an effective size of the whole <o>buffer~</o> length.
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="15">
					<enumlist>
						<enum name="-1">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="0">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="16">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="32">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="64">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="128">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="256">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="512">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="1024">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="2048">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="4096">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="8192">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="16384">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="32768">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="65536">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="buffer~ size override" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enum" />
			</attributelist>
		</attribute>
		<attribute name="frequency" get="1" set="1" type="float" size="1">
			<digest>
				Oscillator frequency
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Oscillator frequency" />
			</attributelist>
		</attribute>
		<attribute name="phase" get="1" set="1" type="float" size="1">
			<digest>
				Phase offset
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Phase offset" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="cycle~.png" caption="Repeated cosine or any other waveform" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="buffer~" />
		<seealso name="buffir~" />
		<seealso name="cos~" />
		<seealso name="line~" />
		<seealso name="phasor~" />
		<seealso name="rect~" />
		<seealso name="saw~" />
		<seealso name="techno~" />
		<seealso name="trapezoid~" />
		<seealso name="tri~" />
		<seealso name="triangle~" />
		<seealso name="wave~" />
		<seealso name="2d.wave~" />
		<seealso name="05_mspbasicchapter02" module="msp" type="tutorial" />
		<seealso name="05_mspbasicchapter03" module="msp" type="tutorial" />
		<seealso name="07_samplingchapter05" module="msp" type="tutorial" />
		<seealso name="07_samplingchapter01" module="msp" type="tutorial" />
	</seealsolist>
	<discussion>
		The <o>cycle~</o> object is an interpolating oscillator that reads repeatedly through one cycle of a waveform, using a wavetable. The wavetable can be changed using the 'set' message. This wavetable may be of any size, but historically was limited to 512 samples.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				A waveform (cosine by default) repeating at the specified frequency, with the specified phase.
			</description>
		</entry>
	</misc>
</c74object>
