RTP-MIDI Explained: Streaming MIDI Over Ethernet
RTP-MIDI is an open specification that enables the transmission of Musical Instrument Digital Interface (MIDI) messages over standard IP networks, such as local Ethernet and Wi-Fi. This article provides a comprehensive breakdown of what RTP-MIDI is, its structural advantages over traditional 5-pin DIN and USB connections, and the technical mechanics behind how it encapsulates, synchronizes, and guarantees the delivery of musical performance data across a local area network.
What Is RTP-MIDI?
RTP-MIDI (Real-time Transport Protocol for MIDI) was standardized by the Internet Engineering Task Force (IETF) under RFC 4695 (later updated by RFC 6295). It integrates the standard MIDI language into the Real-time Transport Protocol, an established network framework commonly used for streaming audio and video. Native to macOS and iOS (often referred to as AppleMIDI or Network MIDI), it can also be used on Windows and Linux systems using open-source drivers.
How RTP-MIDI Transmits Data Over Ethernet
Traditional MIDI relies on point-to-point physical cables with severe bandwidth or cable-length limitations. Ethernet, by contrast, provides high-bandwidth, long-distance, and multi-device routing capabilities. RTP-MIDI bridges the two technologies using several core networking mechanisms:
1. UDP/IP Encapsulation
RTP-MIDI uses User Datagram Protocol (UDP) instead of Transmission Control Protocol (TCP) for transport. Because TCP requires packet acknowledgments and retransmits lost packets sequentially, it introduces unpredictable latency that disrupts musical timing. UDP prioritizes speed and low latency by transmitting data packets without waiting for handshakes, making it ideal for real-time performance.
2. The Recovery Journal
Because standard UDP does not guarantee packet delivery, dropped packets in a music context could lead to stuck notes or missing controller commands. RTP-MIDI solves this through a built-in mechanism called the Recovery Journal. Each transmitted packet contains not only the current MIDI event but also an encoded history (the journal) of recent states—such as currently active notes, pitch bend settings, and control changes. If a packet is lost in transit, the receiver reconstructs the missing state immediately upon receiving the next packet, preventing stuck notes without requiring the retransmission delays of TCP.
3. Sub-Millisecond Timestamping and Synchronization
To eliminate timing jitter caused by network traffic, RTP-MIDI uses high-resolution timestamps based on a shared clock (typically running at 10 kHz or 100 microseconds per tick). When a device transmits a note, it stamps the packet with the precise execution time. The receiving synthesizer or digital audio workstation (DAW) buffers these incoming packets briefly to smooth out jitter and executes the MIDI commands exactly when their timestamps dictate, preserving the human feel and tight groove of a performance.
4. Session Management and Discovery
RTP-MIDI operates by establishing peer-to-peer sessions between endpoints over specific UDP ports (by default, control data uses port 5004 and stream data uses port 5005). Devices identify each other on a local Ethernet network either via manual IP address assignment or automatically through zero-configuration networking protocols like mDNS/Bonjour. Once connected, multiple computers, synthesizers, and controllers can route dozens of virtual MIDI cables bidirectionally over a single standard Ethernet cable.