<?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="sash~" module="" category="">
	<digest>
		Sample and Hold with Memory
	</digest>
	<description>
		The <o>sash~</o> object performs sample-and-hold operations on an input signal but unlike the <o>sah~</o> includes a buffer (the extra &quot;s&quot; in <o>sash~</o> is for &quot;storage&quot;) that can holds samples of the input. Sample capture and sample output are triggered independently of each other, and <o>sash~</o> includes a variety of methods for selecting the output sample from the memory buffer.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				Input
			</digest>
			<description>
				The input signal to be sampled
			</description>
		</inlet>
		<inlet id="1" type="signal, float">
			<digest>
				Sample Trigger
			</digest>
			<description>
				Signal that triggers the sampling the input
			</description>
		</inlet>
		<inlet id="2" type="signal, float">
			<digest>
				Advance Trigger
			</digest>
			<description>
				Signal that advances to the next sample in the memory buffer
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				Converted to float
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Set sample trigger or advance level
			</digest>
			<description>
				A float in the middle inlet sets the sample trigger level. A float in the right set the level for advancing to the next output value from the memory buffer.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Set the memory buffer contents
			</digest>
			<description>
				A list of values is assigned to the memory buffer. This is useful when there is no signal connected to the sample trigger (middle) inlet. The size of the list can not be larger than the buffer size (<at>maxsize</at> attribute), and the new output size is set to the number of items in the list.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				A signal in the left inlet is sampled, triggered by the value of the signal in the middle inlet. The signal connected to the right inlet triggers <o>sash~</o> to advance to the next output sample from the memory buffer. This happens when sample exceeds the  the <at>advancelevel</at> when the <at>mode</at> is set to Advance. When the <at>mode</at> is set to Index, the output sample changes when the integer value of the input changes. When the <at>mode</at> is set to Subdivision, the output sample changes when the input value, divided by the current <at>size</at>, reaches the next divisor.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="advancelevel" get="1" set="1" type="float" size="1">
			<digest>
				Advance Level
			</digest>
			<description>
				Sets the level of the signal connected to the right inlet that will cause the next value in the memory buffer to be used. The next index into the buffer is chosen according to the <at>dir</at> attribute.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Advance Level" />
			</attributelist>
		</attribute>
		<attribute name="dir" get="1" set="1" type="int" size="1">
			<digest>
				Advance Direction
			</digest>
			<description>
				Determines how the next memory buffer index is chosen when the advance trigger signal exceeds the advance level.
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="4">
					<enumlist>
						<enum name="Forward">
							<digest>
								Increment forward
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Reverse">
							<digest>
								Increment backward
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Random">
							<digest>
								Choose index randomly with replacement
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Urn">
							<digest>
								Choose index randomly without replacement
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Advance Direction" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="maxsize" get="1" set="1" type="int" size="1">
			<digest>
				Max Buffer Size
			</digest>
			<description>
				Sets the maximum possible value of the <at>size</at> attribute. The default is 1000 samples. Note that <at>maxsize</at> can only be changed as a typed-in argument.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Max Buffer Size" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Advance Mode
			</digest>
			<description>
				Determines the interpretation of the advance trigger signal
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Level">
							<digest>
								Signal exceeds a threshold level
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Index">
							<digest>
								Integer value of the advance trigger signal
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Subdivision">
							<digest>
								Phasor subdivision of the advance trigger signal
							</digest>
							<description>
								When the <at>mode</at> attribute is set to Subdivision, the index into the memory buffer is determined by dividing 1 into the current value of the <at>size</at> attribute. For example, if the <at>size</at> is 2, advance trigger signal values below 0.5 will play the first memory buffer sample (index 0), and advance trigger signal values above 0.5 will play the second memory buffer sample (index 1).
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Advance Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="samplelevel" get="1" set="1" type="float" size="1">
			<digest>
				Sampling Level
			</digest>
			<description>
				Sets the level of the signal connected to the middle inlet that will cause the next value in the left inlet to be sampled and recorded into the memory buffer.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Sampling Level" />
			</attributelist>
		</attribute>
		<attribute name="size" get="1" set="1" type="int" size="1">
			<digest>
				Size
			</digest>
			<description>
				Sets the current size of the memory buffer used for recording and output. The <at>size</at> must be greater than 0 and less than or equal to the <at>maxsize</at> attribute.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Size" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="gate~" />
		<seealso name="phasor~" />
		<seealso name="sah~" />
		<seealso name="subdiv~" />
		<seealso name="thresh~" />
	</seealsolist>
</c74object>
