<?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.assign" module="" category="">
	<digest>
		Assign Messages to MC Objects
	</digest>
	<description>
		The <o>mc.assign</o> object assigns MC channels to incoming messages (numbers, lists, and symbols) according to patterns of channels and delays you define.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Message In
			</digest>
			<description>
				<o>mc.assign~</o> accepts any message that will be repeated out the outlet, prepended by <m>setvalue</m> and a channel number.
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Message In
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				setvalue Message Output
			</digest>
			<description>
				<o>mc.assign</o> precedes any incoming message with the word <m>setvalue</m> followed by the channel number determined by the current pattern.
			</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>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Repeated to Output
			</digest>
			<description>
				<m>bang</m> message is repeated to the left outlet of <o>mc.assign</o> preceded by the word <m>setvalue</m> and the channel number determined by the current pattern.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				Repeated to Output
			</digest>
			<description>
				A number is repeated to the left outlet of <o>mc.assign</o> preceded by the word <m>setvalue</m> and the channel number determined by the current pattern.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Repeated to Output
			</digest>
			<description>
				A number is repeated to the left outlet of <o>mc.assign</o> preceded by the word <m>setvalue</m> and the channel number determined by the current pattern.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Repeated to Output
			</digest>
			<description>
				A list is repeated to the left outlet of <o>mc.assign</o> preceded by the word <m>setvalue</m> and the channel number determined by the current pattern.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Repeated to Output
			</digest>
			<description>
				A message is repeated to the left outlet of <o>mc.assign</o> preceded by the word <m>setvalue</m> and the channel number determined by the current pattern.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="chans" get="1" set="1" type="int" size="1">
			<digest>
				Channel Count
			</digest>
			<description>
				The <at>chans</at> attribute determines the maximum value that the random or cyclic pattern elements will generate. However, <at>chans</at> will not constrain literal numbers contained in a pattern.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Channel Count" />
			</attributelist>
		</attribute>
		<attribute name="delays" get="1" set="1" type="atom" size="1">
			<digest>
				Delay Times
			</digest>
			<description>
				The <at>delays</at> attribute sets a repeating pattern of delay times used when iterating through a chord in a pattern. For example, if <at>delays</at> is set to <m>100 200</m> and there is a four-item chord in a pattern (such as <m>| 1 2 3 4 |</m>), an incoming messages will output on channel 1 immediately, then output on channel 2 100ms later, then output on channel 3 200ms after that, then finally output on channel 4 100ms after that (because the delay pattern repeats). To clear the <at>delays</at> attribute and output all messages in a chord simulataneously, send the message <m>delays</m> with no arguments or the word <m>none</m>.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Delay Times" />
			</attributelist>
		</attribute>
		<attribute name="density" get="1" set="1" type="float" size="1">
			<digest>
				Event Density
			</digest>
			<description>
				Determines the probability of playing an event when a pattern element is a <b>*</b> or <b>$</b>. When <at>density</at> is set to 0.9, there is a 90% chance an incoming message will be sent out and 10% chance it will be skipped.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Event Density" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Mode
			</digest>
			<description>
				The <at>mode</at> attribute determines how incoming messages are handled by the current <at>pattern</at> and <at>delays</at>.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Normal">
							<digest>
								Play Complete Patterns
							</digest>
							<description>
								Each incoming message progresses through the complete pattern.
							</description>
						</enum>
						<enum name="Step">
							<digest>
								Step Through Patterns
							</digest>
							<description>
								Each incoming message uses one element of the current pattern, advancing to the next message to be used on the next incoming message.
							</description>
						</enum>
						<enum name="Listiter">
							<digest>
								Iterate Through Incoming Lists
							</digest>
							<description>
								Each incoming message progresses through the complete pattern. Groups of pattern elements (within vertical bars) are broken into individual numbers; the pattern advances, outputting one list element at a time until the both end of the list and the end of the pattern are reached. If the pattern is shorter than the list, it will repeat from the beginning. If the list is shorter than the pattern it will repeat from the beginning.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="pattern" get="1" set="1" type="atom" size="1">
			<digest>
				Pattern
			</digest>
			<description>
				Determines a cyclical pattern of channel assignments. The <at>pattern</at> attribute consists of channel numbers or symbolic elements that generate cyclical or random channel values (see discussion above for details). The <o>mc.assign</o> object always has a non-empty <at>pattern</at> attribute; the default pattern is <m>1 2 3 4 5 6</m>. To clear the pattern, set the <at>pattern</at> attribute to <m>none</m> or send the message <m>pattern</m> with no arguments.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Pattern" />
			</attributelist>
		</attribute>
		<attribute name="pos" get="1" set="1" type="int" size="1">
			<digest>
				Sequence Position
			</digest>
			<description>
				The <at>pos</at> attribute is the current position within the pattern. Changes to the position will mostly be ignored if a pattern is currently generating output messages.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Sequence Position" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="mc.target" />
		<seealso name="mc.makelist" />
		<seealso name="mc.route" />
		<seealso name="mc_events" module="core" type="vignette" />
		<seealso name="mc_events_newobjects" module="core" type="vignette" />
	</seealsolist>
	<discussion>
		The <o>mc.assign</o> object has a <at>pattern</at> attribute that defines how an incoming message is passed on to a connected MC object in the form of <m>setvalue</m> messages. The pattern uses a small set of symbols to describe how it behaves in response to an incoming message. The <o>mc.assign</o> object's <at>mode</at> attribute determines how incoming messages are handled by the pattern.
		<br />
		When the <at>mode</at> is set to Step, incoming messages advance through the pattern one step at a time. When the <at>mode</at> mode is set to Normal, <o>mc.assign</o> plays through the entire pattern for each incoming message. When the <at>mode</at> is set to Listiter, <m>list</m> messages are broken up into individual numbers. For example, an incoming list message <m>50 60 70</m> with a pattern of <m>2 3</m> would produce three messages: <m>setvalue 2 50</m>, <m>setvalue 3 60</m>, and <m>setvalue 2 70</m>.		<br />
		Here is a description of the behavior of each of the available pattern elements:
		<ul>
			<li>
				<i>number</i> (int) in a pattern always sends the message to the specified channel. If the pattern was <m>2 3 4</m> an incoming message would generate <m>setvalue</m> messages to channels 2, 3, and 4.
			</li>
			<li>
				The <b>|</b> (vertical bar) symbol starts and ends a &quot;chord&quot; which sends an incoming message to multiple channels. For example, to send the incoming message to channels 2 and 3 simultaneously, the pattern would be <m>| 2 3 |</m>. This simultaneous behavior will happen in all settings of the <at>mode</at> attribute.
			</li>
			<li>
				An <b>x</b> in a pattern skips the message and does not produce any output.
			</li>
			<li>
				An <b>*</b> (asterisk) in a pattern chooses the channel randomly. It can also choose to skip a message. The probability that <b>*</b> will output an incoming message is set by the <at>density</at> attribute. If the <at>density</at> is set to 0.9, a <b>*</b> in a pattern will output the message an average of 90% of the time (and skip the message 10% of the time). The <b>*</b> element does not repeat until all channels have been chosen. In other words it behaves like the Max <o>urn</o> object. (Compare with the <b>$</b> described below.)
			</li>
			<li>
				<b>+</b> (plus sign) in a pattern chooses the channel randomly without repeating along the lines of <b>*</b> but unlike <b>*</b>, <b>+</b> never skips a message.
			</li>
			<li>
				<b>$</b> (dollar sign) in a pattern chooses the channel randomly. It can also choose to skip a message. The probability that <b>$</b> will output an incoming message is set by the <at>density</at> attribute. If the <at>density</at> is set to 0.1, a <b>$</b> in a pattern will output the message an average of 10% of the time (and skip the message 90% of the time). Unlike the <b>*</b> element, <b>$</b> may repeat values. In other words it behaves like the Max <o>random</o> object.
			</li>
			<li>
				<b>#</b> (pound sign) in a pattern chooses the channel randomly like the <b>$</b> element, but unlike <b>$</b>, <b>#</b> never skips a message.
			</li>
			<li>
				The <b>^</b> (circumflex) in a pattern cycles through channels in ascending order. For example, if an <o>mc.assign</o> object with 4 channels contained the pattern <m>^ 1</m>, it would output incoming messages on channels 1, 1, 2, 1, 3, 1, 4, 1 before repeating.
			</li>
		</ul>
	</discussion>
</c74object>
