diff options
| author | jepler <[email protected]> | 2019-08-14 19:15:29 -0500 |
|---|---|---|
| committer | jepler <[email protected]> | 2019-08-14 19:15:29 -0500 |
| commit | 96d96a94b887bc1b648a175c28b377dba76a9068 (patch) | |
| tree | 574f2468377c07d8c008b2be6c74456ac54b2301 /src | |
| parent | 1ee9ef4f2b7c6acfab6c398a4f57ca22036958f7 (diff) | |
midi_device: Send message classes C and D as 2 bytes
.. sending these as two 1-byte messages with CIN of 0xF is
misinterpreted by OSes including Windows 10 and (reportedly)
Mac.
Testing performed: Ran the reproducer script, which sends Program
Change (0xCx) messages. I did not check with Change Pressure (0xDx)
messages, but expect the same thing.
Closes: #98
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/midi/midi_device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c index 267167720..5a9ce8277 100644 --- a/src/class/midi/midi_device.c +++ b/src/class/midi/midi_device.c @@ -161,6 +161,9 @@ uint32_t tud_midi_n_write(uint8_t itf, uint8_t jack_id, uint8_t const* buffer, u } else if ((msg >= 0x8 && msg <= 0xB) || msg == 0xE) {
midi->message_buffer[0] = jack_id << 4 | msg;
midi->message_target_length = 4;
+ } else if (msg == 0xC || msg == 0xD) {
+ midi->message_buffer[0] = jack_id << 4 | msg;
+ midi->message_target_length = 3;
} else if (msg == 0xf) {
if (data == 0xf0) {
midi->message_buffer[0] = 0x4;
|
