new Transport()
oscillator-based transport allows for simple musical timing
supports tempo curves and time changes
Members
-
<private> _jsNode :ScriptProcessorNode
-
watches the main oscillator for timing ticks
Type:
- ScriptProcessorNode
-
loop :boolean
-
Type:
- boolean
Methods
-
_processBuffer(event)
-
called when a buffer is ready
Parameters:
Name Type Description event
AudioProcessingEvent -
clearInterval(rmInterval) → {boolean}
-
clear an interval from the processing array
Parameters:
Name Type Description rmInterval
number the interval to remove Returns:
true if the event was removed- Type
- boolean
-
clearTimeline(timelineID) → {boolean}
-
clear the timeline event from the
Parameters:
Name Type Description timelineID
number 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 Returns:
true if the timeout was removed- Type
- boolean
-
getBpm() → {number}
-
return the current BPM
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
Returns:
- Type
- number
-
getTransportTime() → {string}
-
get the transport time
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 -
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>
-
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 Returns:
the id of the interval- Type
- number
-
setLoopEnd(endPosition)
-
set the loop start position
Parameters:
Name Type Description endPosition
Tone.Time -
setLoopPoint(startPosition, endPosition)
-
shorthand loop setting
Parameters:
Name Type Description startPosition
Tone.Time endPosition
Tone.Time -
setLoopStart(startPosition)
-
set the loop start position
Parameters:
Name Type Description startPosition
Tone.Time -
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 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 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 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 -
start(time)
-
start the transport and all sources synced to the transport
Parameters:
Name Type Description time
Tone.Time -
stop(time)
-
stop the transport and all sources synced to the transport
Parameters:
Name Type Description time
Tone.Time -
toTicks(time) → {number}
-
turns the time into
Parameters:
Name Type Description time
Tone.Time Returns:
- Type
- number
-
unsync(source)
-
remove the source from the list of Synced Sources
Parameters:
Name Type Description source
Tone.Source [description]