<?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="peek~" module="msp" category="MSP Sampling">
	<digest>
		Read and write sample values
	</digest>
	<description>
		Use <o>peek~</o> to read and write sample values to a named <o>buffer~</o>. Unlike related objects <o>index~</o> and <o>poke~</o>, values and indices are specified as Max messages, and the object will function even when the audio is not turned on.
	</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="INLET_TYPE">
			<digest>
				Sample Index
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Sample Value For Writing Into buffer~
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				Channel
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				buffer~ Value at Sample Index
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="buffer-name" optional="0" type="symbol">
			<digest>
				Buffer name
			</digest>
			<description />
		</objarg>
		<objarg name="buffer-channel" optional="1" default="1" type="int">
			<digest>
				Buffer channel to read/write
			</digest>
			<description />
		</objarg>
		<objarg name="clipping-enable-flag" optional="1" type="int">
			<digest>
				Enable clipping flag
			</digest>
			<description>
				If set to 1, then values written to the <o>buffer~</o> will be clipped to within -1.0 to 1.0. See the <m>clip</m> message.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="sample-index" optional="0" type="int" />
			</arglist>
			<digest>
				Read data from the <o>buffer~</o> 
			</digest>
			<description>
				The value stored at the specified sample-index is sent out the <o>peek~</o> object's outlet. However, if a value has just been received in the middle inlet, <o>peek~</o> stores that value in the <o>buffer~</o> at the specified sample index instead. If the sample-index is out of range for the <o>buffer~</o>, no data is read or written.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="sample-index/buffer-channel" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Floating-point values are converted to <m>int</m> values.
				<br />
				<br />
				In left inlet: Set the sample to be stored.
				<br />
				In right inlet: Set the buffer channel.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="sample-index" optional="0" type="int" />
				<arg name="value" optional="0" type="number" />
				<arg name="buffer-channel" optional="1" type="int" />
			</arglist>
			<digest>
				Store data into the <o>buffer~</o> 
			</digest>
			<description>
				The value is stored in the <o>buffer~</o> at the specified sample-index and buffer-channel. If the buffer-channel is omitted, the most recent channel is used. If the sample-index is out of range for the <o>buffer~</o>, no data is written.
			</description>
		</method>
		<method name="clip">
			<arglist>
				<arg name="clipping-enable-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Enable clipping
			</digest>
			<description>
				If set to 1, then values written to the <o>buffer~</o> will be clipped to within -1.0 to 1.0. Disable by setting to 0.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Double-click to view the <o>buffer~</o> contents
			</digest>
			<description />
		</method>
		<method name="set">
			<arglist>
				<arg name="buffer-name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Set <o>buffer~</o> to read/write
			</digest>
			<description />
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="peek~.png" caption="Peek at samples in a buffer~, and/or set the value of the samples" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="buffer~" />
		<seealso name="buffir~" />
		<seealso name="index~" />
		<seealso name="poke~" />
		<seealso name="table" />
	</seealsolist>
	<misc name="Output">
		<entry name="float">
			<description>
				The sample value in a <o>buffer~</o>, located at the table index specified by a <m>float</m> or <m>int</m> received in the left inlet, is sent out the <o>peek~</o> object's outlet.
			</description>
		</entry>
	</misc>
</c74object>
