micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

Bug #1066: Add helper function to send SysEx/MTC via usb-device-midi

Open mungewell opened this issue 1 month ago • 2 comments

I was using USB-device-midi to send MTC to the host, which is essentially SysEx. But was slowed by the missing helper function to send the packet of SysEx. Anyhow, I wrote one...

Full example script here: https://github.com/orgs/micropython/discussions/18450#discussioncomment-15043069

mungewell avatar Nov 25 '25 03:11 mungewell

Thanks for the contribution.

But I'm a bit confused, I thought system exclusive messages were a completely different format, namely:

  • they start with 0xF0
  • they have an number of data bytes with the most-sig-bit clear
  • they end with 0xF7

How does that differ to the sys ex added here?

dpgeorge avatar Dec 03 '25 23:12 dpgeorge

You are correct, SysEx generally starts with 0xF0 and ends with 0xF7.

The helper function takes an array of bytes (say "0xf07f7f010160000000f7") and fragments it to pass over USB-midi protocol, then the USB host reassembles it to pass to client application.

The example script (for Pico) generates both the long and short messages that MTC uses.

mungewell avatar Dec 04 '25 15:12 mungewell