<?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="wave~" module="msp" category="MSP Sampling">
	<digest>
		Variable size wavetable
	</digest>
	<description>
		<o>wave~</o> reads from a portion of a <o>buffer~</o> to produce a repeating waveform, given a signal input that goes between 0 and 1 (for example, using a <o>phasor~</o>) to define the position in the buffer.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			oscillator
		</metadata>
		<metadata name="tag">
			MSP Sampling
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Table Position (from 0 to 1)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				((signal/float) Starting Table Location in ms
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal/float">
			<digest>
				(signal/float) Ending Table Location in ms
			</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="buffer-name" optional="0" type="symbol">
			<digest>
				Set the buffer name
			</digest>
			<description>
				Obligatory. Names the <o>buffer~</o> object whose sample memory is used by <o>wave~</o> for its stored waveform. Note that if the underlying data in a <o>buffer~</o> changes, the signal output of <o>wave~</o> will change, since it does not copy the sample data in a <o>buffer~</o>. <o>wave~</o> always uses the first channel of a multi-channel <o>buffer~</o>.
			</description>
		</objarg>
		<objarg name="start-point" optional="1" units="ms" type="number">
			<digest>
				Set waveform start point
			</digest>
			<description>
				After the <o>buffer~</o> name argument, you can type in a value for the start and end points of the waveform as millisecond offset from the beginning of a <o>buffer~</o> object's sample memory. By default, the start point is 0. If you want to set a non-zero start point but retain the sample end as the waveform end point, use only a single typed-in argument after the <o>buffer~</o> name. The <o>wave~</o> object uses the <o>buffer~</o> sampling rate to determine loop points. If a <m>signal</m> is connected to the start point (middle) inlet, the initial waveform start point argument is ignored.
			</description>
		</objarg>
		<objarg name="end-point" optional="1" units="ms" type="number">
			<digest>
				Set waveform end point
			</digest>
			<description>
				After the start point argument, you can type in a value for the end point of the waveform, as a millisecond offsets from the beginning of a <o>buffer~</o> object's sample memory. By default, the end point is the end of the sample. If a <m>signal</m> is connected to the end point (right) inlet, the initial waveform end point is ignored.
			</description>
		</objarg>
		<objarg name="number-of-output-channels" optional="1" type="int">
			<digest>
				Set number of output channels
			</digest>
			<description>
				Sets the number of output channels, which determines the number of outlets that the <o>wave~</o> object will have. The maximum number of signal outputs is 4. If the <o>buffer~</o> object being played by <o>wave~</o> has more channels than the number of outputs of <o>wave~</o>, the extra channels are not played. If the <o>buffer~</o> object has fewer channels, the extra <o>wave~</o> signal outputs are 0.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="start/end-point" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In middle or right inlets: Numbers can be used instead of signal objects to control the start and end points of the waveform, provided a <m>signal</m> is not connected to the inlet that receives the number. The <o>wave~</o> object uses the <o>buffer~</o> sampling rate to determine loop points.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="start/end-point" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In middle or right inlets: Numbers can be used instead of signal objects to control the start and end points of the waveform, provided a <m>signal</m> is not connected to the inlet that receives the number. The <o>wave~</o> object uses the <o>buffer~</o> sampling rate to determine loop points.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Open a file buffer display window
			</digest>
			<description>
				Double-clicking on the <o>wave~</o> object will open a window that displays the audio file loaded in the buffer associated with the object.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="buffer-name" optional="0" type="symbol" />
				<arg name="start-point (millisecond-offset)" optional="0" type="float" />
				<arg name="end-point (millisecond-offset)" optional="0" type="float" />
			</arglist>
			<digest>
				Set the <o>buffer~</o> used by <o>wave~</o> for its stored waveform
			</digest>
			<description>
				The word <m>set</m>, followed by a <m>symbol</m>, sets the <o>buffer~</o> used by <o>wave~</o> for its stored waveform. The <m>symbol</m> can optionally be followed by two values setting new waveform start and end points. If the values are not present, the default start and end points (the start and end of the sample) are used. If signal objects are connected to the start and/or end point inlets, the start and/or end point values are ignored.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Input signal values progressing from 0 to 1 are used to scan a specified range of samples in a <o>buffer~</o> object. The output of a <o>phasor~</o> can be used to control <o>wave~</o> as an oscillator, treating the range of samples in the <o>buffer~</o> as a repeating waveform. However, note that when changing the frequency of a <o>phasor~</o> connected to the left inlet of <o>wave~</o>, the perceived pitch of the signal coming out of <o>wave~</o> may not correspond exactly to the frequency of <o>phasor~</o> itself if the stored waveform contains multiple or partial repetitions of a waveform. You can invert the <o>phasor~</o> to play the waveform backwards.
				<br />
				<br />
				In middle inlet: The start of the waveform as a millisecond offset from the beginning of a <o>buffer~</o> object's sample memory.
				<br />
				<br />
				In right inlet: The end of the waveform as a millisecond offset from the beginning of a <o>buffer~</o> object's sample memory.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="interp" get="1" set="1" type="int" size="1">
			<digest>
				Set the wavetable interpolation mode
			</digest>
			<description>
				The interpolation modes are:
				<br />
				<br />
				<m>Value</m>- <m>Description</m> 				<br />
				<br />
				<m>0</m>- No interpolation. Wavetable interpolation is disabled using the interp 0 message.
				<br />
				<m>1</m>- High-quality linear interpolation (default)
				<br />
				<m>2</m>- Low-quality linear interpolation. This mode uses the interpolation method found in MSP 1.x versions of the <o>wave~</o> object. While this mode is faster than mode 1, it cannot play <o>buffer~</o> objects of arbitrary length and produces more interpolation artifacts.
				<br />
				<m>3</m>- Cosine interpolation
				<br />
				<m>4</m>- Cubic interpolation
				<br />
				<m>5</m>- Spline interpolation
				<br />
				<m>6</m>- Hermite interpolation
				<br />
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="7">
					<enumlist>
						<enum name="None">
							<digest>
								No interpotlation
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Linear">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Low-Quality">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Cosine">
							<digest>
								Cosine interpolation
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Cubic">
							<digest>
								Cubic interpolation
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Spline">
							<digest>
								Spline interpolation
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Hermite">
							<digest>
								Hermite interpolation
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Interpolation mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="interp_bias" get="1" set="1" type="float" size="1">
			<digest>
				Set the bias parameter for Hermite interpolation
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Hermite interpolation bias" />
			</attributelist>
		</attribute>
		<attribute name="interp_tension" get="1" set="1" type="float" size="1">
			<digest>
				Set the tension parameter for Hermite interpolation
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Hermite interpolation tension" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="wave~.png" caption="Loop through part of a sample, treating it as a variable-size wavetable" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="2d.wave~" />
		<seealso name="buffer~" />
		<seealso name="buffir~" />
		<seealso name="groove~" />
		<seealso name="phasor~" />
		<seealso name="play~" />
		<seealso name="sync~" />
		<seealso name="07_samplingchapter04" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The portion of the <o>buffer~</o> specified by the <o>wave~</o> object's start and end points is scanned by signal values ranging from 0 to 1 in the <o>wave~</o> object's inlet, and the corresponding sample value from the <o>buffer~</o> is sent out the <o>wave~</o> object's outlet. If the signal received in wave's inlet is a repeating signal such as a sawtooth wave from a <o>phasor~</o>, the resulting output will be a waveform (excerpted from the <o>buffer~</o>) repeating at the frequency corresponding to the repetition of the input signal.
			</description>
		</entry>
	</misc>
</c74object>
