Tone.Ticks

↳ EXTENDS Tone.TransportTime

Tone.Ticks is a primitive type for encoding Time values. Tone.Ticks can be constructed with or without the new keyword. Tone.Ticks can be passed into the parameter of any method which takes time as an argument.

CONSTRUCTOR

new Tone.Ticks (
val
, [
units
] )
val

The time value.

type: String or Number
units

The units of the value.

type: String
optional

EXAMPLE

var t = Tone.Ticks("4n");//a quarter note

Methods

.toSeconds ( )

#
↪ returns Ticks

Return the time in ticks

</>

.toTicks ( )

#
↪ returns Ticks

Return the time in ticks

</>
inherited from Tone.Time

.toNotation ( )

#
↪ returns Notation

Convert a Time to Notation. The notation values are will be the closest representation between 1m to 128th note.

EXAMPLE

//if the Transport is at 120bpm:
Tone.Time(2).toNotation();//returns "1m"
</>
inherited from Tone.Time

.quantize ( )

#
val

The subdivision to quantize to

percent

Move the time value towards the quantized value by a percentage.

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

Tone.Time(21).quantize(2) //returns 22
Tone.Time(0.6).quantize("4n", 0.5) //returns 0.55
</>
inherited from Tone.Time

.toMidi ( )

#
↪ returns Midi

Return the value as a midi note.

</>
inherited from Tone.Time

.toBarsBeatsSixteenths ( )

#

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

.toFrequency ( )

#
↪ returns Frequency

Return the value in hertz

</>
inherited from Tone.TimeBase

.toMilliseconds ( )

#
↪ returns Milliseconds

Return the time in milliseconds.

</>
inherited from Tone.TimeBase

.toSamples ( )

#
↪ returns Samples

Return the time in samples

</>
inherited from Tone.TimeBase

.dispose ( )

#
↪ returns Tone.TimeBase

this

Clean up

</>
docs generated Sep 15 2019