<?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="xnoteout" module="max" category="MIDI">
	<digest>
		Format MIDI note messages with release velocity
	</digest>
	<description>
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			MIDI
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Pitch
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Velocity
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				1 for Note-on, 0 for Note-off
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="3" type="INLET_TYPE">
			<digest>
				MIDI Channel
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Raw MIDI Bytes to midiout
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="channel" optional="1" type="int">
			<digest>
				Default MIDI channel
			</digest>
			<description>
				Sets an initial value for the MIDI channel of the outgoing messages. Channel numbers greater than 16 will be wrapped around to stay within the 1-16 range. If there is no argument, the initial channel number is <m>1</m>.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output most recent value
			</digest>
			<description>
				Sends out a MIDI message using the numbers currently stored in <o>xnoteout</o>.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: The number is used as the pitch value for a note-on or note-off message, and the message is sent out the outlet byte-by-byte.
				<br />
				<br />
				In left-middle inlet: The number is stored as the velocity for either a note-on or a note-off message. If no number has been received yet, the velocity for note-ons is <m>64</m>, and the velocity for note-offs is <m>0</m>.				<br />
				<br />
				In right-middle inlet: The number is stored as the indicator of whether outgoing messages should be note-ons or note-offs. If the number is not 0, <o>xnoteout</o> will send out a note-on message. If the number is <m>0</m>, <o>xnoteout</o> will send out a note-off message with a release velocity. If no number has been received yet, it is initially <m>1</m> (note-on).
				<br />
				<br />
				In right inlet: The number is stored as the channel for the MIDI message sent out by <o>xnoteout</o>. Channel numbers greater than 16 will be wrapped around to stay within the 1-16 range.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="in2">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="in3">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
				<arg name="velocity" optional="0" type="int" />
				<arg name="note-flag" optional="0" type="int" />
				<arg name="channel" optional="0" type="int" />
			</arglist>
			<digest>
				Set all values, cause output
			</digest>
			<description>
				The first number is the pitch value, the second number is the velocity, the third number is the note-on/note-off indicator (non-zero for note-on, 0 for note-off), and the fourth number is the channel. The numbers are stored by <o>xnoteout</o>, and a MIDI note-on or note-off message is sent out.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="xnoteout.png" caption="The numbers are formatted into a MIDI note-on or note-off message, which is sent out byte-by-byte" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="noteout" />
		<seealso name="midiout" />
		<seealso name="xnotein" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				When a pitch value is received, a complete MIDI note-on or note-off message is sent out the outlet, byte-by-byte. Whereas a note-on with a velocity of 0 is most commonly used to indicate a note-off, <o>xnoteout</o> sends out the MIDI note-off command and uses the specified velocity as a release velocity.
			</description>
		</entry>
	</misc>
</c74object>
