pong~
Description
Use the pong~ object to either fold or wrap its input within the range of a low value and a high value.
Examples

Discussion
The optional arguments are <mode> <lo val> <hi val>.
is fold, is wrap. The default mode is fold. The default range is zero to one. If <hi val> is greater than <lo val>, their behavior is swapped. All inlets accept both signals and floats. The 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.Arguments
folding-mode [int]
An optional argument is used to set the mode of the pong~ A 0 sets signal folding (the default), and a 1 sets signal wrapping (see the message).
low-value [float]
When used with the optional mode argument, the low range value for the pong~ object can be specified by a float argument. If only one argument is given following the mode argument (e.g., ), it specifies the low range value of the pong~ object above which folding occurs, and the high range value is set to 1.0 (the default).
high-value [float]
When used with the optional mode argument, the high range value for the pong~ object can be specified by a float argument.
Attributes
mode [symbol]
Behaviour of limiting when input exceeds range. Options are clip, wrap, and fold.
Possible values:
'fold'
'wrap'
'clip'
range [2 floats]
The range within which to keep values. Values outside of this range will be subject to a limiting algorithm chosen by the mode attribute.
Common Box Attributes
Messages
int
Arguments
In center or right inlet: The pong~ objects accepts low and high range values for the range outside of which folding occurs. If the pong~ object has either one or no arguments, pong~ 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.
If the pong~ 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.
If the current low range value is greater than the high range value, their behavior is swapped.
float
Arguments
In center or right inlet: The pong~ objects accepts low and high range values for the range outside of which folding occurs. If the pong~ object has either one or no arguments, pong~ 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.
If the pong~ 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.
If the current low range value is greater than the high range value, their behavior is swapped.
signal
In center or right inlet: The pong~ objects accepts low and high range values for the range outside of which folding occurs. If the pong~ object has either one or no arguments, pong~ 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.
If the pong~ 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.
If the current low range value is greater than the high range value, their behavior is swapped.
Output
signal
The folded signal or float value.
See Also
Name | Description |
---|---|
phasewrap~ |