<?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="subdiv~" module="" category="">
	<digest>
		Integer Subdivision of a Phasor
	</digest>
	<description>
		The <o>subdiv~</o> object evenly subdivides an input phasor signal into any integer number of output phasor signals.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Functions
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				Phasor Input
			</digest>
			<description>
				Drive a <o>subdiv~</o> object with a signal that ramps from 0 to 1.
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output
			</digest>
			<description>
				Output phasor signals occurring at a rate that is an integer multiple of the input.
			</description>
		</outlet>
		<outlet id="1" type="signal">
			<digest>
				Step Number
			</digest>
			<description>
				A constant signal corresponding to the current step number of the output (starting at 0).
			</description>
		</outlet>
		<outlet id="2" type="int">
			<digest>
			</digest>
			<description>
				<o>subdiv~</o> 0 when the first step begins and continues outputting the step number as each output ramp begins. Note that these outputs are not synchronized with the audio signal.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="subdivisions" type="int" optional="0">
			<digest>
				Subdivisions
			</digest>
			<description>
				A typed-in argument sets the initial number of subdivisions of the input.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="subdivisions" type="int" optional="0" />
			</arglist>
			<digest>
				Subdivisions
			</digest>
			<description>
				Sets the number of subdivisions (from 1 to 16384)
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="subdivisions" type="float" optional="0" />
			</arglist>
			<digest>
				Converted to <m>int</m> 
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Phasor Input
			</digest>
			<description>
				Drive a <o>subdiv~</o> object with a signal that ramps from 0 to 1.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="div" get="1" set="1" type="int" size="1">
			<digest>
				Subdivisions
			</digest>
			<description>
				Sets the number of subdivisions (from 1 to 16384)
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Subdivisions" />
			</attributelist>
		</attribute>
		<attribute name="lockprob" get="1" set="1" type="int" size="1">
			<digest>
				Lock Probabilities
			</digest>
			<description>
				When <at>lockprob</at> is enabled, the cyclic probability pattern is locked to the cyclic duration pattern, so a probability decision is made per duration event. When <at>lockprob</at> is disabled, the probabilities follow the subdivided phasor output. Stated another way, when <at>lockprob</at> is disabled, the probabilities maintain their position within a cyclic duration pattern.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Lock Probabilities" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onff" />
			</attributelist>
		</attribute>
		<attribute name="pattern" get="1" set="1" type="atom" size="1">
			<digest>
				Pattern
			</digest>
			<description>
				Establishes a cyclic duration pattern that can modify the duration the phasor output of each step. Patterns consist of integers 1 and above, permitting you to break up the input into unequal durations. For example, if you are subdividing the input by 3, setting the <at>pattern</at> to <m>1 2</m>, which will output a phasor that takes 1/3 of the input time followed by a second phasor of 2/3 of the input time.
				<br />
				Note that <o>subdiv~</o> does not support duration patterns that do not line up with the current input subdivision. As an example, a <at>pattern</at> of <m>2 2 2</m> will not produce expected results because the middle element crosses the point where the input resets. You can often avoid this limitation by increasing the subdvision and reducing the rate of the input phasor. In general, patterns can span multiples of the current subdivision and will work properly as long as they always reset when the input resets. For example, with a subdivision of 3, you will see expected results with a <at>pattern</at> of <m>2 1 1 2 1 1 1</m> because the output ramps will always reset when the input resets.
				<br />
				If the <at>pattern</at> does not end at input reset boundary, it is padded with a last element. For example, if the subdivision is 5,  setting the <at>pattern</at> to <m>1 2</m> will result in a third step of <m>2</m> before the pattern resets.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Pattern" />
			</attributelist>
		</attribute>
		<attribute name="prob" get="1" set="1" type="atom" size="1">
			<digest>
				Probabilities
			</digest>
			<description>
				With the <at>prob</at> you can set a pattern of probabilities for each output ramp. Patterns consist of 0, 1, or a float between 0 and 1. When the pattern value is 0, the output of <o>subdiv~</o> will be a constant 0 for that step. When the pattern value is 1, the output of <o>subdiv~</o> is the normal phasor ramp. When the value is between 0 and 1, it is taken as a probability of the phasor occurring for that step. The pattern does not have to have the same length as the number of subdivisions. Example: a pattern of 0 1 0.5 will, over a cycle of three steps, never output the first time, always output the second time, and output the third step half the time. To clear the pattern (and always output every step), send the message <m>prob</m> the argument <m>none</m> or no arguments.
				<br />
				When both <at>prob</at> probability pattern and a <at>pattern</at> duration multiplier pattern are in use, the <at>prob</at> pattern is consulted whenver a new step in the duration pattern is started.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Probabilities" />
			</attributelist>
		</attribute>
		<attribute name="silentmode" get="1" set="1" type="int" size="1">
			<digest>
				Silent Step Output
			</digest>
			<description>
				Determines index output for when phasor output is skipped
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="2">
					<enumlist>
						<enum name="Hold Previous Step">
							<digest>
								Don't change step number
							</digest>
							<description>
								When <at>silentmode</at> is set to Hold Previous Step (0), the index output of <o>subdiv~</o> does not change from the previous step if the phasor output is zero.
							</description>
						</enum>
						<enum name="Output -1">
							<digest>
								Output -1
							</digest>
							<description>
								When <at>silentmode</at> is set to Output -1 (1), the index output of <o>subdiv~</o> is -1 if the phasor output is zero.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Silent Step Output" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="syncupdate" get="1" set="1" type="int" size="1">
			<digest>
				Sync Updates to Subdivisiona
			</digest>
			<description>
				If <at>syncupdate</at> is enabled, changes to the subdivision value will only take effect when either the input or output resets, according to the value of the enum.
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Off">
							<digest>
								No Update Synchronization
							</digest>
							<description>
								Changes to the subdivision value take effect immediately.
							</description>
						</enum>
						<enum name="Output Reset">
							<digest>
								Update on Output Reset
							</digest>
							<description>
								Changes to the subdivision value take effect when the output phasor resets.
							</description>
						</enum>
						<enum name="Input Reset">
							<digest>
								Update on Input Reset
							</digest>
							<description>
								Changes to the subdivision value take effect when the input phasor resets.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Sync Updates to Subdivisiona" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="phasor~" />
		<seealso name="kink~" />
		<seealso name="line~" />
		<seealso name="mc.snowphasor~" />
		<seealso name="pong~" />
		<seealso name="rate~" />
		<seealso name="swing~" />
		<seealso name="wrap~" />
	</seealsolist>
	<discussion>
		The <o>subdiv~</o> object is sample-accurate when Scheduler in Audio Interrupt is enabled. More details <link module="core" name="audio_sampleaccurate" type="vignette">here</link>.
	</discussion>
</c74object>
