Tone.Time
↳ EXTENDS Tone.TimeBaseTone.Time is a primitive type for encoding Time values. Tone.Time can be constructed with or without the new
keyword. Tone.Time can be passed into the parameter of any method which takes time as an argument.
CONSTRUCTOR
new Tone.Time (val
, [ units
]
)
val
The time value.
type:
String
or
Number
or
Object
units
The units of the value.
type:
String
optional
EXAMPLE
Methods
.toNotation ( )
#
↪ returns
Notation
Convert a Time to Notation. The notation values are will be the closest representation between 1m to 128th note.
EXAMPLE
.quantize ( )
#
percent
Move the time value towards the quantized value by a percentage.
type:
NormalRange
default:
1
↪ returns
Number
this
Quantize the time by the given subdivision. Optionally add a percentage which will move the time value towards the ideal quantized value by that percentage.
EXAMPLE
.toBarsBeatsSixteenths ( )
#
↪ returns
BarsBeatsSixteenths
Return the time encoded as Bars:Beats:Sixteenths.
↳ inherited from
Tone.TimeBase
.valueOf ( )
#
↪ returns
Seconds
Evaluate the time value. Returns the time in seconds.
↳ inherited from
Tone.TimeBase
.toMilliseconds ( )
#
↪ returns
Milliseconds
Return the time in milliseconds.