<?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="sah~" module="msp" category="MSP Generators">
	<digest>
		Sample and hold a signal according to a trigger
	</digest>
	<description>
		Use <o>sah~</o> to capture (&quot;sample&quot;) and continually output (&quot;hold&quot;) the value of an input signal whenever another &quot;control&quot; signal rises above a specified threshold value. The sampled value is &quot;held&quot; until the control signal drops below and then rises above the threshold value once more, at which point the input is sampled again. Generally this allows one signal to be synchronized to the behavior of another.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Generators
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Values To Sample, float Sets Trigger Threshold
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				(signal) Trigger Input
			</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="initial-trigger-value" optional="1" default="0" type="number">
			<digest>
				Initial trigger value
			</digest>
			<description />
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="float">
			<arglist>
				<arg name="trigger-value" optional="0" type="float" />
			</arglist>
			<digest>
				Set trigger threshold
			</digest>
			<description />
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: A signal to be sampled. When the control signal (in the right inlet) goes from being at or below the current trigger value to being above the trigger value, the signal in the left inlet is sampled and its value is sent out as a constant signal value.
				<br />
				<br />
				In right inlet: The control signal. In order to cause a change in the output of <o>sah~</o>, the control signal must go from being at or below the trigger value to above the trigger value. When this transition occurs, the signal in the left inlet is sampled and becomes the new output signal value.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="sah~.png" caption="Hold the signal value constant until the next trigger" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="gate~" />
		<seealso name="phasor~" />
		<seealso name="thresh~" />
		<seealso name="train~" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				When the control signal received in the right inlet goes from being at or below the trigger value to being above the trigger value, the output signal changes to the current value of the signal received in the left inlet. This signal value is sent out until the next time the trigger value is exceeded by the control signal.
			</description>
		</entry>
	</misc>
</c74object>
