<?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="pong~" module="msp" category="MSP Modifiers">
	<digest>
		Variable range signal folding
	</digest>
	<description>
		Use the <o>pong~</o> object to either fold or wrap its input within the range of a low value and a high value.
	</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/float">
			<digest>
				(signal/float) Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				(signal/float) Lo val
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal/float">
			<digest>
				(signal/float) Hi val
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="folding-mode" optional="1" type="int">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				An optional argument is used to set the mode of the <o>pong~</o> A 0 sets signal folding (the default), and a 1 sets signal wrapping (see the <m>mode</m> message).
			</description>
		</objarg>
		<objarg name="low-value" optional="1" type="float">
			<digest>
				Low range value
			</digest>
			<description>
				When used with the optional mode argument, the low range value for the <o>pong~</o> object can be specified by a float argument. If only one argument is given following the mode argument (e.g., <m>pong~ 0 .1</m>), it specifies the low range value of the <o>pong~</o> object above which folding occurs, and the high range value is set to 1.0 (the default).
			</description>
		</objarg>
		<objarg name="high-value" optional="1" type="float">
			<digest>
				Hight range value
			</digest>
			<description>
				When used with the optional mode argument, the high range value for the <o>pong~</o> object can be specified by a float argument.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: All incoming signal or float values which exceed the high or low value ranges specified by arguments to the <o>pong~</o> object are either folded back into this range (i.e., values greater than one are reduced by one plus the amount that they exceed one, and negative values are handled similarly) or wrapped (i.e., values greater than one are reduced by two, and negative values are increased by two), according to the mode of the <o>pong~</o> object (see the <m>mode</m> message).
				<br />
				<br />
				In center or right inlet: The <o>pong~</o> objects accepts low and high range values for the range outside of which folding occurs. If the <o>pong~</o> object has either one or no arguments, <o>pong~</o> will have two inlets. The right inlet is used to set the high range value above which signal folding occurs, the low range value is assumed to be zero.
				<br />
				<br />
				If the <o>pong~</o> object has two arguments, the object has three inlets. The center inlet specifies the low value range below which folding occurs, and the right inlet specifies the high range limit. The default object has no arguments, and the right inlet specifies the upper value.
				<br />
				<br />
				If the current low range value is greater than the high range value, their behavior is swapped.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: All incoming signal or float values which exceed the high or low value ranges specified by arguments to the <o>pong~</o> object are either folded back into this range (i.e., values greater than one are reduced by one plus the amount that they exceed one, and negative values are handled similarly) or wrapped (i.e., values greater than one are reduced by two, and negative values are increased by two), according to the mode of the <o>pong~</o> object (see the <m>mode</m> message).
				<br />
				<br />
				In center or right inlet: The <o>pong~</o> objects accepts low and high range values for the range outside of which folding occurs. If the <o>pong~</o> object has either one or no arguments, <o>pong~</o> will have two inlets. The right inlet is used to set the high range value above which signal folding occurs, the low range value is assumed to be zero.
				<br />
				<br />
				If the <o>pong~</o> object has two arguments, the object has three inlets. The center inlet specifies the low value range below which folding occurs, and the right inlet specifies the high range limit. The default object has no arguments, and the right inlet specifies the upper value.
				<br />
				<br />
				If the current low range value is greater than the high range value, their behavior is swapped.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="mode" get="1" set="1" type="symbol" size="1">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="4">
					<enumlist>
						<enum name="none">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="clip">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="wrap">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="fold">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enum" />
			</attributelist>
		</attribute>
		<attribute name="range" get="1" set="1" type="float" size="2">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="pong~.png" caption="pong~ distorts a signal by folding it or wrapping it around an upper and lower threshold level" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="phasewrap~" />
	</seealsolist>
	<discussion>
		The optional arguments are &lt;mode&gt; &lt;lo val&gt; &lt;hi val&gt;. <m>mode 0</m> is fold, <m>mode 1</m> is wrap. The default mode is fold. The default range is zero to one. If &lt;hi val&gt; is greater than &lt;lo val&gt;, their behavior is swapped. All inlets accept both signals and floats. The <m>mode</m> message may be used to switch between fold and wrap mode. It is useful for performing modulo arithmetic, as well as foldover or wraparound distortion.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				The folded signal or float value.
			</description>
		</entry>
	</misc>
</c74object>
