Commit graph

4 commits

Author SHA1 Message Date
Wim Taymans
7f9a00cd94 test-ump-utils: add tests for all remaining conversion paths
Add coverage for channel pressure, system common messages (F1, F2, F3),
system realtime, MIDI 1.0 program change and channel pressure decoding,
sysex continue status, and roundtrip tests for program change, channel
pressure, song position, and system realtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-22 17:16:20 +02:00
Wim Taymans
4fbe2ef421 ump-utils: fix MIDI 2.0 pitch bend and mask program number
Fix spa_ump_to_midi() MIDI 2.0 pitch bend (0xE0) to extract both LSB
and MSB from the 32-bit value in word 2, giving full 14-bit resolution.
Previously the LSB came from a reserved field and was always zero.

Mask the program number with 0x7f for consistency with bank byte
masking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-22 17:13:41 +02:00
Wim Taymans
26635056a4 ump-utils: fix MIDI 2.0 channel pressure and mask bank bytes
Fix spa_ump_to_midi() MIDI 2.0 channel pressure (0xD0) to emit the
status byte before the data byte. The fallthrough from default caused
the status to be missing, producing 1 byte instead of 2.

Mask bank MSB and LSB with 0x7f in MIDI 2.0 program change conversion
to ensure valid MIDI 1.0 data bytes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-22 17:05:42 +02:00
Wim Taymans
552eb1e618 ump-utils: fix sysex encoding and add F7 continuation support
Fix spa_ump_from_midi() to correctly encode short sysex messages as
Complete (0x0) instead of Start (0x1) when the entire message fits in
one UMP packet. Handle bare F7 termination when no data bytes follow.
Support 0xF7 as a sysex continuation marker and optional trailing 0xF0
as a continuation boundary.

Add unit tests for UMP/MIDI conversion covering note on, program change,
sysex complete/multi-packet/continue, system realtime, F7 continuation,
bare F7 end/complete/orphan, and trailing F0 scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-22 17:00:09 +02:00