Tone.MultiPlayer
↳ EXTENDS ToneUse Tone.Players instead.
Tone.MultiPlayer is well suited for one-shots, multi-sampled instruments or any time you need to play a bunch of audio buffers.
CONSTRUCTOR
new Tone.MultiPlayer (The buffers which are available to the MultiPlayer
The callback to invoke when all of the buffers are loaded.
DEFAULTS
EXAMPLE
EXAMPLE
Members
.state
↝ Tone.State READONLY #Returns the playback state of the source. “started” if there are any buffers playing. “stopped” otherwise.
Methods
.add ( )
#The name to that the buffer is refered to in start/stop methods.
The url of the buffer to load or the buffer.
The function to invoke after the buffer is loaded.
Add another buffer to the available buffers.
.start ( )
#The name of the buffer to start.
When to start the buffer.
The offset into the buffer to play from.
How long to play the buffer for.
The interval to repitch the buffer.
The gain to play the sample at.
this
Start a buffer by name. The start
method allows a number of options to be passed in such as offset, interval, and gain. This is good for multi-sampled instruments and sound sprites where samples are repitched played back at different velocities.
.startLoop ( )
#The name of the buffer to start.
When to start the buffer.
The offset into the buffer to play from.
The start of the loop.
The end of the loop.
The interval to repitch the buffer.
The gain to play the sample at.
this
Start a looping buffer by name. Similar to start
, but the buffer is looped instead of played straight through. Can still be stopped with stop
.
.stop ( )
#The buffer to stop.
When to stop the buffer
this
Stop the first played instance of the buffer name.
.stopAll ( )
#When to stop the buffers.
this
Stop all currently playing buffers at the given time.