Tone.Part↳ EXTENDS Tone.Event
Tone.Part is a collection Tone.Events which can be started/stopped and looped as a single unit.
CONSTRUCTORnew Tone.Part (
The callback to invoke on each event
the array of events
.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.
.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.
.state↝ String READONLY #
Returns the playback state of the note, either “started” or “stopped”.
.add ( )#
The time the note should start. If an object is passed in, it should have a ‘time’ attribute and the rest of the object will be used as the ‘value’.
Add a an event to the part.
.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.
.cancel ( )#
The time after which to cancel the scheduled events.
Cancel scheduled state change events: i.e. “start” and “stop”.
.remove ( )#
The time of the event
Optionally select only a specific event value
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.
Start the part at the given time.