MIDI Routing and interfacing

Any details?
Hardware? Feasible for those of us who like to burn some tin?
I am currently about to build a RP2040 based midi merger/patchbay as an USB device to connect computer (DAW) , Zynthian, Keyboard and an Emu Protheus together. Perhaps I should put this on hold and wait for whatever goodies you have in the pocket for us?

1 Like

I made a three-way splitter/merger from three RP2040s. Programmed in Python, unfortunately the utility often dies. It would probably require a printed circuit board with a well done ground to eliminate random signals.

I like E-MU Protheus 2000 too Show me your setup! - #12 by ToFF

I have built a 9 x 5 pin MIDI input, 9 output router and USB MIDI interface using STM32F103 (3x3 MIDI i/o per MCU) based on USBMidiKliK4x4. (My branch with VSCode / PlatformIO project is here.) It works nicely and I am working on a cross platform configuration tool using Python.

1 Like

I moved these posts to a separate thread as they seemed to be talking about different projects. There are many solutions to this. Some off-the-shelf and others are projects you build yourself.

Oh, this went offtopic pretty quickly!

Originally It was a reply to @jofemodo announcing that the new V5 acts as a MIDI DEVICE via USB and I am interested in details how you accomplished this and whether it is feasible for a moderately talented tinkerer.

If I can connect my (custom build) Zynthian to a computer/DAW as a device, I can plug in my keyboard to the Zynthian and perhaps another synth to the midi thru and can call it a day. No need anymore for an external midi interface/router.

I would prefer such a “barbones” solution but I could never figure out how to use a RaspberryPi as a midi device over USB so I am genuinely interested in how this can be done.

1 Like

@riban solution combines standard DIN and USB midi. I also like that it is configurable via the web and using sysex. too bad the boards are no longer available on https://www.tindie.com/stores/thekikgenlabs/ , I would try to build one.

More simply and only over USB is this:

It uses an optocoupler in the signal path as in the case of a classic DIN connector.
The easiest connection between PC and Zynthian, that is if I don’t use rpt-midi.

I was lazy and just hardwired the RX and TX pins between two small RPi2040 boards. That’s why I might have a stability problem.

Since I really spent a lot of time figuring out how to connect various devices with a midi signal, look at how far one can go. Zynthian from scratch made by ToFFmashines - #43 by ToFF

1 Like

@ToFF, your setup is quite impressive and thanks for the suggestions, but - again - this is not what I was asking for.

I am pretty aware of different midi mergers/interfaces/routers, open source or not (in fact, I’ve come up with my own) but all I know of rely on a separate mcu with it’s own proper firmware. I also remember @jofemodo or @riban to mention that they dislike the idea to have to maintain another firmware - and so do I. As a result I am quite curious how they managed to implement it in the upcoming V5.

If you don’t want to reveal details about the USB midi device implementation right now, that’s totally fine with me, just let me know, so I can stop begging you.

1 Like

Hi @mbvs!

Zynthian handles MIDI interfaces thus:

  • Hardware 5-pin MIDI is implemented on the hardware serial port and a module called ttymidi that converts the serial port to MIDI (mostly)
  • USB MIDI (Zynthian as the host) is implemented using standard Linux device driver handling class compliant USB MIDI devices and also drivers to handle some custom devices like the midisport 2x2
  • USB MIDI (Zynthian as a peripheral) is implemented using a Linux driver that allows the USB type C port on Raspberry Pi (that normally delivers power) to act as a USB peripheral. We currently only enable USB MIDI but in theory other devices could be supported. By default this appears as a port called fmidi but we change that with a module parameter

Zynthian will treat all of these ports similarly so you can route input to output, optionally adding MIDI processing.

1 Like

Many thanks @riban, that was the piece of information I was missing. So, obviously only Raspberry Pi 4 (which I still can’t lay my hands on for a reasonable price) and - if I see this right - it works more or less the same as with the Raspberry Zero in OTG mode. Looking forward to dig into V5 when it is published.

1 Like


1 Like

tell me if I’m wrong: aren’t USB host mode and USB device mode exclusive ?

At least, on RBPi CM4 carrier board, this is my experience (but USB OTG is used for the special use case of writing system to CM4 Emmc).

If they can work simultaneously, That would be great !

------ EDIT -------

So, yes, it’s doable but with the RBPi 4B only.

RPi4 acts as host on its 4 USB type A ports and can act as peripheral on its USB-C port.

1 Like

yeah because of the dedicated USB chip on the RBPi 4B for the type A ports.

There is no such a chip on CM4 nor on its IO board. Maybe, that’s why they are exclusive.