From 4e10cc9e4b931f3ffd830d9df23f37add8be860d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Jul 2026 09:58:21 +0200 Subject: [PATCH] Update test structure for MIDI event handling and project data --- tests/ableton-midi.test.ts | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tests/ableton-midi.test.ts b/tests/ableton-midi.test.ts index f706564..166ff62 100644 --- a/tests/ableton-midi.test.ts +++ b/tests/ableton-midi.test.ts @@ -131,6 +131,11 @@ test('routes each source curve only to its matching pad clip, including MIDI-onl const source1 = midiEvent(48, 1, 60); const source2 = midiEvent(72, 2, 90); const params = faderParams(); + const events = [source0, source1, source2].map((event) => ({ + type: 'midi' as const, + kind: PatternEventKind.Midi, + ...event, + })); const project = { pads: { a: [pad('a', 0), pad('a', 1), pad('a', 2)], @@ -140,7 +145,10 @@ test('routes each source curve only to its matching pad clip, including MIDI-onl }, scenes: [ { + number: 1, name: '01', + patternNumbers: { a: 1, b: 0, c: 0, d: 0 }, + timeSignature: { numerator: 4, denominator: 4 }, patterns: [ { pad: 'a0', group: 'a', notes: [], bars: 1 }, { pad: 'a1', group: 'a', notes: [], bars: 1 }, @@ -152,15 +160,22 @@ test('routes each source curve only to its matching pad clip, including MIDI-onl patternNumber: 1, bars: 1, recordCount: 3, - events: [source0, source1, source2].map((event) => ({ - type: 'midi' as const, - kind: PatternEventKind.Midi, - ...event, - })), + events, }, }, }, ], + groupPatterns: [ + { + group: 'a', + patternNumber: 1, + bars: 1, + recordCount: 3, + events, + notes: { 0: [], 1: [], 2: [] }, + }, + ], + songPositions: [], settings: { bpm: 120, scale: 0, @@ -190,8 +205,8 @@ test('routes each source curve only to its matching pad clip, including MIDI-onl assert.deepEqual( result.tracks.map((track) => [ track.padCode, - track.lane?.clips[0].notes.length, - track.lane?.clips[0].midiEvents.map((event) => event.data[1]), + track.lane?.sessionClips[0].notes.length, + track.lane?.sessionClips[0].midiEvents.map((event) => event.data[1]), ]), [ ['a0', 0, [30]],