A newer version of Max is available. Click here to access the latest version of the documentation

rate~ Reference

Time-scale the output of a phasor~

rate~

Description

The rate~ object accepts an input signal from a phasor~ and time scales it by a multiplier received as a float in its right inlet. Numbers less than 1 create several ramps per phase cycle. Numbers greater than 1 create fewer ramps. This can be useful for implementing a phasor~-synchronized system in MSP.

Examples

Use rate~ to generate synchronized waveforms or control sources

Arguments

multiplier [float]

Optional

The multiplier value used to scale the output signal.

sync-mode-flag [int]

Optional

Sets the sync mode (see the sync message).

Attributes

sync [int]

Sets the sync mode of the rate~ object. The sync mode determines whether or not the rate~"in" will stay in phase with the input signal, and the method used for synchronization. When the output of the rate~ object is "in phase," the input and output signals align precisely at the least common multiple of their periods (i.e., they pass through zero and begin a new cycle at precisely the same time). If the signals are in phase, and a new multiplier value is received, the rate~ object changes the frequency of its output ramp accordingly. However, the change in multiplier values means that the two signals may be out of phase. The rate~ object handles this situation in one of three different ways, depending on the sync mode

Possible values:

0 = 'cycle' ( Set the cycle mode for sync )
The arguments @sync 0 or @sync cycle set the cycle mode of the rate~ object. In cycle mode, the rate~ object does not change the phase of its output until the end of the current cycle. When the input ramp reaches its peak and starts over from zero, the rate~ object immediately restarts the output ramp, causing a discontinuity in the output signal, and immediate phase synchronization.

1 = 'lock' ( Set the lock mode for sync )
The arguments @sync 1 or @sync lock set the lock mode of the rate~ object. In sync lock mode, the rate~ object performs synchronization whenever a new multiplier is received. The rate~ object immediately calculates the proper ramp position which corresponds to being "in phase" with the new multiplier value, and jumps to that position.

2 = 'off' ( Disable the sync mode )
The arguments @sync 2 or @sync off disables the sync mode of the rate~ object (the default mode). In this mode rate~ never responds to phase differences; when a new multiplier is received, the rate~ object adjusts the speed of its output ramps and they continue without interruption. Since this mode never introduces a discontinuous jump in the ramp signal, it may be useful if phase is unimportant.

Common Box Attributes

Messages

int

Arguments

phase/multiplier [int]
In left inlet: Sets the phase value for the rate~ object's signal output.

In right inlet: The signal multiplier value used to scale the phasor~ signal input. Integer values greater than 1 create fewer ramps. This can be useful for synchronizing multiple processes to a single reference phasor~ object, preserving their ratio relationships.

float

Arguments

phase/multiplier [float]
In left inlet: Sets the phase value for the rate~ object's signal output.

In right inlet: The signal multiplier value used to scale the phasor~ signal input. Float values less than 1.0 create several ramps per phase cycle. Numbers greater than 1.0 create fewer ramps. This can be useful for synchronizing multiple processes to a single reference phasor~ object, preserving their ratio relationships.

goto

Arguments

jump-to-value [float]
time-of-action [float]
In left inlet: The word goto, followed by a float, causes the rate~ object to jump immediately to the specified value. An optional second argument may be used to specify the time at which to jump to the value (e.g., goto 1.0 .5 will output a value of 1.0 at the halfway point of the phasor~ object's input signal ramp).

oneshot

Arguments

loop-flag (0 or nonzero) [int]
The message oneshot 1 will turn on "oneshot"-mode whereby rate~ outputs only one cycle of a ramp. The message oneshot 0 will turn "oneshot"-mode off whereby rate~ can cycle through ramps continuously when instructed to do so (i.e. by the sync cycle message).

reset

In left inlet: The word reset will lock the output to the input on its next reset. It is equivalent to the message goto 0. 0.

signal

In left inlet: An input signal from a phasor~ object.

In right inlet: The rate~ object time scales the input signal from a phasor~ by a multiplier value. The multiplier value can be specified as an argument or received as a float to the rate~ object's right inlet.

Output

signal

The synchronized signal is sent out the outlet.

See Also

Name Description
MC MC
phasor~
sync~
techno~