Skip to content

Commit 39c7fa1

Browse files
authored
Merge pull request #1162 from todbot/master
Properly handle Program Change and Channel Aftertouch messages
2 parents 55e0b58 + 9f014b0 commit 39c7fa1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/class/midi/midi_device.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ uint32_t tud_midi_n_stream_write(uint8_t itf, uint8_t cable_num, uint8_t const*
279279
stream->buffer[0] = (cable_num << 4) | msg;
280280
stream->total = 4;
281281
}
282+
else if ( msg == 0xC || msg == 0xD)
283+
{
284+
// Channel Voice Messages, two-byte variants (Program Change and Channel Pressure)
285+
stream->buffer[0] = (cable_num << 4) | msg;
286+
stream->total = 3;
287+
}
282288
else if ( msg == 0xf )
283289
{
284290
// System message

0 commit comments

Comments
 (0)