diff --git a/tests/ableton-hybrid.test.ts b/tests/ableton-hybrid.test.ts index 5cc0d44..35525c9 100644 --- a/tests/ableton-hybrid.test.ts +++ b/tests/ableton-hybrid.test.ts @@ -278,6 +278,70 @@ test('serializes nested Live 10 Simplers without artificial empty Session clips' } }); +test('binds group device automation to each concrete pad and provisions MOD devices', async () => { + const server = await createServer({ + server: { middlewareMode: true }, + appType: 'custom', + mode: 'production', + define: { 'import.meta.env.DEV': 'false' }, + }); + + try { + const { buildProject } = await server.ssrLoadModule('/src/lib/exporters/ableton/builders.ts'); + const data = project(); + data.pads.a[2].pitch = 7; + data.settings.groupFaderParams.a[FaderParam.PTC] = 0.5; + data.groupPatterns[0].events.push( + { + type: 'fader', + kind: PatternEventKind.Fader, + position: 0, + source: 0, + flags: 0, + rawData: new Uint8Array(8), + parameter: FaderParam.PTC, + reserved: 0, + rawValue: 24575, + value: 0.75, + }, + { + type: 'fader', + kind: PatternEventKind.Fader, + position: 0, + source: 0, + flags: 0, + rawData: new Uint8Array(8), + parameter: FaderParam.MOD, + reserved: 0, + rawValue: 16384, + value: 0.5, + }, + ); + const generated = await buildProject(data, { + abletonVersion: '10', + includeArchivedSamples: true, + exportAllPadsWithSamples: true, + groupTracks: true, + sendEffects: false, + allScenes: true, + }); + const xml = gunzipSync(Buffer.from(generated)).toString('utf8'); + const simplerBlocks = [...xml.matchAll(//g)].map( + (match) => match[0], + ); + + assert.match(xml, /]*Value="2\.5"/); + assert.match(xml, /]*Value="9\.5"/); + assert.ok( + simplerBlocks.every((simpler) => + /[\s\S]*?[\s\S]*?/.test(simpler), + ), + ); + } finally { + await server.close(); + } +}); + test('automatically builds a per-group rack without flattening chromatic pads', () => { const result = abletonTransformer(project(), { includeArchivedSamples: true,