Add comprehensive test coverage for Ableton effects and automation parameters
This commit is contained in:
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
import {
|
||||
buildArrangementEnvelopes,
|
||||
buildClipEnvelopes,
|
||||
convertFaderValue,
|
||||
getFaderValueAt,
|
||||
} from '../src/lib/exporters/ableton/automation';
|
||||
import { AblGroupPatternOccurrence, AblTrack } from '../src/lib/transformers/ableton';
|
||||
@@ -79,3 +80,37 @@ 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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user