mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-26 02:25:06 +00:00
Support for chords when using Sequence, use nested arrays to use chords
This commit is contained in:
parent
08df7ad68c
commit
2ce0d6ffa0
1 changed files with 6 additions and 1 deletions
|
@ -191,7 +191,12 @@ export class Sequence<ValueType = any> extends ToneEvent<ValueType> {
|
|||
sequence.forEach((value, index) => {
|
||||
const eventOffset = index * (subdivision) + startOffset;
|
||||
if (isArray(value)) {
|
||||
this._rescheduleSequence(value, subdivision / value.length, eventOffset);
|
||||
if (value.length === 1 && isArray(value[0])){
|
||||
const startTime = new TicksClass(this.context, eventOffset, "i").toSeconds();
|
||||
this._part.add(startTime, value.flat());
|
||||
} else {
|
||||
this._rescheduleSequence(value, subdivision / value.length, eventOffset);
|
||||
}
|
||||
} else {
|
||||
const startTime = new TicksClass(this.context, eventOffset, "i").toSeconds();
|
||||
this._part.add(startTime, value);
|
||||
|
|
Loading…
Reference in a new issue