[PATCH 3/4] ALSA: seq: ump: Keep a soft MIDI 2.0 Note On from becoming a Note Off
From: HyeongJun An
Date: Sun Nov 15 2026 - 22:04:13 EST
The cvt_ump_midi2_to_midi1() scales the 16-bit MIDI 2.0 velocity down to
7 bits. A Note On with a velocity below 0x200 becomes a MIDI 1.0 Note On
with zero velocity, which a MIDI 1.0 receiver takes as a Note Off.
Send velocity 1 then, as ump_midi2_to_note_ev() does for legacy
clients and cvt_ump_midi2_to_legacy() does in the UMP core.
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 b35e3a50ec52..b42a7ffbf31e 100644
--- a/sound/core/seq/seq_ump_convert.c
+++ b/sound/core/seq/seq_ump_convert.c
@@ -457,6 +457,10 @@ static int cvt_ump_midi2_to_midi1(struct snd_seq_client *dest,
case UMP_MSG_STATUS_NOTE_OFF:
midi1->note.note = midi2->note.note;
midi1->note.velocity = downscale_16_to_7bit(midi2->note.velocity);
+ /* a note-on with 0 velocity would be a note-off in MIDI 1.0 */
+ if (midi2->note.status == UMP_MSG_STATUS_NOTE_ON &&
+ !midi1->note.velocity)
+ midi1->note.velocity = 1;
break;
case UMP_MSG_STATUS_POLY_PRESSURE:
midi1->paf.note = midi2->paf.note;
--
2.43.0