<?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.midiplayer~" module="" category="">
	<digest>
		Generate MIDI Events from Audio Signals
	</digest>
	<description>
		The <o>mc.midiplayer~</o> object generates <m>midievent</m> note-on and note-off messages from audio signals representing triggers, note numbers, and velocity values. Typically you'll connect <o>mc.midiplayer~</o> to <o>vst~</o> which allows sample-accurate MIDI events at audio rates (assuming the hosted plug-in supports it).
	</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="multi-channel signal">
			<digest>
				Note Trigger Input
			</digest>
			<description>
				One or more signals that trigger note-on and note-off events according to the current <at>triggermode</at>. Each channel of the input plays notes on a corresponding MIDI channel.
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal, float">
			<digest>
				Note Number
			</digest>
			<description>
				When a note-on event is triggered, <o>mc.midiplayer~</o> uses the current sample value of signals connected to this inlet as the note number.
			</description>
		</inlet>
		<inlet id="2" type="multi-channel signal, float">
			<digest>
				Velocity
			</digest>
			<description>
				When a note-on event is triggered, <o>mc.midiplayer~</o> uses the current sample value of signals connected to this inlet as the velocity. Values between 0 and 1 are scaled to MIDI velocity values 0 to 127 and a velocity curve is applied according to the setting of the <at>velcurve</at> attribute.
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				MIDI Events for vst~
			</digest>
			<description>
				The object sends <m>midievent</m> messages for note-ons and note-offs. Each <m>midievent</m> message contains three MIDI bytes followed by values for detune and sample offset.
			</description>
		</outlet>
		<outlet id="1" type="midievent">
			<digest>
				MIDI Event Output Not for vst~
			</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="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				Set note number or velocity values
			</digest>
			<description>
				A number in the middle inlet sets a note number for future note events. A number in the right inlet sets a velocity value for future note events. This sets values globally for all MIDI channels. To set note numbers, velocities, or durations per channel, use the <m>setvalue</m> message. These values are ignored if a signal is connected to the corresponding inlet.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Set note number or velocity values
			</digest>
			<description>
				See the <m>int</m> message.
			</description>
		</method>
		<method name="setvalue">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Set note number, velocity, or duration per channel
			</digest>
			<description>
				The <m>setvalue</m> message assigns note numbers, velocities or durations for future note-events to individual challenge. A channel number always follows the word <m>setvalue</m>. Following the channel number, if the <m>setvalue</m> message is sent to the middle inlet, a number sets the note number for the specified channel. If the <m>setvalue</m> message is sent to the right inlet, a number sets the velocity for the specified channel. In any inlet, <m>setvalue</m>  <i>channel</i>  <m>dur</m>  <i>value</i> assigns a duration proportion to the channel when the <at>triggermode</at> is set to Phasor. See the <at>defaultdur</at> attribute for more details.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Set trigger, note number, or velocity values
			</digest>
			<description>
				If a signal is connected to the middle inlet, it sets the note number used when triggering a new note. If a signal is connected to the right inlet, it sets the velocity value used when triggering a new note-on.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="chanmod" get="1" set="1" type="int" size="1">
			<digest>
				Channel Modulo
			</digest>
			<description>
				Each incoming audio channel to <o>mc.midiplayer~</o> can only generate one MIDI event at a time. The <at>chanmod</at> attribute determines how multiple audio channels map to MIDI channels. The minimum value of <at>chanmod</at> is 1, which means all audio channels generate note events on MIDI channel 1. The maximum value of <at>chanmod</at> is 16, where <o>mc.midiplayer~</o> uses all 16 available MIDI channels. When <at>mpemode</at> is enabled, the maximum value of <at>chanmod</at> is 15, since MPE uses channel 1 for global MIDI events.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Channel Modulo" />
			</attributelist>
		</attribute>
		<attribute name="defaultdur" get="1" set="1" type="float" size="1">
			<digest>
				Default Duration Proportion
			</digest>
			<description>
				When <at>triggermode</at> is set to Phasor, <o>mc.midiplayer~</o> sends a note-on at the beginning of a phasor ramp and a note-off when the phasor resets. The <at>defaultdur</at> sets the point in the ramp that triggers the note-off event. For example, if <at>defaultdur</at> is set to 0.5, a note-off is sent when the input phasor reaches 0.5. To set a duration proportion for each channel, use the <m>setvalue</m> message with the <m>dur</m> selector. When <at>defaultdur</at> is changed, it does not override any channel-specific duration values set. To cause a channel to use the value of <at>defaultdur</at> for note durations, set its channel-specific dutation to zero.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Default Duration Proportion" />
			</attributelist>
		</attribute>
		<attribute name="defaultnote" get="1" set="1" type="int" size="1">
			<digest>
				Default Note Number
			</digest>
			<description>
				Sets the note number to use for all future note events. It has the same effect as sending a number to the middle inlet of the object. This setting is ignored if a signal is connected to the middle (note number) inlet of <o>mc.midiplayer~</o>. To set a note number for each channel, send the <m>setvalue</m> message with a number argument to the middle inlet. When <at>defaultnote</at> is changed, it does not override any channel-specific note number values set. To cause a channel to use the value of <at>defaultnote</at> for note number, set its channel-specific note number to zero.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Default Note Number" />
			</attributelist>
		</attribute>
		<attribute name="defaultvelocity" get="1" set="1" type="int" size="1">
			<digest>
				Default Velocity
			</digest>
			<description>
				Sets the velocity to use for all future note-on events. It has the same effect as sending a number to the middle inlet of the object. This setting is ignored if a signal is connected to the right (velocity) inlet of <o>mc.midiplayer~</o>. To set a velocity value for each channel, send the <m>setvalue</m> message with a number argument to the right inlet. When <at>defaultvelocity</at> is changed, it does not override any channel-specific note number values set. To cause a channel to use the value of <at>defaultvelocity</at> for its velocity, set its channel-specific velocity to zero.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Default Velocity" />
			</attributelist>
		</attribute>
		<attribute name="mpemode" get="1" set="1" type="int" size="1">
			<digest>
				MPE Mode
			</digest>
			<description>
				When <at>mpemode</at> is enabled, note events are not sent on MIDI channel 1 and the <at>chanmod</at> attribute has a maximum value of 15.
			</description>
			<attributelist>
				<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="onff" />
			</attributelist>
		</attribute>
		<attribute name="playzero" get="1" set="1" type="int" size="1">
			<digest>
				Play MIDI Note 0
			</digest>
			<description>
				When <at>playzero</at> is enabled, MIDI note events play even if the note number is zero. Disabling <at>playzero</at> is useful when using the same signal for triggering and assigning note numbers when <at>triggermode</at> is set to Edge or Change. Note: input <i>velocity</i> values of 0 disable note events irrespective of the setting of <at>playzero</at>.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Play MIDI Note 0" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onff" />
			</attributelist>
		</attribute>
		<attribute name="triggermode" get="1" set="1" type="int" size="1">
			<digest>
				Note Trigger Mode
			</digest>
			<description>
				Determines how the input trigger signal (connected to the left inlet) generates note events
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Phasor">
							<digest>
								Trigger notes based on phasor ramps
							</digest>
							<description>
								When <at>triggermode</at> is set to Phasor, the first rising sample value of the ramp triggers a note-on and the first descending (reset) sample triggers a note-off. If the duration proportion (via the <m>dur</m> message or <at>defaaultdur</at> attribute) is less than 1.0, the note-off will be triggered when the ramp value reaches the specified value.
							</description>
						</enum>
						<enum name="Edge">
							<digest>
								Trigger notes based on logical sample value transitions
							</digest>
							<description>
								When <at>triggermode</at> is set to Edge, a note-on is triggered by a zero to non-zero transition in the input signal, and a note-off is triggered by a non-zero to zero transition.
							</description>
						</enum>
						<enum name="Change">
							<digest>
								Trigger notes based on sample value changes
							</digest>
							<description>
								When <at>triggermode</at> is set to Change, a note-on is triggered whenever the sample value changes. If a note is already playing, the note-off for the playing event is sent first. If you don't want notes playing continuously, disabling the <at>playzero</at> attribute is useful, since a note number value of zero will trigger a note-off (if necessary) without playing another note.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Note Trigger Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="velcurve" get="1" set="1" type="float" size="1">
			<digest>
				Velocity Curve Factor (-1 to 1)
			</digest>
			<description>
				The <at>velcurve</at> attribute introduces a non-linearity into the velocity values of MIDI events. For a more traditional curve, use a negative value (the default is -0.75). A value of 0 means there is no non-linearity, and positive values introduce a less traditional non-linearity where lower input values rise more quickly relative to higher input values. The built-in non-linear function is based on a simple Bezier curve; for more options scaling the input before it arrives at the right inlet of <o>mc.midiplayer~</o> refer to the Ease package.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Velocity Curve Factor (-1 to 1)" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="phasor~" />
		<seealso name="vst~" />
	</seealsolist>
</c74object>
