<?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="mc.miditarget" module="" category="">
	<digest>
		Map MIDI / MPE Channels to MC Channels
	</digest>
	<description>
		The <o>mc.miditarget</o> object lets you use the channel number of incoming MIDI data (in the form of <m>midievent</m> messages produced by the <o>midiparse</o> object) to target individual instances of objects inside the MC wrapper. Normally MIDI channel 1 is mapped to MC channel 1, but <o>mc.miditarget</o> also has an MPE mode that maps MPE global MIDI channel 1 to MC channel 0 (targeting all instances) and MIDI channel 2 to MC channel 1. Objects that can work with messages from <o>mc.miditarget</o> include <o>mc.vst~</o> and <o>mc.sfizz~</o>.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				midievent Message
			</digest>
			<description>
				Connect the rightmost outlet of <o>midiparse</o> that produces <m>midievent</m> messages to the inlet of <o>mc.miditarget</o>.
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				setvalue Index Followed by midievent Message
			</digest>
			<description>
				The outlet of <o>mc.miditarget</o> sends the word <m>setvalue</m> followed by an index corresponding to the MIDI channel in the incoming <m>midievent</m> message. Following the index, the word <m>midievent</m> is followed by contents of the message.
				<br />
				Example: With input <m>midievent 144 60 64</m> (a note-on on MIDI channel 1 with note number 60 and velocity 64), <o>mc.miditarget</o> will output <m>setvalue 1 midievent 144 60 64</m>.
			</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="midievent">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Map MIDI channels to MC channels
			</digest>
			<description>
				When <o>mc.miditarget</o> receives a message starting with <m>midievent</m> followed by a list of numbers specifying a MIDI message, the message is repeated to the outlet precedeed by <m>setvalue</m> and a channel index number obtained from the MIDI channel of the MIDI message.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="mpemode" get="1" set="1" type="int" size="1">
			<digest>
				MPE Mode
			</digest>
			<description>
				The <at>mpemode</at> attribute determines the channel mapping behavior of <o>mc.miditarget</o>. The MPE specification uses MIDI channel 1 for events that affect all notes; channels 2 - 16 are used for note events and per-note after touch, pitch bend, and control changes.
				<br />
				When <at>mpemode</at> is enabled, MIDI messages on channels 2 - 16 are mapped to MC channels 1 - 15. MIDI messages on channel 1 will be mapped to MC channel 0, which targets all instances inside an object using the MC wrapper. When <at>mpemode</at> is disabled, MIDI messages on channel 1 are mapped to MC channel 1, MIDI channel 2 is mapped to MC channel 2, and so on.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="MPE Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="midiparse" />
		<seealso name="vst~" />
		<seealso name="sfizz~" />
		<seealso name="mc.midiplayer~" />
	</seealsolist>
</c74object>
