فهرست منبع

Merge pull request #1162 from todbot/master

Properly handle Program Change and Channel Aftertouch messages
Ha Thach 4 سال پیش
والد
کامیت
39c7fa1596
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/class/midi/midi_device.c

+ 6 - 0
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