<?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.snowphasor~" module="MSP" category="MC">
	<digest>
		Control a Population of Phasors
	</digest>
	<description>
		The <o>mc.snowphasor~</o> object generates phasor ramps in multiple audio channels according to global controls such as an average rate. The object can also trigger ramps from a multi-channel audio signal.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Functions
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Audio Trigger
			</digest>
			<description>
				When the Trigger Mode (<at>mode</at>) attribute of <o>mc.snowphasor~</o> is set to <m>Audio</m> (3), a new phasor ramp is started on an output channel corresponding to any channel where a sample value exceeds the current signal input threshold. If there are more input audio channels than output channels (set by the <at>chans</at> attribute), the additional input channels are ignored.
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				Ramp Duration
			</digest>
			<description>
				A signal connected to the right inlet sets the ramp duration, overriding the value of the <at>decaytime</at> attribute. If a multi-channel signal is connected, the channel of the input corresponding to the channel of the output ramp is used for the duration.
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="multi-channel signal">
			<digest>
				Phasors
			</digest>
			<description>
				Audio signals consisting of 0 - 1 ramps triggered according to the <o>mc.snowphasor~</o> object's current settings.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="signal">
			<arglist />
			<digest>
				Audio Trigger
			</digest>
			<description>
				In left inlet: When the Trigger Mode (<at>mode</at>) attribute of <o>mc.snowphasor~</o> is set to <m>Audio</m> (3), a new phasor ramp is started. If the <at>perchantriggers</at> attribute is set, the ramp occurs only on a non-busy output channel corresponding to any channel where a sample exceeds the current signal input threshold. If there are more input audio channels than output channels -- the output channel count is set by the <at>chans</at> attribute -- the additional input channels are ignored. If <at>perchantriggers</at> is 0, the next available (non-busy) output channel is used.
				<br />
				In right inlet: A signal connected to the right inlet sets the ramp duration, overriding the value of the <at>decaytime</at> attribute. If a multi-channel signal is connected, the channel of the input corresponding to the channel of the output ramp is used for the duration.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="busymapname" get="1" set="1" type="symbol" size="1">
			<digest>
				Busy Map Name
			</digest>
			<description>
				If the Use Busy Map (<at>usebusymap</at>) attribute is set, the <at>busymapname</at> specifies a named busy map other than the default global busy map.
			</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="Busy Map Name" />
			</attributelist>
		</attribute>
		<attribute name="chans" get="1" set="1" type="int" size="1">
			<digest>
				Output Channels (Fixed)
			</digest>
			<description>
				Sets the number of output channels. If the value of <at>chans</at> is 0, the number of outputs auto-adapts to the number of channels in a multi-channel signal connected to the object's inlet. If the value of <at>chans</at> is non-zero, the number of channels in the multi-channel output are fixed and do not auto-adapt to the input.
			</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="Output Channels (Fixed)" />
			</attributelist>
		</attribute>
		<attribute name="interval" get="1" set="1" type="float" size="1">
			<digest>
				Interval
			</digest>
			<description>
				When the <at>mode</at> attribute is set to <m>Utilization</m> (0), <at>interval</at> sets the time between updates of the population density of output phasors per unit time. New phasors will be started only during one of these updates.
				<br />
				When the <at>mode</at> attribute is set to <m>Rate</m> (1), <at>interval</at> sets time between updates of the average rate per unit time of phasors. New phasors will only be started during one of these updates. Even if the <at>rate</at> is effectively faster than the <at>interval</at>, phasors will not be generated closer together in time than the <at>interval</at> specifies. When the <at>rate</at> would generate multiple phasors in the time of an <at>interval</at> they are started simultaneously. When the <at>mode</at> attribute is set to <m>Audio</m> (3), <at>interval</at> is ignored. When the <at>mode</at> attribute is set to <m>Interval</m> (2), <at>interval</at> sets the time between phasor triggers and the <at>rate</at> is ignored.
			</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="Interval" />
			</attributelist>
		</attribute>
		<attribute name="intervalcycle" get="1" set="1" type="int" size="1">
			<digest>
				Interval Deviation Cycle (2 - 16)
			</digest>
			<description>
				Sets the number of intervals after which the mean interval time (as specified by the <at>interval</at> attribute) is restored. The time interval used by <o>mc.snowphasor~</o> is not necessarily the value of the <at>interval</at> attribute if the <at>intervaldev</at> attribute is set to a non-zero value and creates variation in the intervals calculated. As an example, say the <at>interval</at> is set to 100 ms but the last interval (due to a non-zero <at>intervaldev</at>) was 90. If the <at>intervalcycle</at> attribute is set to 2, the next interval used will be 110, in order that over the space of two intervals, the mean is maintained to be 100. If the <at>intervalcycle</at> attribute is set to 10, nine intervals will be generated before the tenth interval is adjusted to maintain the mean interval time. In the rare event that the prior intervals already exceed the mean interval time before the last interval of the cycle is calculated, the resulting correction interval will be 1 ms. In general, the larger the interval cycle the &quot;wider&quot; the interval variatons can be with larger values of <at>intervaldev</at>.
			</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="Interval Deviation Cycle (2 - 16)" />
			</attributelist>
		</attribute>
		<attribute name="intervaldev" get="1" set="1" type="float" size="1">
			<digest>
				Interval Deviation (0-1)
			</digest>
			<description>
				Sets the proportion of the current value of the <at>interval</at> attribute that is allowed to vary randomly (above or below). An <at>intervaldev</at> value of 0 will produce no random variation in the interval.
			</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="Interval Deviation (0-1)" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Trigger Mode
			</digest>
			<description>
				Determines how new phasor ramps are triggered
			</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="4">
					<enumlist>
						<enum name="utilization">
							<digest>
								Utilization Mode
							</digest>
							<description>
								Maintains a proportion of the total available time and space (channels) with active phasor ramps, as set by the <at>prob</at> attribute. The <at>interval</at> attribute sets the time between updates of the utilization and triggering of new phasors. As the <at>interval</at> becomes larger, phasors will be triggered simtaneously to maintain the utilization level (more like a metronome). When the interval is small, the phasor triggering will be more distributed and it will be less likely that phasors will be triggered simultaeously.
							</description>
						</enum>
						<enum name="rate">
							<digest>
								Rate Mode
							</digest>
							<description>
								Attempts to maintain a rate of new phasor triggerings (births) per unit time for each channel, as set by the <at>rate</at> attribute. However, if the <at>interval</at> attribute is to a time value that is slower than the <at>rate</at> there may be more simultanous triggerings further apart.
								<br />
								As an example, if the <at>interval</at> is 50 ms and the <at>rate</at> is 4, one phasor will be started roughly every 250 ms, because <o>mc.snowphasor~</o> will check whether it's time to start a phasor every 50 ms. However, if the <at>interval</at> is 2000 ms, you'll hear as many as 20 phasors starting together every 2000 ms, because <o>mc.snowphasor~</o> only checks whether to start new phasors every 2000 ms. The effective rate of phasor starting at any momment may be further affected by the <at>ratedev</at>, <at>prob</at>, <at>probdev</at>, and <at>intervaldev</at> attributes.
							</description>
						</enum>
						<enum name="interval">
							<digest>
								Interval Mode
							</digest>
							<description>
								Maintains a constant interval between phasor triggerings, as set by the <at>interval</at> and <at>intervaldev</at> attributes. The <at>prob</at> attribute determines the probability of a phasor being triggered at any particular interval. The <at>rate</at> attribute has no effect in this mode.
							</description>
						</enum>
						<enum name="audio">
							<digest>
								Audio Mode
							</digest>
							<description>
								Triggers new phasors when audio-channels sample values exceed the signal input threshold (set by the <at>threshold</at> attribute). The <at>rate</at> and <at>interval</at> attributes have no effect in this mode.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Trigger Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="perchantriggers" get="1" set="1" type="int" size="1">
			<digest>
				Per-Channel Audio Triggering
			</digest>
			<description>
				When the <at>perchantriggers</at> is set, zero to non-zero transitions on input audio channels only trigger corresponding output channels. When <at>perchantriggers</at> is 0, triggers are applied to any available output channel. <at>perchantriggers</at> is only applicable when the <at>mode</at> is set to <m>Audio</m> (3).
			</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="Per-Channel Audio Triggering" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="prob" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Utilization Probability (0-1)
			</digest>
			<description>
				When the <at>mode</at> attribute is set to <m>Utilization</m> (0), the <at>prob</at> attribute sets the percentage of time across all audio output channels occupied by phasor ramps. As the <m>decaytime</m> attribute value is increased, the average number of new ramps (births) per unit time will be lower.
				<br />
				When the <at>mode</at> attribute is set to <m>Rate</m> (1), the value of <at>prob</at> reduces the average <at>rate</at> (the actual rate will be the value of the <at>rate</at> multiplied by the <at>prob</at>). For example if the <at>prob</at> is 0.5 and it is time to start a new phasor according to the <at>rate</at>, it will only happen half the time based on a random decision.
				<br />
				When the <at>mode</at> attribute is set to <m>Interval</m> (2), the <at>prob</at> determines whether a phasor is actually generated at the specified interval. If the value of <at>prob</at> is 1.0, the phasor will always be generated. If the value of <at>prob</at> is 0.5, the phasor will be generated half the time based on a random decision.
				<br />
				When the <at>mode</at> attribute is set to <m>Audio</m> (3), <at>prob</at> has no effect.
			</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="Ramp Probability (0-1)" />
			</attributelist>
		</attribute>
		<attribute name="probdev" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Utilization Deviation (0-1)
			</digest>
			<description>
				Sets the proportion of the current value of the <at>prob</at> attribute that is allowed to vary randomly (above or below). An <at>probdev</at> value of 0 will produce no random variation in the utilization probability.
			</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="Ramp Probability Deviation (0-1)" />
			</attributelist>
		</attribute>
		<attribute name="rampdev" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Time Deviation (0-1)
			</digest>
			<description>
				Sets the proportion of the current value of the <at>ramptime</at> attribute that is allowed to vary randomly (above or below). A <at>rampdev</at> value of 0 will produce no random variation in the ramp time.
			</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="Ramp Time Deviation (0-1)" />
			</attributelist>
		</attribute>
		<attribute name="ramptime" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Time
			</digest>
			<description>
				Sets the duration in milliseconds of a phasor ramp produced by <o>mc.snowphasor~</o>.
			</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="Ramp Time" />
			</attributelist>
		</attribute>
		<attribute name="rate" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Birth Rate (per second)
			</digest>
			<description>
				When the <at>mode</at> attribute is set to <m>Rate</m> (1), the <at>rate</at> attribute sets the rate per second of phasor ramps triggerings (births). When the <at>mode</at> attribute is set to other values, the <at>rate</at> attribute has no effect.
			</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="Ramp Birth Rate (per second)" />
			</attributelist>
		</attribute>
		<attribute name="ratedev" get="1" set="1" type="float" size="1">
			<digest>
				Ramp Birth Rate Deviation (0-1)
			</digest>
			<description>
				Sets the proportion of the current value of the <at>rate</at> attribute that is allowed to vary randomly (above or below). An <at>rate</at> value of 0 will produce no random variation in the ramp birth rate.
			</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="Ramp Birth Rate Deviation (0-1)" />
			</attributelist>
		</attribute>
		<attribute name="threshold" get="1" set="1" type="float" size="1">
			<digest>
				Signal Input Threshold
			</digest>
			<description>
				Sets the minimum sample value for a ramp trigger in Audio Mode.
			</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="Signal Input Threshold" />
			</attributelist>
		</attribute>
		<attribute name="usebusymap" get="1" set="1" type="int" size="1">
			<digest>
				Use Allocator Busy Map
			</digest>
			<description>
				When the <at>usebusymap</at> attribute is set, <o>mc.snowphasor~</o> incorporates the busy map into its voice allocation algorithm and sets channels in the busy map to be busy when triggering ramps.
			</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="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="change~" />
		<seealso name="line~" />
		<seealso name="phasor~" />
		<seealso name="snowfall~" />
		<seealso name="updown~" />
	</seealsolist>
</c74object>
