Add test case for group device automation and pad provisioning
This commit is contained in:
@@ -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(/<OriginalSimpler\b[\s\S]*?<\/OriginalSimpler>/g)].map(
|
||||||
|
(match) => match[0],
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.match(xml, /<FloatEvent\b[^>]*Value="2\.5"/);
|
||||||
|
assert.match(xml, /<FloatEvent\b[^>]*Value="9\.5"/);
|
||||||
|
assert.ok(
|
||||||
|
simplerBlocks.every((simpler) =>
|
||||||
|
/<Lfo>[\s\S]*?<IsOn>[\s\S]*?<Manual Value="true"\s*\/>/.test(simpler),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
await server.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('automatically builds a per-group rack without flattening chromatic pads', () => {
|
test('automatically builds a per-group rack without flattening chromatic pads', () => {
|
||||||
const result = abletonTransformer(project(), {
|
const result = abletonTransformer(project(), {
|
||||||
includeArchivedSamples: true,
|
includeArchivedSamples: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user