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) {
|
async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVersion) {
|
||||||
const simplerTemplate = await loadTemplate<ALSSimpler>('simpler', abletonVersion);
|
const simplerTemplate = await loadTemplate<ALSSimpler>('simpler', abletonVersion);
|
||||||
const device = structuredClone(simplerTemplate.OriginalSimpler);
|
const device = structuredClone(simplerTemplate.OriginalSimpler);
|
||||||
const oneshot = koTrack.playMode === 'oneshot';
|
const projectOneShot = koTrack.playMode === 'oneshot';
|
||||||
const samplePart = device.Player.MultiSampleMap.SampleParts.MultiSamplePart;
|
const samplePart = device.Player.MultiSampleMap.SampleParts.MultiSamplePart;
|
||||||
const loopModulators = device.Player.LoopModulators;
|
const loopModulators = device.Player.LoopModulators;
|
||||||
const simplerFilter = device.Filter.Slot.Value.SimplerFilter;
|
const simplerFilter = device.Filter.Slot.Value.SimplerFilter;
|
||||||
@@ -426,6 +426,9 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers
|
|||||||
device.Globals.PlaybackMode['@Value'] = 0;
|
device.Globals.PlaybackMode['@Value'] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (koTrack.oneShotOverride) {
|
||||||
|
device.Globals.PlaybackMode['@Value'] = 1;
|
||||||
|
}
|
||||||
const sampleRef = device.Player.MultiSampleMap.SampleParts.MultiSamplePart.SampleRef;
|
const sampleRef = device.Player.MultiSampleMap.SampleParts.MultiSamplePart.SampleRef;
|
||||||
if (abletonVersion === '10') {
|
if (abletonVersion === '10') {
|
||||||
setLive10SampleReference(sampleRef.FileRef, koTrack.sampleName);
|
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
|
// setting velocity scaling to 20% to match KO behavior
|
||||||
device.VolumeAndPan.VolumeVelScale.Manual['@Value'] = 0.2;
|
device.VolumeAndPan.VolumeVelScale.Manual['@Value'] = 0.2;
|
||||||
|
|
||||||
const attackTarget = oneshot
|
const attackTarget = projectOneShot
|
||||||
? device.VolumeAndPan.OneShotEnvelope.FadeInTime
|
? device.VolumeAndPan.OneShotEnvelope.FadeInTime
|
||||||
: device.VolumeAndPan.Envelope.AttackTime;
|
: device.VolumeAndPan.Envelope.AttackTime;
|
||||||
const releaseTarget = oneshot
|
const releaseTarget = projectOneShot
|
||||||
? device.VolumeAndPan.OneShotEnvelope.FadeOutTime
|
? device.VolumeAndPan.OneShotEnvelope.FadeOutTime
|
||||||
: device.VolumeAndPan.Envelope.ReleaseTime;
|
: device.VolumeAndPan.Envelope.ReleaseTime;
|
||||||
attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
||||||
koTrack.attack,
|
koTrack.attack,
|
||||||
playbackDuration,
|
playbackDuration,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
);
|
);
|
||||||
releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
||||||
koTrack.release,
|
koTrack.release,
|
||||||
playbackDuration,
|
playbackDuration,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
);
|
);
|
||||||
device.VolumeAndPan.Panorama.Manual['@Value'] = koTrack.pan;
|
device.VolumeAndPan.Panorama.Manual['@Value'] = koTrack.pan;
|
||||||
|
|
||||||
@@ -487,7 +490,7 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers
|
|||||||
attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
attackTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
||||||
koTrack.faderParams[FaderParam.ATK] * 255,
|
koTrack.faderParams[FaderParam.ATK] * 255,
|
||||||
playbackDuration,
|
playbackDuration,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -496,8 +499,8 @@ async function buildSimplerDevice(koTrack: AblTrack, abletonVersion: AbletonVers
|
|||||||
releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
releaseTarget.Manual['@Value'] = simplerEnvelopeMilliseconds(
|
||||||
koTrack.faderParams[FaderParam.REL] * 255,
|
koTrack.faderParams[FaderParam.REL] * 255,
|
||||||
playbackDuration,
|
playbackDuration,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
oneshot,
|
projectOneShot,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user