From 9f014b059a2411d23a1a24e9154c89d87739eaaf Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Mon, 25 Oct 2021 00:07:59 -0700 Subject: [PATCH] properly handle Program Change and Channel Aftertouch messages --- src/class/midi/midi_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c index edec57846e..b08b362f9f 100644 --- a/src/class/midi/midi_device.c +++ b/src/class/midi/midi_device.c @@ -279,6 +279,12 @@ uint32_t tud_midi_n_stream_write(uint8_t itf, uint8_t cable_num, uint8_t const* stream->buffer[0] = (cable_num << 4) | msg; stream->total = 4; } + else if ( msg == 0xC || msg == 0xD) + { + // Channel Voice Messages, two-byte variants (Program Change and Channel Pressure) + stream->buffer[0] = (cable_num << 4) | msg; + stream->total = 3; + } else if ( msg == 0xf ) { // System message