skillfed

python-rtmidi

A Python binding for the RtMidi C++ library implemented using Cython.

python-rtmidi v1.5.8 103.5K downloads/30d#12,800 on PyPI411
Permissive license Copyright & License =================== python-rtmidi was written by Christopher Arndt, 2012 - 2023. The software is released unter the MIT License: Copyright (c) 2012 - 2023 Christopher Arndt… (full text in the JSON record) AGING released

What it is and what it does

python-rtmidi is a thin Python wrapper around the RtMidi C++ library, implemented using Cython. It exposes a cross-platform API for MIDI input and output on Windows (MultiMedia System), macOS (CoreMIDI and JACK), and Linux (ALSA and JACK). The package adapts RtMidi's C++ interface to Python conventions, allowing developers to open MIDI ports, send note-on/note-off messages, and manage virtual ports without writing C++ code.

The library is production-stable and supports Python 3.8 and later. It has no runtime Python dependencies, only the compiled RtMidi C++ bindings. Wheels are pre-built for common platforms (macOS Intel/ARM, Linux x86_64/aarch64, Windows x86_64), reducing installation friction for most users. The package is suitable for music software, hardware control, and real-time MIDI sequencing applications.

Use it for:

  • Send MIDI note messages to a synthesizer or DAW from a Python script or application.
  • Receive MIDI input from a keyboard or controller and process it in real-time.
  • Create a virtual MIDI port to route messages between applications on the same system.
  • Build a Python-based MIDI sequencer or control surface for music production.
  • Interface with hardware MIDI devices (drum machines, synthesizers) from Python code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

python-rtmidi provides a Python interface to the RtMidi C++ library for sending and receiving MIDI messages across Windows, macOS, and Linux systems.

Yes, if you need MIDI I/O in Python. The package is stable (Production/Stable status), permissively licensed, has no runtime dependencies, and offers broad platform and Python version coverage. Install friction is moderate due to compiled bindings, but pre-built wheels mitigate this for standard platforms. The last release is from November 2023 and the repository remains active; aging maintenance is typical for a mature, feature-complete library.

Install

python-rtmidi on PyPI

pip

pip install python-rtmidi

uv

uv add python-rtmidi

poetry

poetry add python-rtmidi

Installing python-rtmidi

Before you install

Medium install friction due to compiled C++ bindings; wheels are available for Python 3.8–3.12 on macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows. Last release was in November 2023; repository remains active with a recent commit in January 2026.

License in practice

MIT License (permissive). The package and its underlying RtMidi C++ library are both released under MIT terms, allowing free use, modification, and distribution with minimal restrictions.

Quickstart

import rtmidi
import time

midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()

if available_ports:
    midiout.open_port(0)
else:
    midiout.open_virtual_port("My virtual output")

with midiout:
    note_on = [0x90, 60, 112]
    note_off = [0x80, 60, 0]
    midiout.send_message(note_on)
    time.sleep(0.5)
    midiout.send_message(note_off)

Requires a MIDI output device or virtual MIDI port available on the system; on Linux, ALSA or JACK must be configured; on macOS, CoreMIDI is built-in; on Windows, MultiMedia System is built-in.

Verify before relying

  • Whether the package handles MIDI input (MidiIn) with the same API surface as MidiOut, or if input support has different constraints.
  • Performance characteristics and latency guarantees for real-time MIDI applications.
  • Whether virtual port creation is supported on all three platforms or only on some.

Package facts

License Copyright & License =================== python-rtmidi was written by Christopher Arndt, 2012 - 2023. The software is released unter the MIT License: Copyright (c) 2012 - 2023 Christopher Arndt… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 998 days since the last release
Last repo commit
First released
Downloads 103,536/month — #12,800 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_rtmidi-1.5.8-cp310-cp310-macosx_10_9_x86_64.whl; python_rtmidi-1.5.8-cp310-cp310-macosx_11_0_arm64.whl; python_rtmidi-1.5.8-cp310-cp310-manylinux_2_28_aarch64.whl; python_rtmidi-1.5.8-cp310-cp310-manylinux_2_28_x86_64.whl; python_rtmidi-1.5.8-cp310-cp310-win_amd64.whl; python_rtmidi-1.5.8-cp311-cp311-macosx_10_9_x86_64.whl; python_rtmidi-1.5.8-cp311-cp311-macosx_11_0_arm64.whl; python_rtmidi-1.5.8-cp311-cp311-manylinux_2_28_aarch64.whl; python_rtmidi-1.5.8-cp311-cp311-manylinux_2_28_x86_64.whl; python_rtmidi-1.5.8-cp311-cp311-win_amd64.whl; python_rtmidi-1.5.8-cp312-cp312-macosx_10_9_x86_64.whl; python_rtmidi-1.5.8-cp312-cp312-macosx_11_0_arm64.whl; python_rtmidi-1.5.8-cp312-cp312-manylinux_2_28_aarch64.whl; python_rtmidi-1.5.8-cp312-cp312-manylinux_2_28_x86_64.whl; python_rtmidi-1.5.8-cp312-cp312-win_amd64.whl; python_rtmidi-1.5.8-cp38-cp38-macosx_10_9_x86_64.whl; python_rtmidi-1.5.8-cp38-cp38-macosx_11_0_arm64.whl; python_rtmidi-1.5.8-cp38-cp38-manylinux_2_28_aarch64.whl; python_rtmidi-1.5.8-cp38-cp38-manylinux_2_28_x86_64.whl; python_rtmidi-1.5.8-cp38-cp38-win_amd64.whl

Keywords: MIDI, multimedia, music, rtmidi

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: MacOS XEnvironment :: Win32 (MS Windows)Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: Sound/Audio :: MIDITopic :: Software Development :: Libraries :: Python Modules

Tags

MIDI input output pythonrealtime MIDI controlcross-platform MIDI librarysend receive MIDI messagesMIDI port managementmusic hardware interfaceMIDI synthesizer control
midiaudio-hardwaremusic-production

More Python Modules packages