Prototype: Send Midi from Host to Host from USB to BLE

I have a very specific use-case that I just solved. I wanted to share some details about it to hear if other people might find it useful, or maybe have a better approach.

I’m using Gigperformer (obviously) and I have some ChordPro files associated with songs in my setlist. I wanted to show these chords on my phone and have it always show the current song selected in GP.

So I started out using my phone as an external monitor with Duet. This worked but needs a physical connection between the phone and the computer.

Then I found out that Songbook (the app I use on my phone to view ChordPro files) has a Midi Input option. So you can send the phone a specific midi note, and this would correspond to a certain song. Allowing you to control the current song over Midi.

GigPerformer also allows you to send Midi messages the moment a song part is activated. So neat! All the puzzle pieces are there.

But the downside is that both GP and my phone are acting as a Midi Host in this situation. And even if that wasn’t the case, I also would need to use a dongle and a cable to connect my phone to my computer. In which case I’m no closer than the previous setup with the external monitor solution.

So I built my own adapter with 2 microcontrollers. An RP2040 and an ESP32. The RP2040 functions as a USB Midi device over USB, and the ESP32 acts as a BLE Midi Client.

I’ve built a prototype board that connects these two chips over UART. So now I can connect this prototype to my computer, have GP send out midi notes to the device over USB. The Midi messages get sent over Serial to the ESP32 which then relays the Midi over BLE to my phone. It works super quick and stable.

So in essence what I’ve built is a Host to Host, USB to BLE Midi forwarder. It could technically also function as a Midi USB to wireless adapter.

Are there people in the community that have thoughts on this? Or have use for something like this? Looking forward to your thoughts.

1 Like

As for the BLE, check out this great thread: MIDI Bluetooth (BLE) router for Windows

Thanks for sharing! You can attach a couple of photos, as well :slight_smile:

It will eventually look like this:

Because I’m porting my proof-of-concept to this device as soon as I receive it. My prototype is just a perfboard with a Raspberry Pico and a ESP32 dev board and a bunch or wires. So a little clunky and unnecessarily large. I’ve screwed that into my rack so it’s a little tough to take pictures of. But I can share a little demo of my setup when I get the new hardware. It should get here tomorrow.

2 Likes

Hey, i am happy to find someone that has these kind of projects in mind. Actually i wanted to use an esp32-s3 as ble midi forwarder as well , as i already have an external midi controller.

First thing fisrt. I am notn100% sure, but wirh esp32-s3 you wont probably neef the other board, because it has native USB supoort (so no “usb shield” required) you just need some Arduino libraries and BIG knowledge of usb midi protocol. I am stuck on this because even with some nice libraries, i still need tu figure out ow to make it work.

Secondly, are you planning to connect to a mac or a windows laptop?

And finally could you make a diagram about the connection just to get a better picture?

I have made a digital whammy bar over ble that works under a midi pitch bend and is really good, but doing the isb/ ble midi forwarding is much more advanced topic.

Yeah I agree that it should technically be possible to use the native USB. However I couldn’t find good examples for this. I don’t feel great about having to implement the Midi protocol myself.

Most of my USB Midi projects use teensy boards. And recent ones use the RP2040. Both of those I can get working quickly and reliably. So that’s why I slapped something together with those to test my idea.

And then afterwards I found that TTGO board that has both a RP2040 and ESP32 on it already. Which means I could just reuse most of my code and get the same functionality on one PCB. Which seems like the quickest way to a functioning solution.

I’m actually really happy with how stable and fast it’s been performing.
Below you can see a diagram of the setup from a functional perspective.
In practice what happens is;

  1. I push a button on my midi controller to tell GP to switch to the next song
  2. GP sends out a Midi Note On message upon activating a new song part
  3. The Midi goes out the USB cable into the RP2040
  4. RP2040 sends it over UART to the ESP32
  5. The ESP32 sends it over BLE to my iPhone
  6. iPhone receives a Note On Midi message
  7. Songbook picks up this Midi input and a song with a corresponding {midi-index:} tag in my ChordPro data gets shown.

2 Likes