USB MIDITECH 4X4 midi interface hack (STM32DUINO)

Few weeks ago, I bought a second USB MIDI 4X4 (4 IN / 4 OUT) from Miditech/Midiplus manufacturer because I thought it was possible to stack the 2 on the same PC to get 8x2 ports IN/Out.
But as theses devices have exactly the same product and vendor ID, it was impossible without having USB conflicts.

The only alternative was to buy the next generation 8x8 interface from the same manufacturer, for three times the price of the MIDI 4x4...that I did not.

Nothing to loose, I opened the box, and inside I discovered that the microcontroller was a STMF103RC.
Here start the idea of a possible hack with STM32DUINO !

STM32DUINO is a port of the Arduino platform to the STM32 chip family from ST Micro. So you can develop sketches as usual, with the Arduino IDE, and reuse your existing "Arduino" code.

I had this interface available with a programmable and powerful chip (32 bits, 72MHZ), native USB, plus all the circuitry for 4 MIDI IN / 4OUT. So I decided to rewrite a new midi firmware from scratch, by reusing the job I did on the AVR platform.

I was successful in activating the internal bootloader by maintaining the Boot0 pin to HIGH and the Boot1 pin to LOW. I had to desolder 2 resistors on the board because they were disabling that . I also connected TX and RX of the serial 1 to an USB Serial TTL, and 2 hours later, I was flashing a generic STMDuino bootloader2.0 in the beast, and started to code the firmware...

I extended the firmware features to enable a "4 merge" mode, thru mode, split mode, etc,
So I can say my modified USB interface 4X4 is now better than the original, and, the most important stackable with my existing one as I changed, obviously, the Product ID ! And the STM32F103 is really really lag at all, even at 300 BPM with 4IN/OUT working.

At this time, I use the box with the new firmware in my MIDI setup :slight_smile: !
The code is easily adaptable to any other multi-jack USB interface.

Very nice project! Your project makes it easy to create MIDI router firmware running on commercial MIDI hardware. I was thinking to create a MIDI router box using a SAMD21/Arduino Zero but your project looks much easier.

Do you know what'in the midi PRODIPE 4I4O ? This unit has a lot of bad review. users are complaining about lags, stability, sysex support, etc....So , i suppose you can get one for a small amount of money. Hacking this one could be a big save for many people...

No, I do not but it sounds similar to the midiplus 4x4 but with bad firmware. I do not see it on USA Amazon or Ebay. It is on UK Amazon but the midiplus 4x4 is cheaper for me.

So my project is currently done. I tested the new firmware with my setup all the week end..As everything seems to be OK, i have flashed my second Miditech unit with my own firmware. As I'm able to rename the USB device with SYSEX (see the doc on the GitHub), they are now MIDI4X4-1 and MIDI4X4-2 in the device manager ! So it is more easy to locate gears in MIDI applications.

Just added an automatic "midi thru" standalone mode, allowing to use the unit without a USB connection....