Replies: 2 comments
-
|
Arguments to the You can only have a single instance of the AFAIK, most USB libraries will always allocate endpoints in both directions for MIDI, so a transmit-only port is not possible. SoftwareSerial is supported, but not recommended. HardwareSerial or PIO-based serial are preferable. |
Beta Was this translation helpful? Give feedback.
-
|
Pieter, Thank you very much for your explanation! That clears a few things but I am still stuck. After some searching I understand that multiple MIDI ports, a.k.a. virtual cables, utilizing additional (usually 4th) prefix byte in USB sentence to specify messages association with specific "Cable". I guess instead of using pipes with filters, it is possible to write very low level code to read, parse and forward raw USB sentences, but Pipes looks so much cleaner, and as I understand, that data has much faster path, so it is preferred to use pipes, with filters. But I still cannot wrap my head over pipes and filters. Apparently neither is CoPilot. Could you please, if possible, to provide an example of 2x2 USB midi adapter code with 2 virtual Cables (MIDI ports on single USB) to be associated separately with each of two available hardware serial ports? Is it possible at all for RPi2040? Really appreciate your help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to make multi-port USB MIDI adapter with RPi2040 (the tiny "zero" version, that I successfully used to create USB_MIDI_host for my FP10). Single MIDI port works great, even SysEx appeared to be working (not too much testing yet though). But multi-port somehow I cannot get under control.
Interface Initialization
initialization of USB MIDI single port device:
USBMIDI_Interface USB_midi;Works as expected.
Initialize two interfaces, reference example that doesn't create two interfaces (not on RPi2040 with tinyUSB stack):
USBMIDI_Interface USB_midi_1; USBMIDI_Interface USB_midi_2;Only one interface is created.
Other way to init it that does create extra interfaces on the same USB:
USBMIDI_Interface USB_midi(2);Interesting to note that I was able to create no more than 3 interfaces. Tyring to make 4 => nothing is created. But 3 is plenty for me.
In bullet 3. I was not able to route specifically to any of 2 or 3 interfaces. only first one transmits and all receiving the same thing. I was tyring to index interface's ID with squate brackets, round brackets and no brackets at all - I was not able to call specific USB MIDI interface other than first one by "USB_midi".
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions