summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-10-25 23:49:30 +0700
committerGitHub <[email protected]>2021-10-25 23:49:30 +0700
commit39c7fa15961376fe84fc9c3818b271d4cc8c8d74 (patch)
tree65b34175d20bc4b0a36a870418d5f5744fe14044 /src
parent55e0b5882a7e6a81563f25895c345b27a9f47c50 (diff)
parent9f014b059a2411d23a1a24e9154c89d87739eaaf (diff)
Merge pull request #1162 from todbot/master
Properly handle Program Change and Channel Aftertouch messages
Diffstat (limited to 'src')
-rw-r--r--src/class/midi/midi_device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c
index edec57846..b08b362f9 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