Transport
Interface to the master transport
Access this object via the transport property.
Table of Contents
- Methods
- Properties
- Events
Methods
close
()
Closes the end point and stops listening for events.
This method no longer needs to be explicitly called as end points are now automatically closed when the last event listener is removed.
cycleLoopMode
()
Cycles between the various loop modes
open
()
Opens this end point and starts listening for events.
This method no longer needs to be explicitly called as end points are now automatically opened when the first event listener is attached.
Use this method to keep the end point open even when no event listeners are attached.
pause
()
Pauses the master transport
play
()
Starts transport playback
stop
()
Stops the master transport
togglePlay
()
Toggles play and stopped states
togglePlayPause
()
Toggles between play and pause states
togglePlayPause
()
Toggles pause and play states (unless stopped)
togglePlayStop
()
Toggles between play and stop states
untilOpen
()
Promise
Returns a promise that will be resolved when this end point is opened
Returns:
Example:
let C = new CantabileApi();
C.application.open();
await C.application.untilOpen();
Properties
loopCount
Number
Gets the current loopCount
loopIteration
Number
Gets the current loopIteration
loopMode
String
Gets or sets the current loopMode ("auto", "break", "loopOnce" or "loop")
state
String
Gets or sets the current transport state. Supported values include "playing", "paused" or "stopped"
tempo
Number
Gets the current tempo
timeSignature
String
Gets the current time signture as a string (eg: "3/4")
timeSignatureDen
Number
Gets the current time signture denominator
timeSignatureNum
Number
Gets the current time signture numerator
Events
loopStateChanged
Fired when the current loop mode, loop iteration or loop count has changed
stateChanged
Fired when the current transport state has changed
tempoChanged
Fired when the current tempo has changed
timeSignatureChanged
Fired when the current time signature has changed