Update Ableton export builders to handle project one-shot overrides
This commit is contained in:
@@ -388,7 +388,7 @@ async function buildMidiClip(
|
||||
async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVersion) {
|
||||
const simplerTemplate = await loadTemplate<ALSSimpler>('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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user