A SwiftUI piano keyboard view for iPhone and iPad.
Easily customisable styles, configurable
- Number of keys
- Note names
- Key metrics
- Latch, toggle key on/off
- See 'uikit' branch for older UIKit version
https://github.com/garynewby/PianoKeyboard.git
The Example app demonstrates integrating PianoKeyboard in a SwiftUI project and creating a custom style, and includes a simple AVAudioEngine based sound source.
func pianoKeyDown(_ keyNumber: Int) {
// Called when the key corresponding to midi number keyNumber is pressed
}
func pianoKeyUp(_ keyNumber: Int) {
// Called when the key corresponding to midi number keyNumber is released
}
- Swift 5, SwiftUI
Gary Newby
Licensed under the MIT License.