boochow / pico_test_projects

Some projects to test Raspberry Pi Pico unique functionalities, such as interpolators or scanvideo library.
MIT License
87 stars 7 forks source link

Pico Pi as USB MIDI Host #1

Open deepbluemind74 opened 3 years ago

deepbluemind74 commented 3 years ago

Hello boochow, thank you so much for your test projects for the Pico Pi. I am completly new to Raspberry Pico Pi and have very little knowledge about coding. But I wanted to try something with the Pico Pi.

My idea is to connect a powered USB Hub to the Pico Pi and when I plug in two or more USB MIDI devices the Pico will automaticly forward any MIDI messages that is sent from one device to all the other connected USB MIDI devices, just not to itself 😉

Is that possible and if yes how can I do that? Sincerely Marco

boochow commented 3 years ago

Hi Marco, Your idea requires the MIDI protocol implementation for TinyUSB host mode. However, that is not yet implemented. As far as I know, TinyUSB in host mode currently provides only HID class, mass storage class, and USB hub. So, you probably need to write the code to expand TinyUSB by yourself, which requires plenty of work.

deepbluemind74 commented 3 years ago

Hi boochow, thank you for your answer. Unfortunatly I don't know how to code. But what if I would use multiple pico pi's? To connect multiple Pico Pi's together and send MIDI directly over the GPIO's to each other. So let's say I have 2 USB MIDI Footcontrollers and 1 USB MIDI recieving device - for this I need 3 Pico Pi's - I guess.

How do I wire those Pico Pi's together on the GPIO's? And is this idea even possible to do in real?

boochow commented 3 years ago

So you want to make a kind of MIDI merger? I believe some coding is needed to realize your idea anyway. At least for merging MIDI messages from two sources into single MIDI message stream. That is not that a simple task. You have to filter out real time messages such as clock messages from one source, while pass-through messages from another source. Probably some consideration is also needed for sysex messages, double bytes messages, active sensing messages, etc.

deepbluemind74 commented 3 years ago

Yes - MIDI merger describes it best! There is something for the raspberry pi: https://neuma.studio/rpi-midi-complete.html And I wanted to do the exact same thing for the Pico Pi - because the bootup and loading time should be much faster!

boochow commented 3 years ago

Yuichi Akagawa's USBH_MIDI library supports USB-MIDI for USB host mode. https://github.com/YuuichiAkagawa/USBH_MIDI I think this library is a good start point to implement your idea. (This library is not for Pico though.)

Mickinator commented 2 years ago

Hello deepbluemind74 nd boochow, is this project still alive? I try to build a merger with 2 UART Midi In, 1 UART Midi out and USB Midi IN & Out. I´ve been loocking for such examples, but I didn´t find it. This should be the first step to build a keyboard controller that manipulates the Midi-Values from the keyboard (Channel, Note, Velocity) and adds other Midi-controller-commands comming from an arduino nano foot controller. But that´s for the future. I´m a beginner with raspi pico and I´ll try to learn programming using micropython.

Please excuse my bad english knowledge, I do my very best. I hope you can help and it would be nice if you send an answer.

Yours Micki

deepbluemind74 commented 2 years ago

I still have no progress in that case, but here it might get interesting: https://github.com/sekigon-gonnoc/Pico-PIO-USB

Sincerely Marco

boochow commented 2 years ago

rppicomidi is implementing MIDI on USB host mode. This project interfaces DIN5 MIDI IN/OUT and USB MIDI so that you can connect a MIDI device that only has a USB port to other MIDI devices.

https://github.com/rppicomidi/midi2usbhost

Mickinator commented 2 years ago

Wow, thanx for the uick answers. I see, there is a lot of work to do. I will try that. Thanks again.