<?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="funbuff" module="max" category="Data">
	<digest>
		Store pairs of numbers
	</digest>
	<description>
		Stores, manages, and recalls pairs of numbers.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Data
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				list Inserts Element, int Retrieves Element
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Sets Stored Element Value for Insertion
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Stored Element Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Index Output for next Message
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				bang Output When next Message Reaches End
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="filename" optional="1" type="symbol">
			<digest>
				Filename of saved funbuff
			</digest>
			<description>
				The argument specifies the name of a file to be read into <o>funbuff</o> when the patch is loaded. Changes to the contents of one <o>funbuff</o> will not affect the contents of another <o>funbuff</o> object with the same name.
				<br />
				<br />
				A file for <o>funbuff</o> can also be created using a text editor window, beginning the text with the word <m>funbuff</m>, followed by a list of space-separated numbers which specify alternating x and y values. A <o>funbuff</o> that has been saved as a file can be viewed and edited as text by choosing Open as Text... from the File menu. Numbers in the form of text can be pasted in from other sources such as the editing window of a <o>capture</o> object, or even from another program such as a word processor.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Print information to the Max Console
			</digest>
			<description>
				In left inlet: Prints information in the Max Console concerning the current status of the <o>funbuff</o> object's contents: how many elements it contains, the minimum and maximum x and y values it contains, and its domain and range (the maximum minus the minimum, for the x and y axes respectively).
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="x-value" optional="0" type="int" />
			</arglist>
			<digest>
				Store or output a saved pair
			</digest>
			<description>
				In left inlet: The number is the x value of an x,y pair. If a y value has been received in the right inlet, the two numbers are stored together in <o>funbuff</o>. Otherwise, the x value causes the corresponding y value stored in <o>funbuff</o> to be sent out the left outlet.
				<br />
				<br />
				If there is no stored x value which matches the number received, <o>funbuff</o> uses the closest x value which is less than the number received, and sends out the corresponding y value.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="x or y value" optional="0" type="float" />
			</arglist>
			<digest>
				Store or output a saved pair
			</digest>
			<description>
				In either inlet: Converted to <m>int</m>.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear all contents
			</digest>
			<description>
				Erases the contents of <o>funbuff</o>.
			</description>
		</method>
		<method name="delete">
			<arglist>
				<arg name="x-value" optional="0" type="int" />
				<arg name="y-value" optional="0" type="int" />
			</arglist>
			<digest>
				Delete one value pair
			</digest>
			<description>
				In left inlet: The word <m>delete</m>, followed by two numbers, looks for such an x,y pair in <o>funbuff</o>, and deletes it if it exists. If <m>delete</m> is followed by only one number, only the x value is sought, and deleted if it is present.
			</description>
		</method>
		<method name="copy">
			<arglist />
			<digest>
				Copy data to clipboard
			</digest>
			<description>
				Copies the current selection (made by using the <m>select</m> message) into the global <o>funbuff</o> clipboard. The data stored on this clipboard can then be pasted into another <o>funbuff</o> object using the <m>paste</m> message.
			</description>
		</method>
		<method name="cut">
			<arglist />
			<digest>
				Cut data to clipboard
			</digest>
			<description>
				Copies the current selection (made by using the <m>select</m> message) into the global <o>funbuff</o> clipboard and deletes it from the <o>funbuff</o> object. The data stored on this clipboard can then be pasted into another <o>funbuff</o> object using the <m>paste</m> message.
			</description>
		</method>
		<method name="embed">
			<arglist>
				<arg name="flag" optional="0" type="int" />
			</arglist>
			<digest>
				Set patcher embedding flag
			</digest>
			<description>
				The word <m>embed</m>, followed by a non-zero number, causes the <o>funbuff</o> data to be stored inside the patcher. The default setting is not to store the <o>funbuff</o> data inside the patcher.
			</description>
		</method>
		<method name="dump">
			<arglist />
			<digest>
				Output all value pairs
			</digest>
			<description>
				In left inlet: Sends all the stored pairs out the middle and left outlets in immediate succession. The y values are sent out the middle outlet, and the x values are sent out the left outlet, in alternation. The pairs are sent out in ascending order based on the x value.
			</description>
		</method>
		<method name="goto">
			<arglist>
				<arg name="index" optional="0" type="int" />
			</arglist>
			<digest>
				Move the pointer to a specific value
			</digest>
			<description>
				The word <m>goto</m>, followed by a number, sets a pointer to the x value (index) specified by the number. A subsequent <m>next</m> message will return the y value at the specified x.
			</description>
		</method>
		<method name="find">
			<arglist>
				<arg name="y-value" optional="0" type="int" />
			</arglist>
			<digest>
				Output matching values
			</digest>
			<description>
				The word <m>find</m>, followed by a number, will output (out the left outlet) all x values (indexes) whose y value is equal to the number indicated.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="y-value" optional="0" type="int" />
			</arglist>
			<digest>
				Provide Y value for storage
			</digest>
			<description>
				In right inlet: The number is a y value which will be paired with the next x value received in the left inlet, and stored in <o>funbuff</o>.
			</description>
		</method>
		<method name="interp">
			<arglist>
				<arg name="x-value" optional="0" type="int" />
			</arglist>
			<digest>
				Calculate an intermediate value
			</digest>
			<description>
				In left inlet: The word <m>interp</m>, followed by a number, uses that number as an x value, measures its position between its two neighboring x values in the <o>funbuff</o>, and then sends--out the left outlet--the y value that holds a corresponding position between the two neighboring y values. If the received number is already the x value in a stored x,y pair, the corresponding y value is sent out. If the received number exceeds the minimum or maximum x values stored in <o>funbuff</o>, the y value that's associated with the minimum or maximum x value is sent out. If the <o>funbuff</o> is empty, <m>0</m> is sent out.
			</description>
		</method>
		<method name="interptab">
			<arglist>
				<arg name="value" optional="0" type="int" />
				<arg name="tablename" optional="0" type="symbol" />
			</arglist>
			<digest>
				Interpolate values using a table
			</digest>
			<description>
				In left inlet: The word <m>interptab</m>, followed by a number and the name of a named <o>table</o> object functions similarly to the <m>interp</m> message (mentioned above), except that it uses the data in the table as an interpolating function. This allows you to easily perform non-linear interpolation between consecutive values in a <o>funbuff</o>.
			</description>
		</method>
		<method name="next">
			<arglist />
			<digest>
				Move the pointer and output value
			</digest>
			<description>
				Finds the x value pointed to by the pointer (or, if the pointer points to a number not yet stored as an x value, to the next greater x value), and sends the corresponding y value out the left outlet. Also, <o>funbuff</o> calculates the difference between that x value and the value previously pointed to by the pointer, sends the difference out the middle outlet, and resets the <m>goto</m> pointer to the next greater x value.
			</description>
		</method>
		<method name="max">
			<arglist />
			<digest>
				Output the maximum value
			</digest>
			<description>
				Sends the maximum y value currently stored in the <o>funbuff</o> out the left outlet.
			</description>
		</method>
		<method name="min">
			<arglist />
			<digest>
				Output the minimum value
			</digest>
			<description>
				Sends the minimum y value currently stored in the <o>funbuff</o> out the left outlet.
			</description>
		</method>
		<method name="paste">
			<arglist />
			<digest>
				Paste data from clipboard
			</digest>
			<description>
				The word <m>paste</m> will copy the contents of the global <o>funbuff</o> clipboard into a <o>funbuff</o> object. The contents of the clipboard are set using the <m>select</m>, <m>copy</m> and <m>cut</m> messages. These messages provide a handy way of copying data between different <o>funbuff</o> objects in any open patchers.
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Print diagnostics to the Max Console
			</digest>
			<description>
				Prints diagnostic information regarding <o>funbuff</o>'s current state in the Max Console.
			</description>
		</method>
		<method name="select">
			<arglist>
				<arg name="starting-index and range" optional="0" type="list" />
			</arglist>
			<digest>
				Select a group of values
			</digest>
			<description>
				In left inlet: The word <m>select</m>, followed by an two integers representing a starting index and a range will select a region of the <o>funbuff</o> which can be edited using the <m>cut</m>, <m>copy</m> and <m>paste</m> messages. For example <m>select 2 3</m> will select the part of a <o>funbuff</o> from index 2 through index 5.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="value-pair" optional="0" type="list" />
			</arglist>
			<digest>
				In left inlet: The word <m>set</m>, followed by one or more space-separated pairs of numbers, stores each pair as x,y pair.
			</digest>
			<description>
				In left inlet: The word <m>set</m>, followed by one or more space-separated pairs of numbers, stores each pair as x,y pair.
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="filename" optional="1" type="symbol" />
			</arglist>
			<digest>
				Load a stored funbuff
			</digest>
			<description>
				Calls up the Open Document dialog box so that a file of x,y values can be read into <o>funbuff</o>. If the word <m>read</m> is followed by a symbol, Max looks for a file with that name (in the file search path) to load directly into the <o>funbuff</o>. The <o>funbuff</o> file format is described on the next page.
			</description>
		</method>
		<method name="undo">
			<arglist />
			<digest>
				Undo previous cut or paste
			</digest>
			<description>
				The <m>undo</m> message is used to undo the results of the previous <m>cut</m> or <m>paste</m> message.
			</description>
		</method>
		<method name="write">
			<arglist>
				<arg name="filename" optional="1" type="symbol" />
			</arglist>
			<digest>
				Save stored data to disk
			</digest>
			<description>
				Calls up the standard Save As dialog box, so that the contents of <o>funbuff</o> can be saved as a separate file. If the word <m>write</m> is followed by a symbol, the contents of the <o>funbuff</o> are saved immediately in a file, using the symbol as the filename.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="funbuff.png" caption="Pairs or lists are stored as x, y pairs an x value alone, or next, sends out a y value... Interpolating between points stored in funbuff" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bline" />
		<seealso name="coll" />
		<seealso name="funbuff" />
		<seealso name="itable" />
		<seealso name="line" />
		<seealso name="table" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: When an x value is received in the left inlet, the corresponding y value is sent out. (Or, if there is no such x value yet stored in <o>funbuff</o>, the y value corresponding to the next lesser x value is sent out.) When the word <m>next</m> is received in the left inlet, <o>funbuff</o> sends out the y value that corresponds to the x value pointed to by its pointer (or, if there is no such x value, the y value of the next greater x value).
				<br />
				<br />
				Out middle outlet: When the word <m>next</m> is received in its left inlet, <o>funbuff</o> sends out the difference between the x value pointed to by its pointer, and the x value previously pointed to, then resets the pointer to the next x value.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out right outlet: When the pointer reaches the end of a <o>funbuff</o>, no numbers are sent out in response to a <m>next</m> message, but a <m>bang</m> is sent out to notify that the end has been reached.
			</description>
		</entry>
	</misc>
</c74object>
