round~

Round an input signal value

Description

round~ rounds its left signal input to the nearest integer multiple of its right signal input. With the 'nearest' message you can determine whether or not it rounds to the absolute nearest integer multiple, or simply the nearest integer multiple between the value and zero (for positive numbers this will round down). By default this is on.

Arguments

Name Type Opt Description
int or float int or float opt Sets the value to which the input signal will be rounded.

Messages

int rounding-multiple-specifier [int] In right inlet: an int or float will cause the input to be rounded to the nearest multiple of the specified number. If a signal is attached to the inlet, int and float messages are ignored.
float rounding-multiple-specifier [float] In right inlet: an int or float will cause the input to be rounded to the nearest multiple of the specified number. If a signal is attached to the inlet, int and float messages are ignored.
nearest rounding-mode-flag (0 or nonzero) [int] In left inlet: The word nearest, followed by a non-zero value, will cause the round~ object to round its input to the nearest absolute integer multiple of the value received in the right inlet. The default is on. nearest 0 will cause the round~ object to round the input signal to the nearest integer multiple between the value received in the right inlet and zero (for positive numbers this will round down).
signal In left inlet: A signal whose values will be rounded.

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 nearest message for more information).

Information for box attributes common to all objects

Output

signal: The rounded input signal.

Examples

round~ takes floating-point signals and rounds them to a specific increment

See Also

Name Description
rampsmooth~ Smooth an incoming signal
slide~ Filter a signal logarithmically
trunc~ Truncate fractional signal values