<?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.mixdown~" module="msp" category="MC, MSP, MSP System">
	<digest>
		Mix and pan a multichannel signal
	</digest>
	<description>
		The <o>mc.mixdown~</o> object mixes channels in a multichannel signal connected to its left inlet to a multichannel output. <o>mc.mixdown~</o> can use a signal connected to its right inlet to pan the channels of its left (mix) input signal.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="multi-channel signal">
			<digest>
				Input
			</digest>
			<description>
				Multichannel signal to mix
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal">
			<digest>
				Pan Positions
			</digest>
			<description>
				Pan position for corresponding mix input channel
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="multi-channel signal">
			<digest>
				Output
			</digest>
			<description>
				<o>mc.mixdown~</o> outputs a multichannel signal mixed from the channels in its left input. The number of channels in the output is set by the argument to the <o>mc.mixdown~</o> object, and the number of channels in the mix is determined by the current value of the <at>activechans</at> attribute. Extra channels are zero.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="output-channel-count" type="int" optional="1">
			<digest>
				Output channel count
			</digest>
			<description>
				An optional argument sets the number of channels in the multichannel output signal (default 2).
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="signal">
			<arglist />
			<digest>
				Mix and pan inputs
			</digest>
			<description>
				In left inlet: a multichannel signal to mix
				<br />
				In right inlet: a single- or multichannel signal with pan information
				<br />
				<br />
				Without a signal connected to the right inlet, <o>mc.mixdown~</o> alternates input channels to output channels (output channel 1 contains inputs 1, 3, 5, ... and output channel 2 contains input 2, 4, 6...). With a signal connected to the right inlet, <o>mc.mixdown~</o> performs N-way panning. The pan behavior is determined by the <at>linearpanmode</at>, <at>pancontrolmode</at>, and <at>activechans</at> attributes.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="activechans" get="1" set="1" type="int" size="1">
			<digest>
				Active Channels
			</digest>
			<description>
				Setting the <at>activechans</at> attribute reduces the number of channels that will be used for mixing. Extra channels will be set to zero. Use of <at>activechans</at> provides a way to set different output mix channel counts without repatching. For example, you could switch your patch from multichannel to stereo output by using an <o>mc.mixdown~</o> object with an argument of 5, then setting <at>activechans</at> to 2 at runtime.
			</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="Active Output Channels" />
			</attributelist>
		</attribute>
		<attribute name="autogain" get="1" set="1" type="int" size="1">
			<digest>
				Gain Compensation
			</digest>
			<description>
				When <at>autogain</at> is enabled, overall gain is scaled by the number of output channels (as determined by the <at>activechans</at> attribute) divided by the number of input channels.
			</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="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Gain Compensation" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="busymapname" get="1" set="1" type="symbol" size="1">
			<digest>
				Busy Map Name
			</digest>
			<description>
				When the <at>usebusymap</at> attribute is enabled, <o>mc.mixdown~</o> uses the local busy map of any <o>mc.voiceallocator~</o> or <o>mc.noteallocator~</o> object in the same patcher by default. To use a named global busy map instead, set the <at>busymapname</at> attribute to the desired name.
			</description>
			<attributelist>
				<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="Busy Map Name" />
			</attributelist>
		</attribute>
		<attribute name="chans" get="1" set="1" type="int" size="1">
			<digest>
				Output Channels
			</digest>
			<description>
				Sets the number of output channels in the multichannel output. If <at>chans</at> is sent to the object when audio is on, the number of output channels will not change until the audio is turned off and back on again.
			</description>
			<attributelist>
				<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="Output Channels" />
			</attributelist>
		</attribute>
		<attribute name="linearpanmode" get="1" set="1" type="int" size="1">
			<digest>
				Linear Pan Mode
			</digest>
			<description>
				When enabled, <o>mc.mixdown~</o> applies a linear pan scaling factor to all input channels. This scaling factor is set by the <at>linearpanscalefactor</at> attribute (default 1). When <at>linearpanmode</at> is disabled (the default), <o>mc.mixdown~</o> applies a constant power pan scale factor (square root of 2 over 2).
			</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="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Linear Pan Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="linearpanscalefactor" get="1" set="1" type="float" size="1">
			<digest>
				Linear Pan Scale Factor
			</digest>
			<description>
				Sets the panning scale factor to apply to all input channels when <at>linearpanmode</at> is enabled (default 1).
			</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="default" get="1" set="1" type="float" size="1" value="1." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Linear Pan Scale Factor" />
			</attributelist>
		</attribute>
		<attribute name="pancontrolmode" get="1" set="1" type="int" size="1">
			<digest>
				Pan Control Mode
			</digest>
			<description>
				The <at>pancontrolmode</at> determines how <o>mc.mixdown~</o> interprets values in its pan input signal. In all pan control modes, values outside the specified range are wrapped around to be within the range.
			</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="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="4">
					<enumlist>
						<enum name="Circle (0 - 1)">
							<digest>
							</digest>
							<description>
								When <at>pancontrolmode</at> is 0 (default), <o>mc.mixdown~</o> interprets pan values in a circular map with 0.5 defined as the &quot;front&quot; position between the two middle channels (if there are an even number of output channels) or the center channel (if there are an odd number of output channels). For stereo output, panning all the way to the left (channel 1) is at 0.25 and panning all the way to the right (channel 2) is at 0.75. For higher output channel counts, exact pan for a specific channel can be calculated by dividing 1 by twice the number of output channels and then using odd numbers for the value of the numerator. For example, for 4 channels, the exact pan for channel 1 is at 1/8 (0.125), channel 2 is at 3/8 (0.375), channel 3 is at 5/8 (0.625), and channel 4 is at 7/8 (0.875). (If all this math seems daunting, look at the other <at>pancontrolmode</at> settings below.)
							</description>
						</enum>
						<enum name="Line (0 - 1)">
							<digest>
							</digest>
							<description>
								When <at>pancontrolmode</at> is 1, all channels are arranged in a line with panning to the first channel at 0 and the last channel at 1. This prevents any panning between the first and last channel in a case where the number of outputs are larger than 2. However, for the 2-channel output case where this is not an issue, it is often more convenient to produce a signal where 0 represents channel 1 and 1 represents channel 2.
							</description>
						</enum>
						<enum name="Line (1 - N)">
							<digest>
							</digest>
							<description>
								When <at>pancontrolmode</at> is 2, all channels are arranged in a line with panning to the first channel at 1 and the last channel when the the pan value is equal to the output channel count. This prevents any panning between the first and last channel in a case where the number of outputs are larger than 2.
							</description>
						</enum>
						<enum name="Circle (0 - N)">
							<digest>
							</digest>
							<description>
								When <at>pancontrolmode</at> is 3, <o>mc.mixdown~</o> interprets pan values in a circular map where panning only to each output channel is represented by a whole number. Values between 0 and 1 represent a pan position between the first and last output channels.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Pan Control Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="usebusymap" get="1" set="1" type="int" size="1">
			<digest>
				Use Allocator Busy Map
			</digest>
			<description>
				When <at>usebusymap</at> is enabled, <o>mc.mixdown~</o> will not mix non-busy channels in its mix input. This can increase efficiency and avoid unpleasant noise when mixing channels that are not set to zero. Note that the way <o>mc.mixdown~</o> uses the busy map is somewhat different from the way the MC wrapper uses it, but the two systems are designed to work together.
			</description>
			<attributelist>
				<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="Use Allocator Busy Map" />
				<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="mc.dac~" />
		<seealso name="mc.live.gain~" />
		<seealso name="gain~" />
		<seealso name="mc.op~" />
		<seealso name="mc_channel_topology" module="core" type="vignette" />
		<seealso name="mc_hardware_routing" module="core" type="vignette" />
		<seealso name="mc_mixing_panning" module="core" type="vignette" />
	</seealsolist>
</c74object>
