<?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="midiselect" module="m4l" category="M4L">
	<digest>
		Select and interpret raw MIDI data
	</digest>
	<description>
		<o>midiselect</o> receives raw MIDI bytes and separates the input stream. MIDI data to be selected for output is set using object attributes. There is a separate data outlet associated with each MIDI data selection attribute. Any input data which is unselected will be sent out the object's eighth outlet.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Raw MIDI Data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Raw MIDI Data
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Note-on and Note-off (list: Pitch, Velocity)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Poly Key Pressure (list: Key, Value)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Control Change (list: Controller Number, Value)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="OUTLET_TYPE">
			<digest>
				Program Change
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="4" type="OUTLET_TYPE">
			<digest>
				Aftertouch
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="5" type="OUTLET_TYPE">
			<digest>
				Pitch Bend
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="6" type="OUTLET_TYPE">
			<digest>
				MIDI Channel
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="7" type="OUTLET_TYPE">
			<digest>
				Unselected Raw MIDI Data
			</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>
				Clear partial MIDI messages
			</digest>
			<description>
				Clears the <o>midiselect</o> object's memory of any partial MIDI messages received up to that point.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="byte" optional="0" type="list" />
			</arglist>
			<digest>
				Evaluate and output MIDI messages
			</digest>
			<description>
				<description>
					Numbers received in the inlet (usually from a <o>seq</o> or <o>midiin</o> object) are treated as bytes of a MIDI message. The status byte and the filtering attributes determine the outlet which will be used to output the data bytes.
				</description>
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="byte" optional="0" type="float" />
			</arglist>
			<digest>
				Evaluate and output MIDI messages
			</digest>
			<description>
				Floating-point numbers received in the inlet are converted to integer values and treated as bytes of a MIDI message. The status byte and the filtering attributes determine the outlet which will be used to output the data bytes.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="bend" get="1" set="1" type="int" size="1">
			<digest>
				Pitch bend select
			</digest>
			<description>
				When then <m>bend</m> attribute is set to 1, <m>Pitch Bend</m> information is sent out the 6th outlet, otherwise the <m>Pitch Bend</m> is sent out the 8th outlet as <m>raw MIDI Data</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Select Pitch Bend" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="ch" get="1" set="1" type="atom" size="16">
			<digest>
				Channel(s) select
			</digest>
			<description>
				The <m>ch</m> attribute allows you to specify which MIDI input <m>channels</m> will be selected. While you can choose input from all channels by instantiating the <o>midiselect</o> object the the argument <m>@ch all</m>, you can also select specific channels (e.g., the argument <m>@ch 1 3 5</m> will only select MIDI information on the first, third and fifth channels).
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Selected Channel(s)" />
			</attributelist>
		</attribute>
		<attribute name="ctl" get="1" set="1" type="atom" size="128">
			<digest>
				Controller change(s) select
			</digest>
			<description>
				The <m>ctl</m> attribute allows you to specify which MIDI <m>controller</m> messages will be selected. By default, no <m>controlers</m> are selected. You can select specific controlers to be filtered (e.g., the argument <m>@ctl 7 9 64</m> will select the controler 7 (Volume), 9 (Pan), 64 (Sustain Pedal)). To select all controllers, use the argument <m>@ctl all</m>. To select no controllers (the default), use <m>@ctl none</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Control Change(s) to Be Selected" />
			</attributelist>
		</attribute>
		<attribute name="note" get="1" set="1" type="atom" size="128">
			<digest>
				Note(s) select
			</digest>
			<description>
				The <m>note</m> attribute allows you to specify which MIDI <m>note</m> messages will be selected. By default, no <m>notes</m> are selected. You can select specific notes to be filtered (e.g., <m>@note 60 64 67</m> will select the C4, E4, G4 notes). To select all notes, use the argument <m>@note all</m>. To select no notes (the default), use <m>@note none</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Note(s) to Be Selected" />
			</attributelist>
		</attribute>
		<attribute name="pgm" get="1" set="1" type="int" size="1">
			<digest>
				Program change select
			</digest>
			<description>
				When then <m>pgm</m> attribute is set to 1, <m>Program Change</m> information is sent out the 4th outlet. Otherwise, the <m>Program Change</m> is sent out the 8th outlet as <m>raw MIDI Data</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Selected Program Changes" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="poly" get="1" set="1" type="atom" size="128">
			<digest>
				Poly pressure Note(s) select
			</digest>
			<description>
				The <m>poly</m> attribute allows you to specify which MIDI <m>poly pressure</m> will be selected. By default, no <m>poly pressure</m> is selected. You can select specific notes to be filtered (e.g., <m>@note 60 64 67</m> will select the C4, E4, G4 notes). To select all the notes, use the argument <m>@note all</m>. To select no notes (the default) use <m>@note none</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Poly Pressure Note(s) to Be Selected" />
			</attributelist>
		</attribute>
		<attribute name="touch" get="1" set="1" type="int" size="1">
			<digest>
				Aftertouch select
			</digest>
			<description>
				When then <m>touch</m> attribute is set to 1, <m>After touch</m> data is sent out the 5th outlet. Otherwise, the <m>Aftertouch</m> is sent out the 8th outlet as <m>raw MIDI Data</m>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Select After Touch" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="midiselect.png" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="midiparse" />
		<seealso name="borax" />
		<seealso name="midiformat" />
		<seealso name="midiin" />
		<seealso name="midiinfo" />
		<seealso name="midichapter03" module="max" type="tutorial" />
	</seealsolist>
	<discussion>
		Note: Due to the nature of the MIDI coding, use of the <m>ch</m> attribute is cumulative: <i>at least one</i> channel needs to be specified; otherwise, all raw MIDI data will be sent out the 8th outlet.
	</discussion>
	<misc name="Output">
		<entry name="list">
			<description>
				Out leftmost outlet: A note-on message. The first number is a pitch value and the second number is the velocity value.
				<br />
				<br />
				Out 2nd outlet: A polyphonic key pressure message. The first number is an aftertouch (pressure) value and the second number is the pitch value (key number).
				<br />
				<br />
				Out 3rd outlet: A control message. The first number is a control value and the second number is the controller number.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out 4th outlet: The number is the program change.
				<br />
				<br />
				Out 5th outlet: The number is the aftertouch (channel pressure) value.
				<br />
				<br />
				Out 6th outlet: The number is the pitch bend value.
				<br />
				<br />
				Out 7th outlet: The number is the MIDI channel number.
			</description>
			<br />
			Out the rightmost outlet: The raw MIDI data of all unselected MIDI events.
		</entry>
	</misc>
</c74object>
