Tone.TransportTime

↳ EXTENDS Tone.Time

Tone.TransportTime is a the time along the Transport’s timeline. It is similar to Tone.Time, but instead of evaluating against the AudioContext’s clock, it is evaluated against the Transport’s position. See TransportTime wiki.

CONSTRUCTOR

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

The time value as a number or string

type: Time
units

Unit values

type: String
optional

Methods

.toFrequency ( )

#
↪ returns Frequency

Return the time as a frequency value

</>

.toSeconds ( )

#
↪ returns Seconds

Return the time in seconds.

</>

.toTicks ( )

#
↪ returns Ticks

Return the time in ticks.

</>

.valueOf ( )

#
↪ returns Ticks

Evaluate the time expression. Returns values in ticks

</>
inherited from Tone.Time

.copy ( )

#
time
type: Tone.Time
↪ returns Time

Copies the value of time to this Time

</>
inherited from Tone.Time

.addNow ( )

#
↪ returns Tone.Time

this

Adds the clock time to the time expression at the moment of evaluation.

</>
inherited from Tone.Time

.toBarsBeatsSixteenths ( )

#

Return the time encoded as Bars:Beats:Sixteenths.

</>
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 Tone.Time

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

.toMilliseconds ( )

#
↪ returns Milliseconds

Return the time in milliseconds.

</>
inherited from Tone.Time

.toNotation ( )

#
↪ returns Notation

Convert a Time to Notation. Values will be thresholded to the nearest 128th note.

EXAMPLE

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

.toSamples ( )

#
↪ returns Samples

Return the time in samples

</>
inherited from Tone.TimeBase

.sub ( )

#
val

The value to subtract

type: Time
units

Optional units to use with the value.

type: String
optional
↪ returns Tone.TimeBase

this

Subtract the value from the current time.

EXAMPLE

Tone.TimeBase("2m").sub("1m"); //"1m"
</>
inherited from Tone.TimeBase

.clone ( )

#
↪ returns Tone.TimeBase

The new cloned Tone.TimeBase

Return a clone of the TimeBase object.

</>
inherited from Tone.TimeBase

.dispose ( )

#
↪ returns Tone.TimeBase

this

Clean up

</>
inherited from Tone.TimeBase

.div ( )

#
val

The value to divide by

type: Time
units

Optional units to use with the value.

type: String
optional
↪ returns Tone.TimeBase

this

Divide the current value by the given time.

EXAMPLE

Tone.TimeBase("2m").div(2); //"1m"
</>
inherited from Tone.TimeBase

.mult ( )

#
val

The value to multiply

type: Time
units

Optional units to use with the value.

type: String
optional
↪ returns Tone.TimeBase

this

Multiply the current value by the given time.

EXAMPLE

Tone.TimeBase("2m").mult("2"); //"4m"
</>
inherited from Tone.TimeBase

.set ( )

#
exprString
type: String
↪ returns Tone.TimeBase

this

Repalce the current time value with the value given by the expression string.

</>
inherited from Tone.TimeBase

.add ( )

#
val

The value to add

type: Time
units

Optional units to use with the value.

type: String
optional
↪ returns Tone.TimeBase

this

Add to the current value.

EXAMPLE

Tone.TimeBase("2m").add("1m"); //"3m"
</>
docs generated Sep 15 2019