Class: Transport

Transport

new Transport()

oscillator-based transport allows for simple musical timing supports tempo curves and time changes
Source:

Members

<private> _jsNode :ScriptProcessorNode

watches the main oscillator for timing ticks
Type:
  • ScriptProcessorNode
Source:

loop :boolean

Type:
  • boolean
Source:

Methods

_processBuffer(event)

called when a buffer is ready
Parameters:
Name Type Description
event AudioProcessingEvent
Source:

clearInterval(rmInterval) → {boolean}

clear an interval from the processing array
Parameters:
Name Type Description
rmInterval number the interval to remove
Source:
Returns:
true if the event was removed
Type
boolean

clearTimeline(timelineID) → {boolean}

clear the timeline event from the
Parameters:
Name Type Description
timelineID number
Source:
Returns:
true if it was removed
Type
boolean

clearTimeout(timeoutID) → {boolean}

clear the timeout based on it's ID
Parameters:
Name Type Description
timeoutID number
Source:
Returns:
true if the timeout was removed
Type
boolean

getBpm() → {number}

return the current BPM
Source:
Returns:
Type
number

getTimeSignature() → {number}

return the time signature as just the numerator over 4 is assumed. for example 4/4 would return 4 and 6/8 would return 3
Source:
Returns:
Type
number

getTransportTime() → {string}

get the transport time
Source:
Returns:
in transportTime format (measures:beats:sixteenths)
Type
string

pause(time)

pause the transport and all sources synced to the transport
Parameters:
Name Type Description
time Tone.Time
Source:

setBpm(bpm, rampTime)

set the BPM optionally ramp to the bpm over some time
Parameters:
Name Type Argument Description
bpm number
rampTime Tone.Time <optional>
Source:

setInterval(callback, interval, ctx) → {number}

intervals are recurring events
Parameters:
Name Type Description
callback function
interval Tone.Time
ctx Object the context the function is invoked in
Source:
Returns:
the id of the interval
Type
number

setLoopEnd(endPosition)

set the loop start position
Parameters:
Name Type Description
endPosition Tone.Time
Source:

setLoopPoint(startPosition, endPosition)

shorthand loop setting
Parameters:
Name Type Description
startPosition Tone.Time
endPosition Tone.Time
Source:

setLoopStart(startPosition)

set the loop start position
Parameters:
Name Type Description
startPosition Tone.Time
Source:

setTimeline(callback, timeout, ctx) → {number}

Timeline events are synced to the timeline of the Transport Unlike Timeout, Timeline events will restart after the Transport has been stopped and restarted.
Parameters:
Name Type Description
callback function
timeout Tome.Time
ctx Object the context in which the funtion is called
Source:
Returns:
the id for clearing the timeline event
Type
number

setTimeout(callback, time, ctx) → {number}

set a timeout to occur after time from now
Parameters:
Name Type Description
callback function
time Tone.Time
ctx Object the context to invoke the callback in
Source:
Returns:
the id of the timeout for clearing timeouts
Type
number

setTimeSignature(numerator, denominator)

set the time signature
Parameters:
Name Type Argument Description
numerator number
denominator number <optional>
defaults to 4
Source:
Example
 this.setTimeSignature(4); //for 4/4
 
 

setTransportTime(progress)

set the transport time, jump to the position right away
Parameters:
Name Type Description
progress Tone.Time
Source:

start(time)

start the transport and all sources synced to the transport
Parameters:
Name Type Description
time Tone.Time
Source:

stop(time)

stop the transport and all sources synced to the transport
Parameters:
Name Type Description
time Tone.Time
Source:

toTicks(time) → {number}

turns the time into
Parameters:
Name Type Description
time Tone.Time
Source:
Returns:
Type
number

unsync(source)

remove the source from the list of Synced Sources
Parameters:
Name Type Description
source Tone.Source [description]
Source: