The context associated with the time value. Used to compute Transport and context-relative timing.
Optional
value: TimeValueThe time value as a number, string or object
Optional
units: TimeBaseUnitUnit values
Readonly
contextSet this debug flag to log all events that happen in this class.
Readonly
defaultThe default units
Readonly
nameStatic
versionThe version number semver
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
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.
Tone.Time(21).quantize(2); // returns 22
Tone.Time(0.6).quantize("4n", 0.5); // returns 0.55
Return the value as a midi note.
Convert a Time to Notation. The notation values are will be the closest representation between 1m to 128th note.
// if the Transport is at 120bpm:
Tone.Time(2).toNotation(); // returns "1m"
Static
get
Ticks is a primitive type for encoding Time values. Ticks can be constructed with or without the
new
keyword. Ticks can be passed into the parameter of any method which takes time as an argument.Example