Arduino AppleMIDI and McLaren rtpmidi

  • by
SparkFun ESP2866 “Thing Dev” board

One of our customers brought to our attention an implementation of RTP MIDI for Arduino. With this sketch, you can use an Arduino to send and receive MIDI over Ethernet and WiFi. It is compatible with McLaren Labs’ rtpmidi, so you can use it to send MIDI from an Arduino to your Raspberry Pi.

Here at the labs, we tested it with the SparkFun Thing Dev ESP2866. This board includes a built-in WiFi interface. We started it up running the example program ‘ESP32_NoteOnOffEverySec.ino’ and in the console we could see that it successfully got an IP address and was waiting to receive connections.

Arduino Serial Monitor showing the IP Address it got

On a Raspberry Pi4, we opened up rtpmidi and copied the IP address and port into the [Call] input, followed by the <Return> key. McLaren Labs’ rtpmidi connects to the Arduino after a few seconds and begins receiving Note ON and Note Off messages. Cool!

McLaren rtpmidi connecting to Arduino ESP8266

No Journal

The Arduino implementation does not currently include an implementation of the RTP-MIDI Journal. The Journal is an error-correction mechanism that helps recover MIDI information when packets go missing. Depending on your network load and your application, you may or may not observe missing messages. For some applications, this is not a problem, for others it is a big problem.

In general, Ethernet will have fewer missed packets than WiFi.

Ethernet Buffers

There is an important note about how to enlarge the Ethernet buffers in your sketch. We did not need to use these instructions for the demo application that we ran, but it could be important for other applications. We’re pointing it out here for reference.

SparkFun ESP8266 Thing Dev Starter Kit

We chose the “Thing Dev” Starter kit to run our experiment. The “Thing Dev” is easy to program because it includes an FTDI USB-to-Serial converter. That means you only need to run a USB cable from your computer to the “Thing Dev”, and there is no soldering required to get started.

There is also a similarly named “Thing Starter Kit” that does not include the USB-to-Serial converter. The Kit numbers are very similar:

  • 15259 – Thing Dev Starter Kit
  • 15258 – Thing Starter Kit

Be sure to order the correct one for your application.

Conclusion

The Arduino AppleMIDI Library opens up all sorts of new possibilities for creating new interfaces that can send MIDI. Imagine using Arduinos to make new controllers, or light displays — all run wirelessly over a MIDI network. The Thing Dev is easy to set up and program. Get one and start experimenting!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.