<?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="offer" module="max" category="Notes">
	<digest>
		Store one-time number pairs
	</digest>
	<description>
		Store two ints as an x, y pair, and access them by x value. When a pair is retrieved, it is deleted from the collection.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Notes
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				X After Y Stores, X Alone Outputs Y, Deletes
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Y Value To Be Stored
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Y When Corresponding X Is Input
			</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="bang">
			<arglist />
			<digest>
				Output all Y values
			</digest>
			<description>
				<m>bang</m> will cause <o>offer</o> to output every y-value received since the last <m>clear</m> message was received (or since the last initialization).
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="x" optional="0" type="int" />
			</arglist>
			<digest>
				Store an X/Y pair or output a Y value
			</digest>
			<description>
				In left inlet: The number specifies 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>offer</o>; otherwise, <o>offer</o> looks for an x value that matches the incoming number, sends out the corresponding y value, then deletes the stored pair. If there is no x value stored in <o>offer</o> that matches the number received, <o>offer</o> does nothing.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear stored values
			</digest>
			<description>
				In left inlet: Deletes the entire contents of <o>offer</o>.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="y-value" optional="0" type="int" />
			</arglist>
			<digest>
				Set a Y value for the next X
			</digest>
			<description>
				In right inlet: The number specifies a y value to be stored in <o>offer</o>. The next x value (int) received in the left inlet causes the two numbers to be stored together as an x,y pair.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="offer.png" caption="A pair of numbers can be stored, then recalled a single time" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="coll" />
		<seealso name="funbuff" />
		<seealso name="table" />
	</seealsolist>
	<discussion>
		<o>offer</o> was designed for use with algorithms that transform the pitch of an incoming note stream. By storing the original and transformed note together (the transformed may be sent in the right inlet, immediately followed by the original, or they can be sent as a list) when the pitch of the note-on is changed, the transformed pitch can be retrieved when the note-off is received.
	</discussion>
	<misc name="Output">
		<entry name="int">
			<description>
				If the number received in the left inlet matches the x value of an x,y pair stored in <o>offer</o>, the corresponding y value is sent out and the stored pair is deleted.
			</description>
		</entry>
	</misc>
</c74object>
