<?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="round~" module="msp" category="MSP Modifiers">
	<digest>
		Round an input signal value
	</digest>
	<description>
		Use the <o>round~</o> object to round a signal input to an integer multiple.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Modifiers
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				Round to nearest this
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="int or float" optional="1" type="number">
			<digest>
				Value to round
			</digest>
			<description>
				Sets the value to which the input signal will be rounded. The default value is 0. (no modification).
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="rounding-multiple-specifier" optional="0" type="int" />
			</arglist>
			<digest>
				Set a number whose multiples will be used for rounding
			</digest>
			<description>
				In right inlet: an <m>int</m> will cause the input to be rounded to the nearest multiple of the specified number. If a signal is attached to the inlet, <m>int</m> messages are ignored.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="rounding-multiple-specifier" optional="0" type="float" />
			</arglist>
			<digest>
				Set a number whose multiples will be used for rounding
			</digest>
			<description>
				In right inlet: a <m>float</m> will cause the input to be rounded to the nearest multiple of the specified number. If a signal is attached to the inlet, <m>float</m> messages are ignored.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: A signal whose values will be rounded.
				<br />
				<br />
				In right inlet: A signal whose value is used for rounding. Signal values received in the left inlet will be rounded to either the absolute nearest integer multiple or the nearest integer multiple between the value received in this inlet or 0 (see the <m>nearest</m> message for more information).
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="nearest" get="1" set="1" type="int" size="1">
			<digest>
				Nearest multiple rounding toggle
			</digest>
			<description>
				When set to 1 (the default), the <o>round~</o> object will round to the nearest multiple of the specified signal value.
				<br />
				<br />
				Note: This attribute does not set the rounding step (which is set using <o>round~</o> object's right inlet), It specifies that rounding to the nearest signal value will occur. Here are some examples:
				<br />
				<br />
				With the rounding interval set to 3 and the <m>nearest</m> attribute set to 1:
				<br />
				an input signal value of 5.8 will return 6
				<br />
				an input signal value of 3.7 will return 3
				<br />
				an input signal value of -1 will return 0
				<br />
				an input signal value of -2.7 will return -3
				<br />
				<br />
				With the rounding interval set to 3 and the <m>nearest</m> attribute set to 0:
				<br />
				an input signal value of 5.8 will return 3
				<br />
				an input signal value of 3.7 will return 3
				<br />
				an input signal value of -1 will return 0
				<br />
				an input signal value of -2.7 will return 0
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Round to the nearest Multiple" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="round~.png" caption="round~ takes floating-point signals and rounds them to a specific increment" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="rampsmooth~" />
		<seealso name="slide~" />
		<seealso name="trunc~" />
		<seealso name="round" />
	</seealsolist>
	<discussion>
		You can set the object's 'nearest' attribute to determine whether or not it rounds to the absolute nearest integer multiple, or the nearest integer multiple between the value and zero (for positive numbers this will round down). By default this is on.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				The rounded input signal.
			</description>
		</entry>
	</misc>
</c74object>
