From 89df0e46412ff1190a131d677ddc0edea30e0b72 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Jul 2026 10:16:36 +0200 Subject: [PATCH] Update Ableton export builders to handle project one-shot overrides --- src/lib/exporters/ableton/builders.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/lib/exporters/ableton/builders.ts b/src/lib/exporters/ableton/builders.ts index 5cbd105..1429205 100644 --- a/src/lib/exporters/ableton/builders.ts +++ b/src/lib/exporters/ableton/builders.ts @@ -388,7 +388,7 @@ async function buildMidiClip( async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVersion) { const simplerTemplate = await loadTemplate('simpler', abletonVersion); const device = structuredClone(simplerTemplate.OriginalSimpler); - const oneshot = koTrack.playMode === 'oneshot'; + const projectOneShot = koTrack.playMode === 'oneshot'; const samplePart = device.Player.MultiSampleMap.SampleParts.MultiSamplePart; const loopModulators = device.Player.LoopModulators; const simplerFilter = device.Filter.Slot.Value.SimplerFilter; @@ -426,6 +426,9 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers device.Globals.PlaybackMode['@Value'] = 0; break; } + if (koTrack.oneShotOverride) { + device.Globals.PlaybackMode['@Value'] = 1; + } const sampleRef = device.Player.MultiSampleMap.SampleParts.MultiSamplePart.SampleRef; if (abletonVersion === '10') { setLive10SampleReference(sampleRef.FileRef, koTrack.sampleName); @@ -463,22 +466,22 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers // setting velocity scaling to 20% to match KO behavior device.VolumeAndPan.VolumeVelScale.Manual['@Value'] = 0.2; - const attackTarget = oneshot + const attackTarget = projectOneShot ? device.VolumeAndPan.OneShotEnvelope.FadeInTime : device.VolumeAndPan.Envelope.AttackTime; - const releaseTarget = oneshot + const releaseTarget = projectOneShot ? device.VolumeAndPan.OneShotEnvelope.FadeOutTime : device.VolumeAndPan.Envelope.ReleaseTime; attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds( koTrack.attack, playbackDuration, - oneshot, + projectOneShot, ); releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds( koTrack.release, playbackDuration, - oneshot, - oneshot, + projectOneShot, + projectOneShot, ); device.VolumeAndPan.Panorama.Manual['@Value'] = koTrack.pan; @@ -487,7 +490,7 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds( koTrack.faderParams[FaderParam.ATK] * 255, playbackDuration, - oneshot, + projectOneShot, ); } @@ -496,8 +499,8 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds( koTrack.faderParams[FaderParam.REL] * 255, playbackDuration, - oneshot, - oneshot, + projectOneShot, + projectOneShot, ); }