<?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="ctlin" module="max" category="MIDI">
	<digest>
		Output received MIDI control values
	</digest>
	<description>
		Output the value from a specific controller number and MIDI channel.
	</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>
				port Message Sets MIDI Input Port/Device
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				port Message Sets MIDI Input Port/Device
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Controller Value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Controller Number
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				MIDI Channel
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="port" optional="1" type="symbol">
			<digest>
				MIDI port ID
			</digest>
			<description>
				Specifies the port (a-z) from which to receive incoming control messages. If there is no letter present as an argument, <o>ctlin</o> can receive from all ports.
			</description>
		</objarg>
		<objarg name="device" optional="1" type="symbol">
			<digest>
				MIDI output device
			</digest>
			<description>
				The name of a MIDI input device may be used as the first argument to specify the port.
			</description>
		</objarg>
		<objarg name="ctrllr-channel" optional="1" type="list">
			<digest>
				Controller and channel
			</digest>
			<description>
				Following the (optional) port argument, the next argument is a single controller number to be recognized by <o>ctlin</o>. If there is no controller number, or if the argument is a negative number, <o>ctlin</o> recognizes all controller numbers. If a single controller number is specified in the argument, the outlet which normally sends the controller number is unnecessary, and is not created.
				<br />
				<br />
				Following the controller number argument is a single channel number on which to receive control messages. If the channel argument is not present, <o>ctlin</o> receives control messages on all channels. In order for this argument to be used, a controller number argument must precede it. To specify a channel number without specifying a controller number, use <m>-1</m> for the controller number.
				<br />
				<br />
				If a single channel number is specified as an argument, the outlet which normally sends the channel number is unnecessary, and is not created. If a port has been specified with a letter argument, channel numbers greater than 16 will be wrapped around to stay within the 1-16 range. If no port argument is present, a channel number can be used in place of a letter and number combination. The exact meaning of the channel number argument depends on the channel offset specified for each port in the MIDI Setup dialog.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="anything">
			<arglist>
				<arg name="port" optional="0" type="list" />
			</arglist>
			<digest>
				Set the MIDI input device
			</digest>
			<description>
				Performs the same function as <m>port</m>.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Select a MIDI input device
			</digest>
			<description>
				Double-clicking on a <o>ctlin</o> object shows a pop-up menu for choosing a MIDI port or device.
			</description>
		</method>
		<method name="(MIDI)">
			<digest>
				Output control change message
			</digest>
			<description>
				<o>ctlin</o> receives its input from a MIDI control change message received from a MIDI input device.
			</description>
		</method>
		<method name="port">
			<arglist>
				<arg name="port" optional="0" type="symbol" />
			</arglist>
			<digest>
				Set the MIDI input device
			</digest>
			<description>
				The word <m>port</m>, followed by a letter <m>a</m>- <m>z</m> or the name of a MIDI input port or device, sets the port from which the object receives incoming control messages. The word <m>port</m> is optional and may be omitted.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="controller" optional="0" type="int" />
			</arglist>
			<digest>
				Set a single controller for output
			</digest>
			<description>
				The word <m>set</m>, followed by a number from 0 to 127, specifies a single controller number to be paid attention to by <o>ctlin</o>. This message is appropriate only if a specific controller number was originally typed in as an argument; it is ignored by <o>ctlin</o> if no controller number argument was originally typed in.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="name" get="1" set="1" type="symbol" size="1">
			<digest>
				Port Name
			</digest>
			<description>
				Set the object's midi port based on a device name. The attribute will attempt to do a case-sensitive partial string match based on the attribute's value.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Port Name" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="text_onesymbol" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="ctlin.png" caption="Control messages can be filtered in a variety of ways" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bendin" />
		<seealso name="ctlout" />
		<seealso name="midiin" />
		<seealso name="notein" />
		<seealso name="rtin" />
		<seealso name="xbendin" />
		<seealso name="midichapter01" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: The number is the control value of an incoming MIDI control change message.
				<br />
				<br />
				If a specific controller number is not specified as an argument, the controller number is sent out the 2nd outlet.
				<br />
				<br />
				If a specific channel number is not included in the argument, the channel number is sent out an additional, right, outlet.
			</description>
		</entry>
	</misc>
</c74object>
