Registry / communication / pyobjc-framework-coremidi

pyobjc-framework-coremidi

JSON →
library12.2pypypiunverified

PyObjC CoreMIDI provides Python bindings for Apple's CoreMIDI framework on macOS, enabling Python applications to interact with MIDI devices and services. It is part of the larger PyObjC bridge, which allows full-featured Cocoa applications to be written in pure Python. The current version is 12.1, with releases typically tied to macOS SDK updates and Python version support changes.

pip install pyobjc-framework-coremidi
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-C
P
pyobjc-framework-coremidi
communicationpythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CoreMIDI
import CoreMIDI
MIDIObjectGetStringProperty
from CoreMIDI import MIDIObjectGetStringProperty

This example demonstrates how to import the CoreMIDI framework and iterate through the available MIDI devices, printing their names. CoreMIDI is a low-level API; more complex interactions often require a deeper understanding of its C API and manual resource management.

import CoreMIDI import objc def list_midi_devices(): """Lists all available CoreMIDI devices.""" print("MIDI Devices:") num_devices = CoreMIDI.MIDIGetNumberOfDevices() if num_devices == 0: print(" No MIDI devices found.") return for i in range(num_devices): midi_device_ref = CoreMIDI.MIDIGetDevice(i) if midi_device_ref: # MIDIObjectGetStringProperty returns a status code and the string value. # PyObjC automatically bridges CFStringRef to Python string. (name_result, name_str) = CoreMIDI.MIDIObjectGetStringProperty( midi_device_ref, CoreMIDI.kMIDIPropertyName ) if name_result == 0: # noErr print(f" Device {i}: {name_str}") else: print(f" Device {i}: (Error getting name, code {name_result})") else: print(f" Device {i}: (Could not get device reference)") if __name__ == "__main__": list_midi_devices()
Debug
Known issues
breakingPython 3.9 support was dropped in PyObjC 12.0. Python 3.8 support was dropped in PyObjC 11.0. The current version requires Python >= 3.10.
fix
Ensure your Python environment is 3.10 or newer.
affects: >=11.0, >=12.0
gotchaCoreMIDI bindings are a low-level API, and for certain interactions, especially those not based on CoreFoundation or Objective-C types, users may need to perform manual reference counting. Some C functions like `MIDIDeviceCreate`, `MIDISend`, and event list manipulation (`MIDIEventListAdd`, `MIDIEventListInit`) are noted as requiring manual bindings or not being available from Python.
fix
Consult the PyObjC API Notes for CoreMIDI and Apple's CoreMIDI C API documentation for detailed usage and limitations.
affects: All
breakingPyObjC 11.1 aligned the core bridge's behavior with `clang`'s documentation for Automatic Reference Counting (ARC) regarding initializer methods. Methods in the 'init' family now correctly steal a reference to self and return a new reference, which differs from previous PyObjC versions' handling of partially initialized objects.
fix
Review custom Python subclasses of Objective-C classes, particularly `__new__` and `__init__` methods, to ensure compatibility with ARC behavior for initializers. Refer to `__init__` related breaking changes from v10.3/v10.3.1.
affects: >=11.1
gotchaExperimental support for free-threading (PEP 703) introduced in Python 3.13 is included in PyObjC 11, but PyObjC 10.3 explicitly did not support it. While PyObjC 12.1 supports Python 3.10+, if targeting Python 3.13 with free-threading, be aware of the experimental nature of this support.
fix
Exercise caution and thorough testing when using PyObjC with experimental free-threading builds of Python 3.13 or newer. Stick to default Python builds for stable applications.
affects: >=10.3, >=11.0
gotchaThe behavior of `__init__` when a user implements `__new__` in Objective-C bridged classes changed in PyObjC 10.3 (dropping support for `__init__` in such cases) and was partially reintroduced in 10.3.1 due to breaking popular projects.
fix
If encountering issues with `__init__` not being called after `__new__`, ensure you are on PyObjC 10.3.1 or later, and review the specific conditions under which `__init__` is supported when `__new__` is user-implemented versus provided by PyObjC.
affects: >=10.3, <=10.3.1
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredCore component providing the Python-Objective-C bridge.
pyobjc-framework-cocoaoptionalOften required indirectly or for broader macOS application development context.
Agent activity
19 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
pyobjc-framework-coremidi — pip install pyobjc-framework-coremidi · libregistry