A modular multi-platform MIDI toolkit written in pure Swift supporting MIDI 1.0 and MIDI 2.0.
- Strongly-typed MIDI events that seamlessly interoperate between MIDI 1.0 and MIDI 2.0
- Modular, user-friendly I/O with automatic MIDI endpoint connection management and identity persistence
- Swift 6 strict concurrency compliant
- Backwards compatible to macOS 10.13+, iOS/iPadOS 12.0+ and visionOS 1.0+
- Full documentation available, including guides and example code
| Repository | Description | Apple | Linux | Android | Windows |
|---|---|---|---|---|---|
| swift-midi-core | MIDI events & types * | π’ | π§ β | π§ β | - |
| swift-midi-io | MIDI I/O extension | π’ β‘ | - | - | - |
* All repositories depend on SwiftMIDI Core.
β Support for indicated platforms is either planned or WIP.
β‘ macOS, iOS, and visionOS have CoreMIDI I/O support in the operating system. tvOS and watchOS do not have MIDI I/O.
Extensions add optional features.
| Repository | Description | Apple | Linux | Android | Windows |
|---|---|---|---|---|---|
| swift-midi-controlsurfaces | Control surfaces extension (HUI, etc.) | π’ | π§ β | π§ β | - |
| swift-midi-file | Standard MIDI File extension | π’ | π§ β | π§ β | - |
| swift-midi-sync | Sync extension (MTC, etc.) | π’ | π§ β | π§ β | - |
| swift-midi-ui | SwiftUI user interface controls extension | π’ | - | - | - |
β Support for indicated platforms is either planned or WIP.
The library and its extensions are available as Swift Package Manager (SPM) packages.
To get started with all extensions:
-
Add the swift-midi umbrella repo as a dependency.
.package(url: "https://github.com/orchetect/swift-midi", from: "1.0.0")
-
Add SwiftMIDI to your target.
.product(name: "SwiftMIDI", package: "swift-midi")
-
Import SwiftMIDI to use it. This will import all extensions.
import SwiftMIDI -
See the getting started guide and the dedicated code examples repository to see the library in action.
To use only specific features without importing all extensions, use the extension repositories as dependencies instead of the swift-midi umbrella repository. This can help reduce compile time and shrink the total dependency size.
Full online documentation is available for all of the extension repositories. Check the README in each repository for a link to its documentation.
For new users, see the getting started guide and the dedicated code examples repository to see the library in action.
Support for additional platforms may be added in future.
Coded by a bunch of πΉ hamsters in a trenchcoat that calls itself @orchetect.
Licensed under the MIT license. See LICENSE for details.
If you enjoy using SwiftMIDI and want to contribute to open-source financially, GitHub sponsorship is much appreciated. Feedback and code contributions are also welcome.
Please do not email maintainers for technical support. Several options are available for issues and questions:
- Questions and feature ideas can be posted to Discussions.
- If an issue is a verifiable bug with reproducible steps it may be posted in Issues.
Contributions are welcome. Posting in Discussions first prior to new submitting PRs for features or modifications is encouraged.
In an effort to maintain a consistent level of code quality and safety, this repository was built by hand and is maintained without the use of AI code generation.
AI-assisted contributions are welcome, but must remain modest in scope, maintain the same degree of quality and care, and be thoroughly vetted before acceptance.
This repository was previously a mono-repo known as MIDIKit. In April of 2026 it was renamed swift-midi and its individual components were split off into their own extension repositories.
