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

translate Reference

Convert between different units of time.

translate

Description

Converts from any of the fixed or relative Max time values to any other fixed or relative time value.

Examples

Arguments

input-format [symbol]

Optional

The first argument sets the input format to expect. These arguments are a shortcut for setting the attributes of this object which do the same thing. Time can be specified in any of the time formats used in Max.

output-format [symbol]

Optional

The second argument sets the format to output. These arguments are a shortcut for setting the attributes of this object which do the same thing. Time can be specified in any of the time formats used in Max.

Attributes

in [symbol]

The input format is used to determine the value sent to this object when the value alone is not enough. For example, a simple number could represent milliseconds, hertz, ticks, seconds, etc. This attribute is used to disambiguate such cases.

Possible values:

'ticks'
'ms'
'bars.beats.units'
'samples'
'hz'
'notevalues'
'hh:mm:ss'

listen [int]

Toggles the output of new values for the current input to the translation when the transport tempo changes. The default is 1 (on).

mode [symbol]

Sets the mode for time values. The translate object can output time values in either position relative to the system start value of 1.1.0 or interval , where a value of 1.1.0 would indicate one bar, one beat, and no units (2400 ticks at 4/4 in the default resolution).
Note: this attribute may not apply, depending on the type of unit conversion.

Possible values:

'interval'
'position'

out [symbol]

Set the time format to use for output.

Possible values:

'ticks'
'ms'
'bars.beats.units'
'samples'
'hz'
'notevalues'
'hh:mm:ss'

transport [symbol]

The name of a transport object with which to associate. By default, the master transport is used.

Common Box Attributes

Messages

bang

The last time passed in is converted into the output type specified. Where appropriate, the input type of the last time passed in will be re-assessed by checking the in attribute.

int

Arguments

time [int]
The time value passed-in is converted into the output type specified. Where appropriate, the input type will be assessed by checking the in attribute.

float

Arguments

time [float]
The time value passed-in is converted into the output type specified. Where appropriate, the input type will be assessed by checking the in attribute.

list

Arguments

time [list]
The time value passed-in is converted into the output type specified. Where appropriate, the input type will be assessed by checking the in attribute.

anything

Arguments

time [list]
The time value passed-in is converted into the output type specified. Where appropriate, the input type will be assessed by checking the in attribute.

See Also

Name Description
Timing and Sequencing Events Timing and Sequencing Events
metro
timepoint
transport
when