Update Ableton MIDI exporter and add comprehensive test suite

This commit is contained in:
2026-07-14 06:47:32 +02:00
parent 5233cae10b
commit 4bba670084
3 changed files with 207 additions and 8 deletions

View File

@@ -45,17 +45,21 @@ export function buildMidiClipEnvelopes(
let previousValue = 0;
let eventCount = 0;
events.forEach((event) => {
events.toSorted((a, b) => a.position - b.position).forEach((event) => {
const value = decodeChannelPressure(event);
if (value === undefined) {
return;
}
eventCount++;
if (value === previousValue) {
return;
}
const time = event.position / 96;
points.push({ time, value: previousValue });
points.push({ time, value });
previousValue = value;
eventCount++;
});
if (eventCount === 0) {