<?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="snapshot~" module="msp" category="MSP Analysis">
	<digest>
		Convert signal values to numbers
	</digest>
	<description>
		Use the <o>snapshot~</o> object to convert a signal value into a float message when a bang is received or according to a specified interval. The interval can be set to a fixed or tempo-relative rate using the Max <link name="maxtime" module="core" type="vignette">time format</link> syntax.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Analysis
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				In, bang Reports Signal Value
			</digest>
			<description />
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				Internal Clock Interval in ms
			</digest>
			<description />
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="float">
			<digest>
				Signal Values
			</digest>
			<description />
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="reporting-interval" optional="1" default="0" units="time-value" type="list">
			<digest>
				Set the reporting interval
			</digest>
			<description>
				Set the reporting interval in ms or using the Max <link name="maxtime" module="core" type="vignette">time format</link> syntax. If the interval is 0 <o>snapshot~</o> will only output data when it receives a <m>bang</m> message.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Reports the sample value in the most recently received signal vector at the offset specified by the <at>offset</at> attribute. If <at>offset</at> is 0 and the <m>bang</m> message is received at the high priority thread when Scheduler in Audio Interrupt is enabled, <o>snapshot~</o> will report the value at the sample offset of the current scheduler time.
			</digest>
			<description />
		</method>
		<method name="int">
			<arglist>
				<arg name="internal-clock-enable-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Any non-zero value turns on interval-based reporting, <m>0</m> turns it off. Reporting is on by default if a non-zero interval was specified.
				<br />
				In right inlet: Set the reporting interval in ms. If the interval is 0, automatic reporting stops.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="internal-clock-enable-flag" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Any non-zero value turns on interval-based reporting, <m>0</m> turns it off. Reporting is on by default if a non-zero interval was specified.
				<br />
				In right inlet: Set the reporting interval in ms. If the interval is 0, automatic reporting stops.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="ITM-time-list" optional="0" units="time-value" type="list" />
			</arglist>
			<digest>
				Set interval in Max <link name="maxtime" module="core" type="vignette">time format</link>.
			</digest>
			<description />
		</method>
		<method name="anything">
			<arglist>
				<arg name="ITM-time-list" optional="0" units="time-value" type="list" />
			</arglist>
			<digest>
				Set interval in Max <link name="maxtime" module="core" type="vignette">time format</link>.
			</digest>
			<description />
		</method>
		<method name="sampleinterval">
			<arglist>
				<arg name="internal-clock-interval" optional="0" units="samples" type="int" />
			</arglist>
			<digest>
				Set interval in samples per sampleinterval
			</digest>
			<description />
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Signal to sample
			</digest>
			<description>
				Connect a signal to sample
			</description>
		</method>
		<method name="start">
			<arglist />
			<digest>
				Start periodic reporting
			</digest>
			<description />
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stop periodic reporting
			</digest>
			<description />
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="active" get="1" set="1" type="int" size="1">
			<digest>
				Enable periodic reporting of the input
			</digest>
			<description>
				When <at>active</at> is enabled, <o>snapshot~</o> outputs sample values at a rate specified by the <at>interval</at> attribute.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Active" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="interval" get="1" set="1" type="Time Value" size="1">
			<digest>
				Reporting interval
			</digest>
			<description />
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Timing" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Sampling Interval" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="time" />
				<attribute name="units" get="1" set="1" type="atom" size="7" value="ms hh:mm:ss ticks bars.beats.units notevalues hz samples" />
			</attributelist>
		</attribute>
		<attribute name="offset" get="1" set="1" type="int" size="1">
			<digest>
				Offset
			</digest>
			<description>
				The index of the sample within a signal vector that will be reported. The index is constrained between 0 and the current signal vector size minus one.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Offset" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="snapshot~.png" caption="See a sample of a signal at a given moment" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="capture~" />
		<seealso name="number~" />
		<seealso name="sig~" />
		<seealso name="14_analysischapter01" module="msp" type="tutorial" />
	</seealsolist>
	<discussion>
		The <o>snapshot~</o> object is sample-accurate when Scheduler in Audio Interrupt is enabled. More details <link module="core" name="audio_sampleaccurate" type="vignette">here</link>.
	</discussion>
	<misc name="Output">
		<entry name="float">
			<description>
				When <o>snapshot~</o> receives a <m>bang</m> or periodic reporting is enabled, sample values from the input signal are sent out its outlet.
				<br />
				<o>mc.snapshot~</o> outputs <m>voice</m> followed by the channel number of a connected multi-channel signal its right outlet, followed by sample value for that channel out its left outlet.
			</description>
		</entry>
	</misc>
</c74object>
