<?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="flush" module="max" category="Notes">
	<digest>
		Output MIDI note-offs for held notes
	</digest>
	<description>
		Outputss note-off messages for any held note-ons. <o>flush</o> keeps track of all note-ons passed through it, and produces note-off messages for any held notes when it receives a <m>bang</m> message.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			MIDI
		</metadata>
		<metadata name="reference">
			TEXT_HERE
		</metadata>
		<metadata name="license">
			TEXT_HERE
		</metadata>
		<metadata name="tag">
			Notes
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Pitch Input, bang Flushes Held Notes
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Velocity Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Pitch Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Velocity Output
			</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>
				Send note-off message for held notes
			</digest>
			<description>
				Immediately sends note-offs for any pitches that have passed through as note-ons but not as note-offs by sending 0 out its right outlet followed by a pitch value out its left outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
			</arglist>
			<digest>
				MIDI pitch value
			</digest>
			<description>
				The number is treated as the pitch value of a pitch-velocity pair and the note is sent out.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clears all received note data
			</digest>
			<description>
				In left inlet: Erases any numbers held by <o>flush</o>, without sending any note-offs.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="velocity" optional="0" type="int" />
			</arglist>
			<digest>
				MIDI velocity value
			</digest>
			<description>
				The number is stored as the velocity to be paired with numbers received in the left inlet.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="flush.png" caption="Make sure all notes are turned off by providing note-offs for held notes" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bag" />
		<seealso name="borax" />
		<seealso name="makenote" />
		<seealso name="midiflush" />
		<seealso name="offer" />
		<seealso name="stripnote" />
		<seealso name="sustain" />
		<seealso name="midichapter02" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: The output is the pitch of the note-on or note-off.
				<br />
				<br />
				Out right outlet: The number is the velocity of the note-on or note-off.
				<br />
				<br />
				The <o>flush</o> object keeps track of the notes that have passed through it. When a bang is received in the inlet, note-off messages are provided for any notes that have passed through as note-ons only.
			</description>
		</entry>
	</misc>
</c74object>
