<?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="xctlout" module="max" category="MIDI">
	<digest>
		Format 14-bit MIDI controller messages
	</digest>
	<description>
		Format 14-bit MIDI continuous controller messages to be transmitted using the <o>midiout</o> object.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Controller Value (0-16383 or list MSB LSB)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Controller Number (MSB, 0-95)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" 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="ctrllr-channel" optional="1" type="list">
			<digest>
				Controller and channel
			</digest>
			<description>
				The initial argument is an initial high resolution controller number (in the range 0-95) to be used in control messages formatted by <o>xctlout</o>. Controller numbers are automatically limited between 0 and 95. If there is no controller number specified, the initial controller number is 1.
				<br />
				<br />
				Following the controller number argument is an initial value for the channel number with which to format control messages. If the channel argument is not present, <o>xctlout</o> initially formats control messages on channel 1. In order for this argument to be used, a controller number argument must precede it. The channel number is clipped to the range 1-16.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output most recent value
			</digest>
			<description>
				Sends out a high resolution MIDI continuous controller message using the numbers currently stored in <o>xctlout</o> 
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" type="int" optional="0" />
			</arglist>
			<digest>
				Send 14-bit continuous controller value
			</digest>
			<description>
				The number is a 14-bit continuous controller value to be formatted into a complete high resolution MIDI continuous controller message by <o>xctlout</o>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" type="float" optional="0" />
			</arglist>
			<digest>
				Send 14-bit continuous controller value
			</digest>
			<description>
				The number is a 14-bit continuous controller value to be formatted into a complete high resolution MIDI continuous controller message by <o>xctlout</o>.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="msb" type="int" optional="0" />
				<arg name="lsb" type="int" optional="0" />
			</arglist>
			<digest>
				Send 14-bit continuous controller value
			</digest>
			<description>
				A pair of two 7-bit values (most significant byte (MSB) followed by least significant byte (LSB)) will be ORd together to form a single 14-bit continuous controller value. The 14-bit value will be formatted into a complete high resolution MIDI continuous controller message by <o>xctlout</o>.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="controller" optional="0" type="int" />
			</arglist>
			<digest>
				Set the active MIDI continuous controller number
			</digest>
			<description>
				In middle inlet: The number is stored as the controller number of the control change messages transmitted by <o>xctlout</o>. Controller numbers outside of the range 0-95 will be ignored.
			</description>
		</method>
		<method name="in2">
			<arglist>
				<arg name="channel" optional="0" type="int" />
			</arglist>
			<digest>
				Set the MIDI output channel
			</digest>
			<description>
				In right inlet: The number is stored as the MIDI channel for the continuous controller message sent out by <o>xctlout</o>. Channel numbers will be clipped to stay within the 1-16 range.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="lsbfirst" get="1" set="1" type="int" size="1">
			<digest>
				Send the controller's LSB bytes first
			</digest>
			<description>
				When enabled, the LSB group of bytes in the formatted continuous controller messages will be transmitted first, followed by the MSB group. This is required by some MIDI hardware.
			</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="Transmit LSB before MSB" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="running" get="1" set="1" type="int" size="1">
			<digest>
				Use running status
			</digest>
			<description>
				If running status is enabled, the status byte of the second (LSB) group of bytes in the formatted continuous controller messages will be eliminated.
			</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="Use Running Status" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<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="midiout" />
		<seealso name="ctlout" />
		<seealso name="xctlin" />
		<seealso name="xbendout" />
		<seealso name="xnoteout" />
		<seealso name="nrpnout" />
		<seealso name="rpnout" />
	</seealsolist>
	<discussion>
		A single 14-bit MIDI continuous controller message comprises two groups of bytes, one for the most significant byte of the value (MSB, on controller 0-95) and one for the least significant byte (LSB, on the MSB controller + 32).
	</discussion>
	<misc name="Output">
		<entry name="int">
			<description>
				When a value is received in the left inlet, the complete high resolution MIDI continuous controller message is sent out the outlet, byte-by-byte.
			</description>
		</entry>
	</misc>
</c74object>
