From 2ce0d6ffa04d22388e99579f900242a0c74e5551 Mon Sep 17 00:00:00 2001 From: Ale Camus Date: Mon, 27 Nov 2023 16:49:05 +0100 Subject: [PATCH] Support for chords when using Sequence, use nested arrays to use chords --- Tone/event/Sequence.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tone/event/Sequence.ts b/Tone/event/Sequence.ts index 011244a93..a07334143 100644 --- a/Tone/event/Sequence.ts +++ b/Tone/event/Sequence.ts @@ -191,7 +191,12 @@ export class Sequence extends ToneEvent { 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);