Update pattern naming logic and corresponding test cases for Ableton Live export
This commit is contained in:
@@ -395,12 +395,11 @@ function abletonTransformer(data: ProjectRawData, exporterParams: ExporterParams
|
|||||||
|
|
||||||
patternRows.forEach((patterns, patternNumber) => {
|
patternRows.forEach((patterns, patternNumber) => {
|
||||||
const sceneIndex = ablScenes.length;
|
const sceneIndex = ablScenes.length;
|
||||||
const affectedGroups = patterns.map((pattern) => pattern.group);
|
const affectedGroups = PROJECT_GROUPS.filter((group) =>
|
||||||
|
patterns.some((pattern) => pattern.group === group),
|
||||||
|
);
|
||||||
const patternLabel = String(patternNumber).padStart(2, '0');
|
const patternLabel = String(patternNumber).padStart(2, '0');
|
||||||
const sceneName =
|
const sceneName = `PATTERN ${patternLabel} (${affectedGroups.map((group) => group.toUpperCase()).join('/')})`;
|
||||||
patterns.length === 1
|
|
||||||
? `${patterns[0].group.toUpperCase()} PATTERN ${patternLabel}`
|
|
||||||
: `PATTERN ${patternLabel} (${affectedGroups.map((group) => group.toUpperCase()).join('/')})`;
|
|
||||||
const timeSignature = data.scenesSettings.timeSignature;
|
const timeSignature = data.scenesSettings.timeSignature;
|
||||||
ablScenes.push({
|
ablScenes.push({
|
||||||
name: sceneName,
|
name: sceneName,
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function project(): ProjectRawData {
|
|||||||
pattern('a', 1, 2, 0, 60),
|
pattern('a', 1, 2, 0, 60),
|
||||||
pattern('b', 2, 1, 0, 36),
|
pattern('b', 2, 1, 0, 36),
|
||||||
pattern('a', 3, 1, 1, 64),
|
pattern('a', 3, 1, 1, 64),
|
||||||
pattern('c', 3, 1, 0, 67),
|
pattern('c', 3, 2, 0, 67),
|
||||||
pattern('b', 1, 1, 0, 38),
|
pattern('b', 1, 1, 0, 38),
|
||||||
faderPattern('d', 2),
|
faderPattern('d', 2),
|
||||||
],
|
],
|
||||||
@@ -183,7 +183,7 @@ test('combines genuine Session scenes, orphan patterns and the repeated Song Arr
|
|||||||
[
|
[
|
||||||
['01', 'scene', ['a', 'b', 'c', 'd']],
|
['01', 'scene', ['a', 'b', 'c', 'd']],
|
||||||
['02', 'scene', ['a', 'b', 'c', 'd']],
|
['02', 'scene', ['a', 'b', 'c', 'd']],
|
||||||
['B PATTERN 01', 'pattern', ['b']],
|
['PATTERN 01 (B)', 'pattern', ['b']],
|
||||||
['PATTERN 03 (A/C)', 'pattern', ['a', 'c']],
|
['PATTERN 03 (A/C)', 'pattern', ['a', 'c']],
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -223,6 +223,7 @@ test('combines genuine Session scenes, orphan patterns and the repeated Song Arr
|
|||||||
[3],
|
[3],
|
||||||
);
|
);
|
||||||
assert.deepEqual(a1?.lane?.arrangementClips, []);
|
assert.deepEqual(a1?.lane?.arrangementClips, []);
|
||||||
|
assert.equal(a1?.lane?.sessionClips[0].loopDuration, 4);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
b0?.lane?.sessionClips.map((clip) => clip.sceneIndex),
|
b0?.lane?.sessionClips.map((clip) => clip.sceneIndex),
|
||||||
[0, 2],
|
[0, 2],
|
||||||
@@ -236,6 +237,7 @@ test('combines genuine Session scenes, orphan patterns and the repeated Song Arr
|
|||||||
[3],
|
[3],
|
||||||
);
|
);
|
||||||
assert.deepEqual(c0?.lane?.arrangementClips, []);
|
assert.deepEqual(c0?.lane?.arrangementClips, []);
|
||||||
|
assert.equal(c0?.lane?.sessionClips[0].loopDuration, 8);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('keeps Session material and leaves Arrangement empty when no Song is present', () => {
|
test('keeps Session material and leaves Arrangement empty when no Song is present', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user