<?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="stretch~" module="" category="">
	<digest>
		Ztx-based pitch/time modification of an audio buffer
	</digest>
	<description>
		Use the <o>stretch~</o> object to perform destructive pitch and time modifications to the contents of a <o>buffer~</o>. object.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			TEXT_HERE
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				bang to start time stretching
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				timestretch progress information
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				bang when done
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="buffer-name" type="symbol" optional="0">
			<digest>
				Buffer name
			</digest>
			<description>
				Specifies the name of the buffer which contains the result of destructive pitch/time modifications.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Modify the buffer's contents
			</digest>
			<description>
				<m>bang</m> message starts processing to modify the contents of the currently referenced buffer.
			</description>
		</method>
		<method name="apply">
			<arglist />
			<digest>
				Modify the buffer's contents
			</digest>
			<description>
				same as <m>bang</m> 
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Open a file buffer display window
			</digest>
			<description>
				Double-clicking on <o>stretch~</o> opens a display window where you can view the results of the pitch/time modifications you have made. The contents of the display window are updated when a modification is completed.
			</description>
		</method>
		<method name="cancel">
			<arglist />
			<digest>
				Cancel the current operation
			</digest>
			<description>
				Cancels the currently running operation.
			</description>
		</method>
		<method name="dictionary">
			<arglist>
				<arg name="dictionary-name" type="symbol" optional="0" />
			</arglist>
			<digest>
				Define complex time stretching
			</digest>
			<description>
				You can use a dictionary to define more complex stretching and pitch shifting. You define a point in time (sourcetime, sourcetimesample or sourcetimebbu) and define where this point should be transformed to (desttime, desttimesample or desttimebbu). For expample the dictionary below will
				<ul>
					<li>
						create marker01 which will stretch the file so that the audio at 500 ms will be on the first bar, will pitch-shift the audio down by 100 cents until the next marker
					</li>
					<li>
						create marker02 which will stretch so the material at 1000 ms will be at 1.2.0 bbu, will pitch-shift the audio by a factor of 1.1 up until the next marker
					</li>
					<li>
						create marker03 which will stretch the whole sample (“end”) to be twice as long
					</li>
				</ul>
				<code>
					{ &quot;marker01&quot; : { &quot;sourcetime&quot; : &quot;500&quot;, &quot;desttimebbu&quot; : &quot;1.0.0&quot;, &quot;pitchshiftcent&quot; : -100 } , &quot;marker02&quot; : { &quot;sourcetime&quot; : 1000, &quot;desttime&quot; : 1.2.0, &quot;pitchshift&quot; : 1.1 } , &quot;marker03&quot; : { &quot;sourcetime&quot; : “end”, &quot;desttime&quot; : “*2”, } }
				</code>
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="buffer-name" type="symbol" optional="0" />
			</arglist>
			<digest>
				Sets the name of the audio buffer referenced by the <o>stretch~</o> object.
			</digest>
			<description>
				The word <m>set</m>, followed by the name of an audio buffer, sets the name of the audio buffer referenced by the <o>stretch~</o> object.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="basictuning" get="1" set="1" type="int" size="1">
			<digest>
				Basic tuning (from A)
			</digest>
			<description>
				Sets a tuning standard based on a frequency for A for pitch-correction operations (440 = default, range is 400 - 500)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Pitchcorrection" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Basic tuning" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="followglobaltempo" get="1" set="1" type="int" size="1">
			<digest>
				Follow global tempo
			</digest>
			<description>
				When followgobaltempo is enabled, stretch~ will calculate the current tempo out of the ratio between originaltempo and the current global tempo.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching Global Transport" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Follow Global Tempo" />
				<attribute name="order" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="formant" get="1" set="1" type="float" size="1">
			<digest>
				Formant Scale
			</digest>
			<description>
				The word <m>formant</m>, followed by floating point value, sets the amount of formant scaling when pitch shifting is performed.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="1." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Formant Scale" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="formantcorrection" get="1" set="1" type="int" size="1">
			<digest>
				Turn on formant correction
			</digest>
			<description>
				The word <m>formantcorrection</m>, followed by a zero or one, disables/enables formant correction when pitch correction is performed.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Pitchcorrection" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Turn on formant correction" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Timestretching Mode
			</digest>
			<description>
				Sets the timestretching mode to be used. Each mode is optimized for handling different kinds of audio material
				<br />
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="8">
					<enumlist>
						<enum name="basic">
							<digest>
								Default mode of operation
							</digest>
							<description>
								This is the default mode of operation.
							</description>
						</enum>
						<enum name="monophonic">
							<digest>
								Monophonic sources (voice, flute)
							</digest>
							<description>
								This mode is best for monophonic instruments (e.g. solo voice, flute, etc.)
							</description>
						</enum>
						<enum name="rhythmic">
							<digest>
								Optimizes for transient preservation
							</digest>
							<description>
								This mode is for time stretched percussion. It provides optimal transient preservation.
							</description>
						</enum>
						<enum name="general">
							<digest>
								Balance spectral integrity with transient preservaton
							</digest>
							<description>
								This mode balances spectral integrity and transient preservation for general cases.
							</description>
						</enum>
						<enum name="polyphonic">
							<digest>
								Polyphonic sources (piano, guitar)
							</digest>
							<description>
								Polyphonic mode is a better choice for instruments such as piano or guitar.
							</description>
						</enum>
						<enum name="pads">
							<digest>
								Emphasize spectral quality over transient preservation
							</digest>
							<description>
								This mode emphasizes spectral quality over transient preservation.
							</description>
						</enum>
						<enum name="extremestretch">
							<digest>
								For stretch ratios greater than 2.0
							</digest>
							<description>
								This mode is intended for stretch ratios greater 2.0, a more artistic effect is intended.
							</description>
						</enum>
						<enum name="efficient">
							<digest>
								Good CPU performance
							</digest>
							<description>
								This mode is intended for a good CPU performance/quality tradeoff.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Timestretching Mode" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enum" />
			</attributelist>
		</attribute>
		<attribute name="originallength" get="1" set="1" type="atom" size="10">
			<digest>
				Original Length
			</digest>
			<description>
				The original length of the the audio file in beats. Used by <m>followglobaltempo</m> to calculate the speed in relation to the global transport speed. Setting the <m>originallength</m> will calculate the <m>originaltempo</m>.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching Global Transport" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Original Length" />
				<attribute name="order" get="1" set="1" type="int" size="1" value="2" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="time" />
				<attribute name="units" get="1" set="1" type="atom" size="3" value="ticks bars.beats.units notevalues" />
			</attributelist>
		</attribute>
		<attribute name="originaltempo" get="1" set="1" type="float" size="1">
			<digest>
				Original Tempo
			</digest>
			<description>
				The original tempo of the the audio file. Used by <m>followglobaltempo</m> to calculate the speed in relation to the global transport speed. Setting the <m>originaltempo</m> will calculate the <m>originallength</m>.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching Global Transport" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Original Tempo" />
				<attribute name="order" get="1" set="1" type="int" size="1" value="3" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="pitchcorrection" get="1" set="1" type="int" size="1">
			<digest>
				Enable/disable pitch correction
			</digest>
			<description>
				The word <m>pitchcorrection</m>, followed by a zero or one, enable/disables  the formant-corrected chromatic intonation correction. For more extensive real-time intonation correction, use the <o>retune~</o> object.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Pitchcorrection" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Turn on pitch correction" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="pitchshift" get="1" set="1" type="float" size="1">
			<digest>
				Pitch Shifting Factor
			</digest>
			<description>
				Specifies pitchshift as a factor of the original pitch (i.e. 2.0 = doubling of pitch, .5 = halving of the original pitch, etc.).
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="1." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Pitch Shifting Factor" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="pitchshiftcent" get="1" set="1" type="int" size="1">
			<digest>
				Pitch Shifting in Cents
			</digest>
			<description>
				Specify pitchshift as positive or negative cent values (i.e. 100 = semitone up, -1200 = octave down). Cents may be specified as ints or floats.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Pitch Shifting in Cents" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="progress_enable" get="1" set="1" type="int" size="1">
			<digest>
				Show Progress Bar
			</digest>
			<description>
				Enable/disable progress bar display when calculating pitch/time shifting.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Show Progress Bar" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="quality" get="1" set="1" type="int" size="1">
			<digest>
				Timestretching Quality
			</digest>
			<description>
				Choose the quality for the timestretching output.
				<br />
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="4">
					<enumlist>
						<enum name="basic">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="good">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="better">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="best">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Timestretching Quality" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enum" />
			</attributelist>
		</attribute>
		<attribute name="readagain" get="1" set="1" type="int" size="1">
			<digest>
				Process audio from original buffer rather than current buffer
			</digest>
			<description>
				Process audio from original buffer rather than current buffer when pitch or timestretching is done
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Send &quot;readagain&quot; message before time stretching." />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="slurtime" get="1" set="1" type="float" size="1">
			<digest>
				Slur time
			</digest>
			<description>
				Set the time it takes for the correction to reach the full correction amount. Typically, notes are a bit unstable at the beginning, because the attack phase of a sound has a higher amount of noise, and because singers gradually adjust their tuning after the onset of the note. The slur time makes the pitch correction sound natural because it models this effect. Higher values will yield a slower adaptation time and it will take longer for the correction to produce the corrected pitch. However, longer slur times will also preserve vibrato better.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Pitchcorrection" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="0." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Slur time" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="stretch" get="1" set="1" type="float" size="1">
			<digest>
				Stretch factor
			</digest>
			<description>
				Set the timestretching as a factor in relation to the length of the current buffer (e.g. 2.0 = double the length, .5 = half the length, etc.).
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timestretching" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="0." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Stretch Factor" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="buffer~" />
		<seealso name="groove~" />
		<seealso name="pitchshift~" />
	</seealsolist>
</c74object>
