Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8037

MicroPython • Re: Sending MIDI and other data over USB

$
0
0
It is not possible to include raw text or any non-MIDI binary data within a MIDI stream unless it's embedded within SysEx messages; the MIDI specification excludes doing that.

You can subvert Control Change messages to carry out of band data but that's messy, risky, and not recommended.

I am not familiar with MIDI over USB but there are two possibilities; a virtual serial link which simply passes MIDI bytes as if they had come over the traditional 5-pin cable, or a higher level protocol which wraps that serial stream and other streams - That may already support what you want but I don't know.

If it's a virtual serial link - and I would guess it likely will be when using MicroPython, the solution would seem to be to create a USB composite device with two serial streams or serial stream and some other raw data stream. The MIDI stream would be the same as it ever was but there would be an additional stream through which to pass other data.

Having two or more serial streams is entirely possible on a Pico-range device, will usually present as /dev/ttyACM0, /dev/ttyACM1 etc on a Pi host. That used to be fairly easy with MicroPython but recent refactoring has made that much harder and I don't know how you would do that. I am still trying to figure out how to make MicroPython do what could be done before that refactoring.

Statistics: Posted by hippy — Sat Feb 15, 2025 11:12 am



Viewing all articles
Browse latest Browse all 8037

Trending Articles