mc.round~
Description
Use the round~ object to round a signal input to an integer multiple.
Discussion
You can set the object's 'nearest' attribute to determine whether or not it rounds to the absolute nearest integer multiple, or the nearest integer multiple between the value and zero (for positive numbers this will round down). By default this is on.
Arguments
int or float [number]
Sets the value to which the input signal will be rounded. The default value is 0. (no modification).
Attributes
nearest [int]
When set to 1 (the default), the round~ object will round to the nearest multiple of the specified signal value.
Note: This attribute does not set the rounding step (which is set using round~ object's right inlet), It specifies that rounding to the nearest signal value will occur. Here are some examples:
With the rounding interval set to 3 and the attribute set to 1:
an input signal value of 5.8 will return 6
an input signal value of 3.7 will return 3
an input signal value of -1 will return 0
an input signal value of -2.7 will return -3
With the rounding interval set to 3 and the attribute set to 0:
an input signal value of 5.8 will return 3
an input signal value of 3.7 will return 3
an input signal value of -1 will return 0
an input signal value of -2.7 will return 0
Common Box Attributes
Multichannel Group Attributes
Messages
int
Arguments
float
Arguments
signal
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 message for more information).
Multichannel Group Messages
Output
signal
The rounded input signal.
See Also
Name | Description |
---|---|
rampsmooth~ | |
slide~ | |
trunc~ | |
round |