-
Hi, I'm trying to send sysex messages from tinyusb to a connected computer. However, I can't seem to figure out the proper way to do it. I tried using tud_midi_send((uint8_t[4]){0x04, 0xF0, 0x00, 0x01});
tud_midi_send((uint8_t[4]){0x07, 0x02, 0x03, 0xF7}); However, MIDI Monitor shows that this comes across as invalid data: I've tried with tud_midi_write(0, (uint8_t[6]){0xF0, 0x00, 0x01, 0x02, 0x03, 0xF7}, 6); But this is incorrect as well: |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Actually, I'm generally just seeing a lot of weirdness with sending messages from my device. Receiving messages seems fine. But I've noticed that if I send more than one message, sometimes they don't get sent until after I send additional messages, and then those get held until I write more, and so on. For example, I'm sending 3 CC messages in response to a single SysEX message: tud_midi_send((uint8_t[4]){0x03, 0xB0, 0x5A, (result >> 12) & 0xF});
tud_midi_send((uint8_t[4]){0x03, 0xB0, 0x5A, (result >> 8) & 0xF});
tud_midi_send((uint8_t[4]){0x03, 0xB0, 0x5A, (result >> 4) & 0xF}); This log shows the behavior: every
|
Beta Was this translation helpful? Give feedback.
-
@theacodes I have revised and improve midi driver, would you mind trying it out here to see if that fixes your issue https://github.com/hathach/tinyusb/tree/improve-midi Note: MIDI driver is based on cdc, but since it is much less used, it also got less PR/update than cdc. |
Beta Was this translation helpful? Give feedback.
-
Seems that branch helps with the simple messages above:
And with SysEx
Thank you, @hathach! |
Beta Was this translation helpful? Give feedback.
-
@theacodes I am glad that helps you, let's me know if you still have any other issue with MIDI driver. You could keep this issue opened until you got it all sorted out. Then we could merge that midi branch into master. PS: I am noob with MIDI and instrument therefore the driver lack needed testing. |
Beta Was this translation helpful? Give feedback.
-
Sounds good. Happy to keep testing the MIDI driver, and feel free to cc me
on the PR for this. :)
…On Mon, Aug 24, 2020 at 1:34 PM Ha Thach ***@***.***> wrote:
@theacodes <https://github.com/theacodes> I am glad that helps you, let's
me know if you still have any other issue with MIDI driver. You could keep
this issue opened until you got it all sorted out. Then we could merge that
midi branch into master.
PS: I am noob with MIDI and instrument therefore the driver lack needed
testing.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/hathach/tinyusb/issues/495#issuecomment-679265980>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB5I44MCXTBZQJ5WNYXA23SCKQBRANCNFSM4QJBGVFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I think I found the bug! If you send
This is a bug in the USB MIDI encoder in This line is wrong. It is midi->write_buffer_length = 4; should be midi->write_target_length = 4; |
Beta Was this translation helpful? Give feedback.
-
I wrote my finding up as a separate bug (#511) and pull-request (#512) - since I'm not certain it fixes everything originally reported here. |
Beta Was this translation helpful? Give feedback.
I wrote my finding up as a separate bug (#511) and pull-request (#512) - since I'm not certain it fixes everything originally reported here.