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 (DEFAULTS
EXAMPLE
EXAMPLE
Members
.loop
↝ Boolean or Positive #If the part should loop or not between Tone.Part.loopStart and Tone.Part.loopEnd. If set to true, the part will loop indefinitely, if set to a number greater than 1 it will play a specific number of times, if set to false, 0 or 1, the part will only play once.
EXAMPLE
.humanize
↝ Boolean or Time #If set to true, will apply small random variation to the callback time. If the value is given as a time, it will randomize by that amount.
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.