Skip to content
Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Branch: master
Clone or download
Latest commit bb9fbdd Mar 24, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples run() -> read() Jan 13, 2019
.travis.yml license moved to Creative Commons Share-Alike 4.0 May 31, 2016 Update Mar 24, 2019
keywords.txt align with FortySevenEffects/arduino_midi_library Oct 29, 2018

AppleMIDI (rtpMIDI) for Arduino

Build Status License: CC BY-SA 4.0 GitHub version Codacy Badge

Enables an Arduino with IP/UDP capabilities (Ethernet shield, ESP8266, ESP32, ...) to particpate in an AppleMIDI session.


  • Tested with AppleMIDI on Mac OS (High Sierra) and using rtpMIDI from Tobias Erichsen on Windows 10
  • Send and receive all MIDI messages
  • Uses callbacks to receive MIDI commands (no need for polling)
  • Automatic instantiation of AppleMIDI object (see at the end of 'AppleMidi.h')


From the Arduino IDE Library Manager, search for AppleMIDI

Basic Usage

#include "AppleMidi.h"


void setup()
  // ...setup ethernet connection
  AppleMIDI.begin("test"); // 'test' will show up as the session name

void loop()
  // ...
  // Send MIDI note 40 on, velocity 55 on channel 1
  AppleMIDI.sendNoteOn(40, 55, 1);

More usages in the examples folder


  • Arduino/Genuino (Mega, Uno, Arduino Ethernet, ...)
  • ESP8266 (Adafruit HUZZAH ESP8266, Sparkfun ESP8266 Thing Dev)
  • ESP32 (Adafruit HUZZAH32 – ESP32 Feather Board)
  • Teensy 3.2
  • Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500

Memory usage

The code has been pseudo optimized to minimize the memory footprint. Internal buffers also use valuable memory space. The biggest buffer PACKET_MAX_SIZE is set to 350 by default in AppleMidi_Settings.h. Albeit this number is somewhat arbitratry (large enough to receive full SysEx messages), it can be reduced significantly if you do not have to receive large messages.

On an Arduino, 2 sessions can be active at once (W5100 can have max 4 sockets open at the same time, each session needs 2 UDP sockets). Setting MAX_SESSIONS to 1 saves 228 bytes (each session takes 228 bytes).

Network Shields

  • Arduino Ethernet shield (, Wiznet W5100)
  • Arduino Wifi R3 shield (
  • Teensy WIZ820io W5200

Arduino IDE (

  • 1.8.9


I would love to include your enhancements or bug fixes! In lieu of a formal styleguide, please take care to maintain the existing coding style. Please test your code before sending a pull request. It would be very helpful if you include a detailed explanation of your changes in the pull request.

You can’t perform that action at this time.