[PATCH 2/4] ALSA: seq: ump: Convert a zero-velocity Note On to Note Off for MIDI 2.0
From: HyeongJun An
Date: Sun Nov 15 2026 - 22:04:07 EST
When a UMP MIDI 1.0 client sends to a MIDI 2.0 client,
cvt_ump_midi1_to_midi2() passes a Note On with zero velocity as a MIDI
2.0 Note On with zero velocity. The MIDI 1.0 sender meant a Note Off,
but the MIDI 2.0 receiver gets a Note On.
The other MIDI 1.0 to MIDI 2.0 conversions send a Note Off here:
note_ev_to_ump_midi2() for legacy sequencer events, and
cvt_legacy_cmd_to_ump() in the UMP core. Do the same.
Fixes: e9e02819a98a ("ALSA: seq: Automatic conversion of UMP events")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: HyeongJun An <sammiee5311@xxxxxxxxx>
---
sound/core/seq/seq_ump_convert.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
index c248d87f7a83..b35e3a50ec52 100644
--- a/sound/core/seq/seq_ump_convert.c
+++ b/sound/core/seq/seq_ump_convert.c
@@ -380,6 +380,10 @@ static int cvt_ump_midi1_to_midi2(struct snd_seq_client *dest,
switch (midi1->note.status) {
case UMP_MSG_STATUS_NOTE_ON:
case UMP_MSG_STATUS_NOTE_OFF:
+ /* MIDI 2.0 doesn't treat a note-on with 0 velocity as note-off */
+ if (midi1->note.status == UMP_MSG_STATUS_NOTE_ON &&
+ !midi1->note.velocity)
+ midi2->note.status = UMP_MSG_STATUS_NOTE_OFF;
midi2->note.note = midi1->note.note;
midi2->note.velocity = upscale_7_to_16bit(midi1->note.velocity);
break;
--
2.43.0