Update Ableton exporter logic to correctly handle session clips and pattern sorting
This commit is contained in:
@@ -800,27 +800,7 @@ async function buildTrack(
|
||||
);
|
||||
}
|
||||
|
||||
const sessionClips = [...(koTrack.lane?.sessionClips || [])];
|
||||
groupLane?.sessionPatterns.forEach((pattern) => {
|
||||
const hasClip = sessionClips.some((clip) => clip.sceneIndex === pattern.sceneIndex);
|
||||
if (!hasClip && pattern.sceneIndex !== undefined) {
|
||||
sessionClips.push({
|
||||
notes: [],
|
||||
midiEvents: [],
|
||||
bars: pattern.bars,
|
||||
offset: 0,
|
||||
duration: pattern.duration,
|
||||
loopDuration: pattern.loopDuration,
|
||||
sceneIndex: pattern.sceneIndex,
|
||||
sceneName: pattern.sceneName,
|
||||
timeSignature: pattern.timeSignature,
|
||||
faderParams: pattern.faderParams,
|
||||
groupPattern: pattern,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
for (const koClip of sessionClips) {
|
||||
for (const koClip of koTrack.lane?.sessionClips || []) {
|
||||
if (koClip.sceneIndex === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -382,8 +382,9 @@ function abletonTransformer(data: ProjectRawData, exporterParams: ExporterParams
|
||||
!referencedPatterns.has(getPatternKey(pattern.group, pattern.patternNumber)),
|
||||
)
|
||||
.toSorted((a, b) => {
|
||||
const patternDifference = a.patternNumber - b.patternNumber;
|
||||
const groupDifference = PROJECT_GROUPS.indexOf(a.group) - PROJECT_GROUPS.indexOf(b.group);
|
||||
return groupDifference || a.patternNumber - b.patternNumber;
|
||||
return patternDifference || groupDifference;
|
||||
})
|
||||
.forEach((pattern) => {
|
||||
const sceneIndex = ablScenes.length;
|
||||
|
||||
Reference in New Issue
Block a user