<?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="stutter~" module="msp" category="MSP Sampling">
	<digest>
		Signal capture buffer for granular playback
	</digest>
	<description>
		The <o>stutter~</o> object keeps a history of its signal input (left inlet). Upon receiving an int (left inlet), it copies that number of the most recently received samples to another playback buffer. This buffer may be cycled through by its phase, 0-1 (right inlet). On receiving a <m>bang</m> (left inlet) or a trigger signal (middle inlet), the last integer number of samples are copied to the playback buffer.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Sampling
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Memory Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				(signal) Trigger
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal">
			<digest>
				(signal) Playback Input 1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Playback Output 1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="max-buffer-length" optional="0" units="samples" type="int">
			<digest>
				Maximum buffer length
			</digest>
			<description>
				The maximum buffer length, in samples. This determines the memory size of the record buffer. Parts of the record buffer are copied to the playback buffer when the object is triggered.
			</description>
		</objarg>
		<objarg name="initial-buffer-size" optional="0" units="samples" type="int">
			<digest>
				Initial buffer length
			</digest>
			<description>
				The initial buffer size, in samples, to copy from the record to the playback buffer upon receiving a trigger.
			</description>
		</objarg>
		<objarg name="trigger-polarity" optional="0" type="int">
			<digest>
				Trigger polarity
			</digest>
			<description>
				The polarity to use for accepting a trigger signal in the middle inlet. If the argument is greater than 0, <o>stutter~</o> accepts a positive trigger; otherwise <o>stutter~</o> accepts a negative trigger.
			</description>
		</objarg>
		<objarg name="number-of-copied-samples" optional="0" units="samples" type="int">
			<digest>
				Number of samples copied from record to playback
			</digest>
			<description>
				The number of samples which are copied from the record buffer to the playback buffer each iteration of the perform loop (the signal vector size). A larger value will decrease the <o>stutter~</o> object's memory requirements and increase the CPU requirements.
			</description>
		</objarg>
		<objarg name="number-of-outputs" optional="1" type="int">
			<digest>
				Number of signal outlets
			</digest>
			<description>
				An optional fifth argument allows you to specify multiple independent signal outputs the <o>stutter~</o> object will use when playing back from the playback buffer. The default is 1, and the maximum is 30. The number of phase signal inputs to the <o>stutter~</o> object is also determined by this argument.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Copy last buffer to the playback buffer
			</digest>
			<description>
				In left inlet: A <m>bang</m> causes the last buffer of recorded samples to be copied to the playback buffer. You can use a <m>bang</m> instead of or in conjunction with the middle inlet trigger signal.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="playback-buffer-size" optional="0" units="samples" type="int" />
			</arglist>
			<digest>
				Set the playback buffer size
			</digest>
			<description>
				In left inlet: Specifies the size (in samples) of the playback buffer. This can be any number up to the maximum memory determined by the first argument to <o>stutter~</o>.
			</description>
		</method>
		<method name="ampvar">
			<arglist>
				<arg name="random-amplitude-variation" optional="0" type="float" />
			</arglist>
			<digest>
				Set random amplitude variation in signal output
			</digest>
			<description>
				The word <m>ampvar</m>, followed by a float, specifies a random amplitude variation in the output signal(s). The default is 0 (no variation).
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear the object's sample memory
			</digest>
			<description>
				Clears the object's sample memory.
			</description>
		</method>
		<method name="dropout">
			<arglist>
				<arg name="drop-out-chance" optional="0" type="float" />
			</arglist>
			<digest>
				Set the percentage chance of dropout on playback
			</digest>
			<description>
				The word <m>dropout</m>, followed by a float, determines the percentage chance of a playback signal dropping out (i.e. 'gapping' or not playing). The default is 0 (no gapping).
			</description>
		</method>
		<method name="maxsize">
			<arglist>
				<arg name="max-buffer-size" optional="0" units="samples" type="int" />
			</arglist>
			<digest>
				Set the maximum buffer size
			</digest>
			<description>
				The word <m>maxsize</m>, followed by a number, sets the maximum buffer size, in samples.
			</description>
		</method>
		<method name="polarity">
			<arglist>
				<arg name="trigger-polarity" optional="0" type="int" />
			</arglist>
			<digest>
				Change the trigger polarity
			</digest>
			<description>
				The word <m>polarity</m>, followed by a zero or one, changes the trigger polarity of <o>stutter~</o> to negative or positive, respectively.
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Print all parameter settings to the Max Console
			</digest>
			<description>
				The word <m>print</m> will cause the object to print a detailed listing of all of its parameter settings within the Max Console.
			</description>
		</method>
		<method name="repeat">
			<arglist>
				<arg name="repeat-chance" optional="0" type="float" />
			</arglist>
			<digest>
				Set the percentage chance of repeat on playback
			</digest>
			<description>
				The word <m>repeat</m>, followed by a float, determines the percentage change of the record buffer not being copied to the playback buffer so that the previous playback buffer is repeated. The default is 0 (no repeat).
			</description>
		</method>
		<method name="setbuf">
			<arglist>
				<arg name="buffer-name" optional="0" type="symbol" />
				<arg name="sample-offset" optional="0" units="samples" type="int" />
				<arg name="channel-number" optional="0" type="int" />
			</arglist>
			<digest>
				Copy samples to a named <o>buffer~</o> object
			</digest>
			<description>
				The word <m>setbuf</m>, followed by arguments for a buffer name, a sample offset, and a channel, copies the specified samples to the named <o>buffer~</o> object. Note: <o>stutter~</o> always uses its internal buffer as the playback buffer; the copied samples can be sent to a named <o>buffer~</o> object for use in some other way, if desired. The time required to move the specified amount of memory to the buffer is n/m, there n is the number of samples being copied and m is the fourth argument to the <o>stutter~</o> object.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Signals coming into the left inlet are stored in a record buffer, where they can be copied into a playback buffer and used as a playback source.
				<br />
				<br />
				In middle inlet: Accepts a trigger signal, which can be specified to be positive or negative. When the signal changes polarity in the correct direction, samples recorded from the left inlet are copied to the playback buffer.
				<br />
				<br />
				In right and successive inlets: A phase signal input in the range of 0-1 for each inlet controls the output speed of the playback buffer for that inlet. The number of phase inlets in a <o>stutter~</o> object is set using the fifth argument; the default is a single inlet. Specifying multiple phase inlets allows you to specify multiple playback points in the sampled buffer.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="stutter~.png" caption="stutter~ captures a new slice of incoming sound into an oscillating buffer whenever it receives a trigger" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="buffer~" />
		<seealso name="phasor~" />
		<seealso name="record~" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				All outlets: The <o>stutter~</o> object's outlets produce a signal from the playback buffer, the location and speed of which is determined by the phase input for that playback outlet. The number of outlets is determined by the fifth argument to the <o>stutter~</o> object.
			</description>
		</entry>
	</misc>
</c74object>
