
Enables type-safe live MIDI input and output handling with minimal code. Utilizes coroutines for MIDI channel consumption and supports creating MIDI events using a DSL.
Kotlin Multiplatform MIDI library that just makes sense.
Currently focused on live MIDI I/O.
Note: this is still in an experimental stage, expect breaking changes until the first stable release.
events module| Platform | Events | Devices | Comment |
|---|---|---|---|
| JVM | ✅️ | ✅️ | |
| Windows | ✅️ | ✖️ | Waiting on Windows MIDI services |
| Linux | ✅️ | ✖️ | Devices support coming after Windows |
| MacOS | ❔️ | ✖️ | No device for testing or development available. |
Version catalog
[versions]
midifunk = "[version]"
[libraries]
midifunk-events = { module = "dev.stashy.midifunk:events", version.ref = "midifunk" }
midifunk-devices = { module = "dev.stashy.midifunk:devices", version.ref = "midifunk" }Gradle Kotlin
implementation("dev.stashy.midifunk", "events", "version")
implementation("dev.stashy.midifunk", "devices", "version")val device = MidiDevice.list()[0]
device.input.open(coroutineScope).onEach { println(it) }val device = MidiDevice.list()[0]
val channel: SendChannel<MidiData> = device.output.open(coroutineScope)
channel.send(event)NoteEvent.create {
noteStatus = true
note = Note.C(4)
velocity = 127u
}Top priority at the moment is to finalize the device input/output API. The eventual goal is to be able to completely rip out the Java MIDI backend & use something else, which will also provide multiplatform support.
After the device API, virtual device support is going to be prioritized. This will most likely require separate backends for each platform to be implemented already.
Although not strictly, please try to adhere to the standard Kotlin code style guidelines, more thoroughly defined in JetBrains IDEs. Other than that, feel free to submit pull requests - I will gladly review them.
Kotlin Multiplatform MIDI library that just makes sense.
Currently focused on live MIDI I/O.
Note: this is still in an experimental stage, expect breaking changes until the first stable release.
events module| Platform | Events | Devices | Comment |
|---|---|---|---|
| JVM | ✅️ | ✅️ | |
| Windows | ✅️ | ✖️ | Waiting on Windows MIDI services |
| Linux | ✅️ | ✖️ | Devices support coming after Windows |
| MacOS | ❔️ | ✖️ | No device for testing or development available. |
Version catalog
[versions]
midifunk = "[version]"
[libraries]
midifunk-events = { module = "dev.stashy.midifunk:events", version.ref = "midifunk" }
midifunk-devices = { module = "dev.stashy.midifunk:devices", version.ref = "midifunk" }Gradle Kotlin
implementation("dev.stashy.midifunk", "events", "version")
implementation("dev.stashy.midifunk", "devices", "version")val device = MidiDevice.list()[0]
device.input.open(coroutineScope).onEach { println(it) }val device = MidiDevice.list()[0]
val channel: SendChannel<MidiData> = device.output.open(coroutineScope)
channel.send(event)NoteEvent.create {
noteStatus = true
note = Note.C(4)
velocity = 127u
}Top priority at the moment is to finalize the device input/output API. The eventual goal is to be able to completely rip out the Java MIDI backend & use something else, which will also provide multiplatform support.
After the device API, virtual device support is going to be prioritized. This will most likely require separate backends for each platform to be implemented already.
Although not strictly, please try to adhere to the standard Kotlin code style guidelines, more thoroughly defined in JetBrains IDEs. Other than that, feel free to submit pull requests - I will gladly review them.