Bind MIDI events to code blocks in your application
TriggerKit is a Swift framework for binding events to your app’s code. You can use TriggerKit with iOS and iPad applications. MacOS is enabled in the Package, but not currently tested.
TriggerKit is currently in Beta, and as such, may have breaking changes in future releases. When the planned event types are added, I will issue a 1.0 release.
I would like to thank Steffan Andrews for their MIDIKit library, without which TriggerKit would not be able to exist in it’s current form.
The key concept for TriggerKit, is that you can create codable actions for you app and events, and easily store and restore mappings for MIDI and other event types.
Event Types supported
MIDI CC ✅
MIDI Notes ✅
Event Types planned 🗺️
OSC
Gamepad
These event types are planned as additions to TriggerKit, in future releases. Please don’t hesitate to open an issue or create a PR for features you need 🙏
Quick start 🏁
Add TriggerKit to your project via Swift Package Manager: https://github.com/lightbeamapps/TriggerKit
Create an enumeration of the actions your app wants to map, that conforms to TKAppActionConstraints
Instantiate the TriggerKit Bus
let config = TKBusConfig(clientName: "TriggerKit", model: "TriggerKit", manufacturer: "Lightbeam Apps")
let bus = TKBus<YourAppAction>(config: config)
Add Mappings
let mapping = TKMapping(appAction: TestAcYourAppActiontion.action1, event: TKEvent.midiCC(trigger: .init(cc: 1)))
bus.addMapping(mapping) { payload in
// Do something!
}
You now have a TriggerKit Bus, and your first mapping 🎉!
Usage and key concepts
Codable
Once you have created actions and mappings, you can encode these to persist them to disk and retrieve at run time.
Learning events
You can set a single callback for all events with the bus function:
bus.setEventCallback() { event in
// Use/persist the most recent event to update or add a mapping
}
The demo application shows an example of this.
Examples
TriggerKitDemo - a SwiftUI app that shows example mappings, and an event learn set up.
Inbuilt views for Bluetooth midi
TriggerKit has some wrappers for the CoreAudio BlueTooth MIDI detection views:
TKBluetoothMIDIView SwiftUI
TKBTMIDICentralViewController UIKit
Contributing
Code of Conduct and Contributing rules 🧑⚖️
Our guide to contributing is available here: CONTRIBUTING.md.
All contributions, pull requests, and issues are expected to adhere to our community code of conduct: CODE_OF_CONDUCT.md.
TriggerKit
Bind MIDI events to code blocks in your application
TriggerKit is a Swift framework for binding events to your app’s code. You can use TriggerKit with iOS and iPad applications. MacOS is enabled in the Package, but not currently tested.
TriggerKit is currently in Beta, and as such, may have breaking changes in future releases. When the planned event types are added, I will issue a 1.0 release.
I would like to thank Steffan Andrews for their MIDIKit library, without which TriggerKit would not be able to exist in it’s current form.
The key concept for TriggerKit, is that you can create codable actions for you app and events, and easily store and restore mappings for MIDI and other event types.
Event Types supported
Event Types planned 🗺️
These event types are planned as additions to TriggerKit, in future releases. Please don’t hesitate to open an issue or create a PR for features you need 🙏
Quick start 🏁
Add TriggerKit to your project via Swift Package Manager:
https://github.com/lightbeamapps/TriggerKit
Create an enumeration of the actions your app wants to map, that conforms to TKAppActionConstraints
Instantiate the TriggerKit Bus
You now have a TriggerKit Bus, and your first mapping 🎉!
Usage and key concepts
Codable
Once you have created actions and mappings, you can encode these to persist them to disk and retrieve at run time.
Learning events
You can set a single callback for all events with the bus function:
The demo application shows an example of this.
Examples
Inbuilt views for Bluetooth midi
TriggerKit has some wrappers for the CoreAudio BlueTooth MIDI detection views:
TKBluetoothMIDIView
SwiftUITKBTMIDICentralViewController
UIKitContributing
Code of Conduct and Contributing rules 🧑⚖️
Key contributors ⚡️
Admin
License 📃
TriggerKit is licensed with the BSD-3-Clause license, more information here: LICENSE.MD
This is a permissive license which allows for any type of use, provided the copyright notice is included.
Acknowledgements 🙏