Update Ableton transformer to support fader automation data

This commit is contained in:
2026-07-13 04:53:36 +02:00
parent cf84d2d76b
commit 3513766ca4

View File

@@ -2,6 +2,7 @@ import * as Sentry from '@sentry/react';
import omit from 'lodash/omit';
import {
ExporterParams,
FaderAutomationEvent,
FaderParam,
Note,
Pad,
@@ -49,6 +50,11 @@ export type AblClip = {
sceneName: string;
timeSignature: TimeSignature;
faderParams: { [K in FaderParam]: number };
faderAutomation: AblFaderAutomationPoint[];
};
export type AblFaderAutomationPoint = Pick<FaderAutomationEvent, 'position' | 'value' | 'flags'> & {
parameter: FaderParam;
};
export type AblScene = {
@@ -64,7 +70,11 @@ function abletonTransformer(data: ProjectRawData, exporterParams: ExporterParams
let offset = 0;
scenes.forEach((scene, sceneIndex) => {
const sceneBars = Math.max(...scene.patterns.map((p) => p.bars));
const sceneBars = Math.max(
1,
...scene.patterns.map((p) => p.bars),
...Object.values(scene.patternEvents).map((pattern) => pattern?.bars || 0),
);
const ablScene: AblScene = {
name: customSceneNames[scene.name] || scene.name,
};
@@ -102,6 +112,15 @@ function abletonTransformer(data: ProjectRawData, exporterParams: ExporterParams
}
const faderParams = data.settings.groupFaderParams[pad.group];
const faderAutomation = (scene.patternEvents[pad.group]?.events || [])
.filter((event): event is FaderAutomationEvent => event.type === 'fader')
.filter((event) => event.parameter >= FaderParam.LVL && event.parameter <= FaderParam.MOD)
.map((event) => ({
position: event.position,
parameter: event.parameter as FaderParam,
value: event.value,
flags: event.flags,
}));
if (!track) {
const soundId = findSoundIdByPad(pattern.pad, pads) || 0;
@@ -146,6 +165,7 @@ function abletonTransformer(data: ProjectRawData, exporterParams: ExporterParams
sceneName: customSceneNames[scene.name] || scene.name,
timeSignature: data.scenesSettings.timeSignature,
faderParams,
faderAutomation,
});
track.lane = lane;