Tone.Sequence↳ EXTENDS Tone.Part
A sequence is an alternate notation of a part. Instead of passing in an array of [time, event] pairs, pass in an array of events which will be spaced at the given subdivision. Sub-arrays will subdivide that beat by the number of items are in the array. Sequence notation inspiration from Tidal
CONSTRUCTORnew Tone.Sequence (
.subdivision↝ Time READONLY #
The subdivision of the sequence. This can only be set in the constructor. The subdivision is the interval between successive steps.
.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”.
.loopStart↝ Time #
The loopStart point determines when it will loop if Tone.Part.loop is true.
.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.
.probability↝ NormalRange #
The probability of the notes being triggered.
.length↝ Positive READONLY #
The number of scheduled notes in the part.
.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.
.loopEnd↝ Time #
The loopEnd point determines when it will loop if Tone.Part.loop is true.
.add ( )#
The index to add the event to
The value to add at that index
Add an event at an index, if there’s already something at that index, overwrite it. If
value is an array, it will be parsed as a subsequence.
.at ( )#
The index to get or set
Optionally pass in the value to set at the given index.
Get/Set an index of the sequence. If the index contains a subarray, a Tone.Sequence representing that sub-array will be returned.
.remove ( )#
Remove a value from the sequence by index
.stop ( )#
Stop the part at the given time.
.removeAll ( )#
Remove all of the notes from the group.
.cancel ( )#
The time after which to cancel the scheduled events.
Cancel scheduled state change events: i.e. “start” and “stop”.