mc.pong~ Reference

Variable range signal folding (multichannel)

mc.pong~

Description

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

Discussion

The optional arguments are <mode> <lo val> <hi val>. mode 0 is fold, mode 1 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 mode 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]

Optional

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 mode message).

low-value [float]

Optional

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., pong~ 0 .1), 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]

Optional

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

Multichannel Group Attributes

Messages

int

Arguments

input [int]
In left inlet: All incoming signal, int, or float values which exceed the high or low value ranges specified by arguments to the pong~ 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 pong~ object (see the mode message).

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

input [float]
In left inlet: All incoming signal, int, or float values which exceed the high or low value ranges specified by arguments to the pong~ 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 pong~ object (see the mode message).

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 left inlet: All incoming signal or float values which exceed the high or low value ranges specified by arguments to the pong~ 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 pong~ object (see the mode message).

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.

Multichannel Group Messages

Output

signal

The folded signal or float value.

See Also

Name Description
phasewrap~