Receive MIDI Messages from Any Device

A complete reference implementation for listening to MIDI input on iOS, iPadOS, and macOS.

The Problem

CoreMIDI is notoriously difficult to implement. The documentation is sparse, most tutorials are outdated since Swift and SwiftUI changed everything, and there are no complete examples showing how to receive MIDI messages from USB controllers on modern Apple platforms. The framework requires understanding MIDIClientRef, MIDIPortRef, MIDIEventList parsing, and proper source connection management.

The Solution

This complete multi-platform application demonstrates professional MIDI implementation:

  • MIDIClientRef Setup - Proper client creation with notification handling
  • MIDIPortRef Configuration - Input port creation with protocol specification
  • Hot-Plug Support - Automatically connect new MIDI devices when plugged in
  • Event Parsing - Extract note on/off, velocity, and channel data
  • Real-Time Logging - Display messages as they arrive
  • Multi-Platform - Runs on iOS, iPadOS, and macOS

The Benefits

  • Save 30-50 hours of CoreMIDI research and experimentation
  • Modern implementation using MIDIInputPortCreateWithProtocol (not deprecated APIs)
  • Runs everywhere - iPhone, iPad, and Mac from single codebase
  • Wi-Fi debugging instructions for testing with USB MIDI devices
  • Extensible foundation for building your own MIDI applications

Platform Support

  • USB MIDI controllers (direct connection)
  • MIDI adapters (Roland UM-ONE mk2 and similar)
  • Bluetooth MIDI (requires additional code for iOS)

Works with any MIDI controller: keyboards, drum pads, DJ controllers, wind controllers, and more.

What You Get

Complete Xcode workspace with working application for iOS, iPadOS, and macOS. All code is production-ready and well-documented.


Start building your MIDI app today.

Get the Source Code