Time Value Syntax

One of the fundamental aspects of working in Max is the notion of creating processes that progress or act over a period of time. Traditionally, time values in Max have always been expressed using milliseconds as the unit. In Max, time values for many objects (see the complete list) may also be expressed in a number of human-friendly units. There are two types of time values: fixed values are similar to milliseconds in that they express an amount of time that doesn't change. Tempo-relative units vary according to the current tempo set in a transport object.

Fixed Time Values

  • Milliseconds are specified with a single number, or with a number followed by ms
  • Hours/minutes/seconds are specified with numbers separated by colons, such as 00:03:25, which means zero hours, 3 minutes, and 25 seconds. An optional millisecond value can be added after a period, for example: 00:03:25.230. Hours/minutes/seconds can also specified by a list of three or four numbers followed by hh:mm:ss.
  • Samples can be specified by a single number followed by samples.
  • Frequency can be specified by a single number followed by hz.

Tempo-Relative Time Values

  • Ticks represent 1/480th of a quarter note. In places where only tempo-relative time values are allowed, such as the quantize attribute of the metro object, values in ticks can be specified as a single number. In places where both fixed and tempo-relative units are permissible, such as the interval attribute of a metro object, a value in ticks must be followed by ticks to be interpreted as ticks instead of milliseconds. See below for a table of ticks and note value equivalents.
  • Note values are symbols that abbreviate musical note time values, for example 4n for quarter-note. They may be specified by themselves (you cannot use a note value in an expression, such as 3 * 16n). See below for a table of ticks and note value equivalents.
  • Bars/beats/units can be specified in two ways. Where it is necessary to use a single value, bars/beats/units can be separated by periods, for example: 2.3.240, which is 2 measures (bars), 3 beats, and 240 ticks. When it is possible to pass a list of values, bars/beats/units can be specified by separate numbers, e.g., 2 3 240. To disambiguate bars/beats/units from hours/minutes/seconds where time values can be either fixed or tempo-relative, you can add the optional symbol bbu after the list.

Time Offsets and Time Intervals

With tempo-relative units, particularly bars/beats/units, you can specify a time interval or a time position. A time offset or position refers to the value of a transport, so for example, the time argument to the timepoint object is considered a position. A time interval, by contrast is a distance or an amount of time. Interval, quantization, and delay attributes of objects are generally time intervals. The bars/beats/units method of specifying time will be interpreted differently depending on context. A time of 1 1 0 as a position is 0 ticks. A time of 1 1 0 as an interval in 4/4 time is (4 * 480) + 480 ticks (2400 ticks).

The translate object has a mode attribute that can convert time units as either intervals or positions.

Table of Ticks and Note Values

Here is a listing of the note and tick values associated with common note durations. Note value abbreviations that can be used in Max to specify time are in bold.

1nd - Dotted whole note - 2880 ticks
1n - Whole note - 1920 ticks
1nt - Whole note triplet - 1280 ticks
2nd - Dotted half note - 1440 ticks
2n - Half note - 960 ticks
2nt - Half note triplet - 640 ticks
4nd - Dotted quarter note - 720 ticks
4n - Quarter note - 480 ticks
4nt - Quarter note triplet - 320 ticks
8nd - Dotted eighth note - 360 ticks
8n - Eighth note - 240 ticks
8nt - Eighth note triplet - 160 ticks
16nd - Dotted sixteenth note - 180 ticks
16n - Sixteenth note - 120 ticks
16nt - Sixteenth note triplet - 80 ticks
32nd - Dotted thirty-second note - 90 ticks
32n - thirty-second note - 60 ticks
32nt - thirty-second-note triplet - 40 ticks
64nd - Dotted sixty-fourth note - 45 ticks
64n - Sixty-fourth note - 30 ticks
128n - One-hundred-twenty-eighth note - 15 ticks