Update Ableton exporter logic and fix test assertions
This commit is contained in:
@@ -228,7 +228,8 @@ function trackAutomationTargets(midiTrack: any, includeArrangementMixer: boolean
|
||||
const staticPitchValue = koTrack.faderParams[FaderParam.PTC];
|
||||
const staticPitchOffset =
|
||||
staticPitchValue === -1 ? 0 : Math.round((staticPitchValue - 0.5) * 10);
|
||||
pitchTarget.valueOffset = Number(simpler.Pitch.TransposeKey.Manual['@Value']) - staticPitchOffset;
|
||||
pitchTarget.valueOffset =
|
||||
Number(simpler.Pitch.TransposeKey.Manual['@Value']) - staticPitchOffset;
|
||||
addTarget(targets, FaderParam.PTC, pitchTarget);
|
||||
addTarget(targets, FaderParam.TUNE, targetFor(simpler.Pitch.TransposeFine));
|
||||
addTarget(
|
||||
@@ -385,9 +386,7 @@ async function buildMidiClip(
|
||||
midiClip.Notes.NoteIdGenerator.NextId['@Value'] = _noteId;
|
||||
|
||||
const clipEnvelopes =
|
||||
abletonVersion === '10'
|
||||
? buildMidiClipEnvelopes(koClip.midiEvents, midiControllerTargets)
|
||||
: [];
|
||||
abletonVersion === '10' ? buildMidiClipEnvelopes(koClip.midiEvents, midiControllerTargets) : [];
|
||||
if (clipForLauncher && koTrack) {
|
||||
clipEnvelopes.push(
|
||||
...buildClipEnvelopes(koClip.groupPattern, automationTargets, koTrack, false),
|
||||
@@ -641,8 +640,7 @@ async function buildDrumRackDevice(koTrack: AblTrack, abletonVersion: AbletonVer
|
||||
drumBranch.Name.EffectiveName['@Value'] = subtrack.name;
|
||||
drumBranch.Name.UserName['@Value'] = subtrack.name;
|
||||
drumBranch.BranchInfo.ReceivingNote['@Value'] = note;
|
||||
drumBranch.BranchInfo.SendingNote['@Value'] =
|
||||
subtrack.drumRackSendingNote ?? subtrack.rootNote; // not sure if this matters
|
||||
drumBranch.BranchInfo.SendingNote['@Value'] = subtrack.drumRackSendingNote ?? subtrack.rootNote; // not sure if this matters
|
||||
drumBranch.BranchInfo.ChokeGroup['@Value'] = subtrack.inChokeGroup ? 1 : 0;
|
||||
drumBranch.MixerDevice.Volume.Manual['@Value'] = subtrack.volume;
|
||||
drumBranch.DeviceChain.MidiToAudioDeviceChain.Devices = await buildSimplerDevice(
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import abletonTransformer, {
|
||||
AblTrack,
|
||||
getDrumRackMidiNote,
|
||||
} from '../src/lib/transformers/ableton';
|
||||
import abletonTransformer, { AblTrack, getDrumRackMidiNote } from '../src/lib/transformers/ableton';
|
||||
import {
|
||||
EffectType,
|
||||
FaderParam,
|
||||
@@ -170,10 +167,7 @@ test('automatically builds a per-group rack without flattening chromatic pads',
|
||||
);
|
||||
assert.deepEqual(
|
||||
melodic.lane?.clips.map((clip) => clip.notes.map((item) => item.note)),
|
||||
[
|
||||
[60, 64],
|
||||
[67],
|
||||
],
|
||||
[[60, 64], [67]],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -220,7 +214,10 @@ test('does not create selector-note racks when samples are excluded', () => {
|
||||
exportAllPadsWithSamples: true,
|
||||
});
|
||||
|
||||
assert.equal(result.tracks.some((track) => track.drumRack), false);
|
||||
assert.equal(
|
||||
result.tracks.some((track) => track.drumRack),
|
||||
false,
|
||||
);
|
||||
assert.deepEqual(
|
||||
result.tracks.map((track) => track.padCode),
|
||||
['a0', 'a1', 'a2'] as PadCode[],
|
||||
|
||||
Reference in New Issue
Block a user