Tone.Part
↳ EXTENDS Tone.EventTone.Part is a collection Tone.Events which can be started/stopped and looped as a single unit.
CONSTRUCTOR
new Tone.Part (The callback to invoke on each event
the array of events
DEFAULTS
EXAMPLE
EXAMPLE
Members
.loop
↝ Boolean or Positive #If the part should loop or not between Tone.Part.loopStart and Tone.Part.loopEnd. An integer value corresponds to the number of loops the Part does after it starts.
EXAMPLE
.state
↝ String READONLY #Returns the playback state of the note, either “started” or “stopped”.
.progress
↝ NormalRange READONLY #The current progress of the loop interval. Returns 0 if the event is not started yet or it is not set to loop.
Methods
.stop ( )
#When to stop the part.
this
Stop the part at the given time.
.at ( )
#The time of the event to get or set.
If a value is passed in, the value of the event at the given time will be set to it.
the event at the time
Get/Set an Event’s value at the given time. If a value is passed in and no event exists at the given time, one will be created with that value. If two events are at the same time, the first one will be returned.
EXAMPLE
.cancel ( )
#The time after which to cancel the scheduled events.
this
Cancel scheduled state change events: i.e. “start” and “stop”.
.remove ( )
#The time of the event
Optionally select only a specific event value
this
Remove an event from the part. If the event at that time is a Tone.Part, it will remove the entire part.
.start ( )
#When to start the part.
The offset from the start of the part to begin playing at.
this
Start the part at the given time.