<?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 clip, 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>
				Set fold, wrap, or clip mode.
			</digest>
			<description>
				An optional argument is used to set the mode of the <o>pong~</o>. A 0 sets signal folding (the default), a 1 sets signal wrapping, and a 2 sets signal clipping (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="input" type="int" optional="0" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: All incoming signal, int, 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, wrapped, or clipped according to the <at>mode</at> of the <o>pong~</o> object.
				<br />
				<br />
				In center or right inlet: The <o>pong~</o> object accepts low and high range values for the range outside of which folding occurs. The center inlet specifies the low value range below which folding occurs, and the right inlet specifies the high range limit.
				<br />
				<br />
				If the current low range value is greater than the high range value, their behavior is swapped.
			</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, int, 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, wrapped, or clipped according to the <at>mode</at> of the <o>pong~</o> object.
				<br />
				<br />
				In center or right inlet: The <o>pong~</o> object accepts low and high range values for the range outside of which folding occurs. The center inlet specifies the low value range below which folding occurs, and the right inlet specifies the high range limit.
				<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, int, 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, wrapped, or clipped according to the <at>mode</at> of the <o>pong~</o> object.
				<br />
				<br />
				In center or right inlet: The <o>pong~</o> object accepts low and high range values for the range outside of which folding occurs. The center inlet specifies the low value range below which folding occurs, and the right inlet specifies the high range limit.
				<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>
				Behaviour of limiting when input exceeds range
			</digest>
			<description>
				Behaviour of limiting when input exceeds range.
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="fold">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="wrap">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="clip">
							<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>
				The range within which to keep values
			</digest>
			<description>
				The range within which to keep values. Values outside of this range will be subject to a limiting algorithm chosen by the <at>mode</at> attribute.
			</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, and <m>mode 2</m> is clip. 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, wrap, and clip modes. 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>
