diff options
| author | Ha Thach <[email protected]> | 2021-10-25 23:49:30 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-25 23:49:30 +0700 |
| commit | 39c7fa15961376fe84fc9c3818b271d4cc8c8d74 (patch) | |
| tree | 65b34175d20bc4b0a36a870418d5f5744fe14044 | |
| parent | 55e0b5882a7e6a81563f25895c345b27a9f47c50 (diff) | |
| parent | 9f014b059a2411d23a1a24e9154c89d87739eaaf (diff) | |
Merge pull request #1162 from todbot/master
Properly handle Program Change and Channel Aftertouch messages
| -rw-r--r-- | src/class/midi/midi_device.c | 6 |
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 |
