<?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.voiceallocator~" module="msp" category="MC">
	<digest>
		Manage voice numbers for events
	</digest>
	<description>
		The <o>mc.voiceallocator~</o> object assigns voice numbers to incoming messages using an optional multichannel signal to determine voice busy state. It also maintains a voice busy map used by other MC objects to avoid unnecessary processing for channels that are not actively producing audio in response to events.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			TEXT_HERE
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="multi-channel signal">
			<digest>
				Multichannel signal representing busy state; any message along with specific messages to manage allocating and releasing voices.
			</digest>
			<description>
				A multichannel signal connected to <o>mc.voiceallocator~</o>'s left inlet establishes a voice busy state. Typically you'll connect the multichannel output of audio triggered by events passing through <o>mc.voiceallocator~</o>. This permits you to hold a voice busy after an event that release a voice has been received.
				<br />
				<br />
				Use <m>event</m>, <m>endevent</m>, and <m>releaseevent</m> messages to manage voice allocation.
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal">
			<digest>
				Busy Signal, Messages
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Messages Out
			</digest>
			<description>
				Incoming messages are sent out the left outlet, preceded by an associated voice number out the right outlet.
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Voice Number
			</digest>
			<description>
				An allocated voice number is sent immediately prior to its associated message is sent out the left outlet.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="voice count" type="int" optional="1">
			<digest>
				Voice Count
			</digest>
			<description>
				An optional argument can set a maximum number of voice numbers the <o>mc.voiceallocator~</o> object will use. If no argument is supplied, the default voice count is 0, meaning that <o>mc.voiceallocator~</o> will set its maximum voice count by the number of channels in a connected multichannel input. If there is no connected multichannel input, the default voice count is 16.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output voice number and bang
			</digest>
			<description>
				The <m>bang</m> message is repeated to the left outlet preceded by a new voice number sent out the right outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
			</arglist>
			<digest>
				Output voice number and value
			</digest>
			<description>
				The number is repeated to the left outlet preceded by a new voice number sent out the right outlet.
			</description>
		</method>
		<method name="float">
			<arglist>
			</arglist>
			<digest>
				Output voice number and value
			</digest>
			<description>
				The number is repeated to the left outlet preceded by a new voice number sent out the right outlet.
			</description>
		</method>
		<method name="list">
			<arglist>
			</arglist>
			<digest>
				Output voice number and list
			</digest>
			<description>
				The list is repeated to the left outlet preceded by a new voice number sent out the right outlet.
			</description>
		</method>
		<method name="anything">
			<arglist />
			<digest>
				Output voice number and message
			</digest>
			<description>
				The message is repeated to the left outlet preceded by a new voice number sent out the right outlet.
			</description>
		</method>
		<method name="endevent">
			<arglist>
				<arg name="event name" type="list" optional="0" />
			</arglist>
			<digest>
				Ends a named event
			</digest>
			<description>
				The word <m>endevent</m>, followed by an event name defined by the <m>event</m> message, releases the voice associated with the event. The entire <m>endevent</m> message is repeated to the left outlet.
			</description>
		</method>
		<method name="event">
			<arglist>
				<arg name="event-name" type="list" optional="0" />
			</arglist>
			<digest>
				Starts a named event
			</digest>
			<description>
				The word <m>event</m>, followed by an event name and a message, sends the entire <m>event</m> message out the left outlet preceded by a newly allocated voice number. The name can later be used with the <m>endevent</m> message to release the voice that became associated with the event.
			</description>
		</method>
		<method name="holdevent">
			<arglist>
				<arg name="event-name" type="list" optional="0" />
			</arglist>
			<digest>
				Starts and holds a named event
			</digest>
			<description>
				The word <m>holdevent</m>, followed by an event name and a message, sends the entire <m>holdevent</m> message out the left outlet preceded by a newly allocated voice number. The name can later be used with the <m>endevent</m> message to release the voice that became associated with the event. Unlike the <m>event</m> message, <m>holdevent</m> explicitly holds the named event until connected audio reaches zero.
			</description>
		</method>
		<method name="printbusymap">
			<arglist />
			<digest>
				Print state of busy map
			</digest>
			<description>
				Prints the current state of the <o>mc.voiceallocator~</o> busy map to the Max Console as a list.
			</description>
		</method>
		<method name="release">
			<arglist>
				<arg name="voice number" type="list" optional="1" />
			</arglist>
			<digest>
				Release voice
			</digest>
			<description>
				The word <m>release</m>, followed by a voice number, releases that voice number (sets to a non-busy state). Without an argument, <m>release</m> sets all voices to a non-busy state.
			</description>
		</method>
		<method name="releaseevent">
			<arglist>
				<arg name="event-name" type="list" optional="0" />
			</arglist>
			<digest>
				Release event without output
			</digest>
			<description>
				The word <m>releaseevent</m>, followed by an event name defined by an <m>event</m> message, releases the voice number associated with the named event but unlike <m>endevent</m>, does not produce a message out the left outlet.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Sets busy state
			</digest>
			<description>
				Connect an optional multichannel signal to prevent <o>mc.voiceallocator~</o> from reallocating a voice until the corresponding channel's signal level goes to zero.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="initialbusystate" get="1" set="1" type="int" size="1">
			<digest>
				Initial Busy State
			</digest>
			<description>
				Sets the initial busy state. The default value is 1. Set this to zero to avoid high CPU usage before sending events when audio is turned on.
			</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="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Initial Busy State" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="name" get="1" set="1" type="symbol" size="1">
			<digest>
				Busy map name
			</digest>
			<description>
				The <at>name</at> attribute assigns a global name to the object's busy map. By default, <o>mc.voiceallocator~</o>'s busy map does not have a name and is available only to MC objects within the same patcher. A named busy map is accessible to all MC objects (in any patcher) that refer to it using the <at>busymapname</at> attribute.
			</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="Name" />
			</attributelist>
		</attribute>
		<attribute name="steal" get="1" set="1" type="int" size="1">
			<digest>
				Voice Stealing
			</digest>
			<description>
				When set to 1, the <at>steal</at> attribute allows messages to pass through mc.voiceallocator~ and are assigned to voice numbers when all voices have been allocated. When set to 0, messages are not passed through and are not assigned to voice numbers if all voices are already allocated.
			</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="Voice Stealing" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="voices" get="1" set="1" type="int" size="1">
			<digest>
				Voice Count
			</digest>
			<description>
				The <at>voices</at> attribute sets the maximum voice number <o>mc.voiceallocator~</o> will allocate and output. When <at>voices</at> is 0 (the default), the active voice count is determined by the number of channels in the connected multichannel signal. If there is no connected signal, <o>mc.voiceallocator~</o> defaults to 16 voices.
			</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="Voice Count" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="mc.noteallocator~" />
		<seealso name="mc_poly_without_polytilde" module="core" type="vignette" />
		<seealso name="mc_polyphony" module="core" type="vignette" />
	</seealsolist>
</c74object>
