<?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="drunk" module="max" category="Math">
	<digest>
		Output random numbers within a step range
	</digest>
	<description>
		Performs a &quot;drunken&quot; walk by outputting random numbers within a specified step range.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				bang Outputs Random Step, int Sets Value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Sets Range Size
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				Sets Step Size
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Random Walk Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="maximum value" optional="1" type="int">
			<digest>
				Set the maximum number for output
			</digest>
			<description>
				Sets the maximum number produced. If this argument is not provided, the maximum value is set to 128.
			</description>
		</objarg>
		<objarg name="step size" optional="1" type="int">
			<digest>
				Set the step size
			</digest>
			<description>
				Sets an initial limit on the size of random steps taken; the absolute value of the step size will always be less than the absolute value of this limit. If a negative value is specified as a step size, steps of size zero are never generated. If this argument is not provided, the step size is set to 2 (movement up or down by no more than 1).
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output a random value
			</digest>
			<description>
				Causes <o>drunk</o> to take a step of random size up or down from its currently stored value. It updates the stored value and outputs it.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the current value
			</digest>
			<description>
				The number replaces the stored value and is sent out the outlet.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				See the <m>int</m> message
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="maximum" optional="0" type="int" />
			</arglist>
			<digest>
				Set the output maximum
			</digest>
			<description>
				In middle inlet: The number is stored as the maximum value that can be output by <o>drunk</o>. If the specified maximum is less than 0 it is set to <m>0</m>.
			</description>
		</method>
		<method name="in2">
			<arglist>
				<arg name="step-size" optional="0" type="int" />
			</arglist>
			<digest>
				Set the step size
			</digest>
			<description>
				In right inlet: The number limits the step size taken in response to a <m>bang</m> in the left inlet. The step (up or down) will always be less than the absolute value of this number.
			</description>
		</method>
		<method name="seed">
			<arglist>
				<arg name="random-seed" optional="0" type="int" />
			</arglist>
			<digest>
				Seed the random number generator
			</digest>
			<description>
				Seeds the object's random generator, which causes a specific (reproducible) sequence of pseudo-random numbers to occur. The number <m>0</m> uses the time elapsed since system startup (an unpredictable value) as the seed, ensuring an unpredictable sequence of numbers.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Set the stored value, no output
			</digest>
			<description>
				The word <m>set</m>, followed by a number, sets the stored value to that number without triggering output. The stored value is initially set in the center of the total range (1/2 the maximum value).
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="drunk.png" caption="Numbers vary aimlessly in small steps taken within the total range" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="decide" />
		<seealso name="random" />
		<seealso name="urn" />
		<seealso name="basicchapter10" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				The number sent out the outlet is automatically limited between 0 and the specified maximum value, and differs from the previously stored number by less than the maximum step size.
			</description>
		</entry>
	</misc>
</c74object>
