diff --git a/src/lib/exporters/ableton/automation.ts b/src/lib/exporters/ableton/automation.ts index 6ba00e7..180b7f8 100644 --- a/src/lib/exporters/ableton/automation.ts +++ b/src/lib/exporters/ableton/automation.ts @@ -1,13 +1,9 @@ import { FaderParam } from '../../../types/types'; import { AblGroupPatternOccurrence, AblTrack } from '../../transformers/ableton'; -import { koEnvRangeToSeconds } from './utils'; export type AbletonAutomationTarget = { arrangement?: number; session?: number; - maxValue?: number; - soundLength?: number; - invertValue?: boolean; staticValue?: number; valueOffset?: number; }; @@ -65,20 +61,6 @@ export function convertFaderValue( case FaderParam.FX: convertedValue = value; break; - case FaderParam.ATK: - convertedValue = - koEnvRangeToSeconds( - (target?.invertValue ? 1 - value : value) * 255, - target?.soundLength ?? track.soundLength, - ) * 1000; - break; - case FaderParam.REL: - convertedValue = - koEnvRangeToSeconds( - (target?.invertValue ? 1 - value : value) * 255, - target?.soundLength ?? track.soundLength, - ) * 1000; - break; case FaderParam.PAN: convertedValue = (value - 0.5) * 2; break; @@ -93,9 +75,7 @@ export function convertFaderValue( break; } - return target?.maxValue === undefined - ? convertedValue - : Math.min(target.maxValue, convertedValue); + return convertedValue; } export function getFaderValueAt( diff --git a/src/lib/exporters/ableton/playback.ts b/src/lib/exporters/ableton/playback.ts index 75e07ad..7911fb6 100644 --- a/src/lib/exporters/ableton/playback.ts +++ b/src/lib/exporters/ableton/playback.ts @@ -6,6 +6,5 @@ export function getSimplerPlaybackState(projectMode: AbletonPlaybackMode) { voices: projectMode === 'key' ? 5 : 0, retrigger: projectMode === 'oneshot', portamentoMode: projectMode === 'legato' ? 2 : 0, - useOneShotEnvelope: projectMode === 'oneshot', }; } diff --git a/tests/ableton-automation.test.ts b/tests/ableton-automation.test.ts index f2e9bb0..9663ec5 100644 --- a/tests/ableton-automation.test.ts +++ b/tests/ableton-automation.test.ts @@ -86,64 +86,3 @@ test('uses absolute automation targets for Session clip envelopes', () => { assert.equal(envelopes[0].Automation.Events.FloatEvent[2]['@Time'], 1); assert.deepEqual(envelopes[0].LoopSlot, { Value: {} }); }); - -test('uses each Simpler target duration and One-Shot release direction', () => { - assert.equal( - convertFaderValue(FaderParam.REL, 1, track, false, { - soundLength: 10, - maxValue: 2000, - invertValue: true, - }), - 0, - ); - assert.equal( - convertFaderValue(FaderParam.REL, 0, track, false, { - soundLength: 10, - maxValue: 2000, - invertValue: true, - }), - 2000, - ); - - const envelopes = buildClipEnvelopes( - occurrence, - { - [FaderParam.REL]: [ - { session: 23000, soundLength: 2 }, - { session: 23001, soundLength: 4, maxValue: 2000, invertValue: true }, - ], - }, - track, - false, - ); - - assert.equal(envelopes[0].Automation.Events.FloatEvent[2]['@Value'], 1500); - assert.equal(envelopes[1].Automation.Events.FloatEvent[2]['@Value'], 1000); -}); - -test('preserves the pad envelope before group automation when the static group value is absent', () => { - const pattern = { - ...occurrence, - faderParams: { ...faderParams, [FaderParam.REL]: -1 }, - }; - const envelopes = buildClipEnvelopes( - pattern, - { - [FaderParam.REL]: [ - { - session: 23000, - soundLength: 4, - maxValue: 2000, - invertValue: true, - staticValue: 321, - }, - ], - }, - track, - false, - ); - - assert.equal(envelopes[0].Automation.Events.FloatEvent[0]['@Value'], 321); - assert.equal(envelopes[0].Automation.Events.FloatEvent[1]['@Value'], 321); - assert.equal(envelopes[0].Automation.Events.FloatEvent[2]['@Value'], 1000); -}); diff --git a/tests/ableton-playback.test.ts b/tests/ableton-playback.test.ts index 6277069..151aaf4 100644 --- a/tests/ableton-playback.test.ts +++ b/tests/ableton-playback.test.ts @@ -8,23 +8,20 @@ test('exports every EP playback mode as automatic One-Shot Trigger playback', () voices: 5, retrigger: false, portamentoMode: 0, - useOneShotEnvelope: false, }); assert.deepEqual(getSimplerPlaybackState('legato'), { playbackMode: 1, voices: 0, retrigger: false, portamentoMode: 2, - useOneShotEnvelope: false, }); }); -test('preserves native EP ONE envelope translation', () => { +test('preserves native EP ONE trigger behavior', () => { assert.deepEqual(getSimplerPlaybackState('oneshot'), { playbackMode: 1, voices: 0, retrigger: true, portamentoMode: 0, - useOneShotEnvelope: true, }); });