Music projects

2x2 USB MIDI interface with MIDIbox Hardware Platform STM32F1

Last updated: 2025-05-28

Quick links

Intro

MIOS Studio

The MIDIbox Operating System (MIOS) has been developed by Thorsten Klose (starting 1998!) for the requirements of flexible MIDI applications like MIDI controllers, processors, synthesizers, sequencers. Look here: http://www.ucapps.de/mios.html.

After the PIC area (8 bit) Thorsten switched to 32 bit (STM32 in 2008) for his MIDIBox Hardware Platform (MBHP). Since 2011, MIOS32 supports LPC17xx microcontrollers and since 2013 STM32F4.

I own an older STM32F1 MBHP board that was replaced in my sequencer with a newer STM32F4. The board has 2 MIDI In and 2 MIDI Our channels and USB, so I use it as a 2x2 USB MIDI interface (with integrated MIDI monitor). Thorstens PC Software Studio 2 helps to debug and hack MIDI SYSEX commands :).

MIOS Studio

We need this software to program the board. I'm running Kubuntu 25.04 and so I downloaded the MIOSStudio249 for 64bit Linux (compiled under Ubuntu) on http://www.ucapps.de/mios_studio.html. Extract the file MIOS_Studio from MIOS_Studio_2_4_9.tar.gz. When I tried to run MIOS_Studio it I got: error while loading shared libraries: libwebkit2gtk-4.0.so.37. Ubuntu uses now libwebkit2gtk-4.1. But the workaround was fairly simple. You create a new temporary sources list with the old repo, and install the lib. After this you delete the sources list:

    sudo nano /etc/apt/sources.list.d/mios_studio_tmp.list

Copy the following line to the file:

deb http://gb.archive.ubuntu.com/ubuntu jammy main

Save and close (Ctrl+o, Ctrl+x).

Then install the library abd delete the file:

    sudo apt update
    sudo apt install libwebkit2gtk-4.0-dev
    sudo rm /etc/apt/sources.list.d/mios_studio_tmp.list

Now Studio is running :)

Tip: Sometimes Studio crashed when changing MIDI In/Out ports. To avoid this first chose <<None>> and than the other MIDI port.

Programming the hardware

MBHP STM32F1
click for a better view

We set J17 to power the board over USB. To program the hardware with the 2x2 USB MIDI interface software we need to set jumper J27 to set the board to bootloader mode. No other jumpers are set. It is important to remove the MIDI cables while doing this.

Now we download usb_midi_2x2_v1_010.zip from the MIOS32 download page http://www.ucapps.de/mios_download.html and unzip the file.

Then we open MIOS Studio. First we choose the MIDI bootloader (MIDI In/Out) and hope to see the device information :). Then we click on Browse and chose the file project.hex in the MBHP_CORE_STM32 folder (in the usb_midi_2x2_v1_010 folder). Start to program the chip.

After this remove the jumper J27 and re-power the board and restart Studio. Now we should see:

MIOS Studio

Sniffing MIDI

With Header J11 (10 pol) we have the possibility to connect MIDI IN1 (Pin 5) with MIDI OUT2 (Pin 4) and MIDI IN2 (Pin 6) with MIDI OUT1 (Pin3).

3D printed Box

box connected
click for a better view

FC caseFC lid

I designed a box in FreeCAD using my simple box macro: https://www.weigu.lu/other_projects/freecad/freecad_3dbox_macro/index.html. The box lid clicks to the box, so it is easy to open and close it. I added a switch to connect Midi 1 with Midi2.

boxbox lid
box switchbox txt

click for a better view

Download

Interesting links