A piano keyboard view, written in Swift 4.0. Has an IBInspectable key count and show notes properties, and IB_DESIGNABLE preview. All image elements are drawn using Core Graphics.
GLNPianoView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'GLNPianoView'
The Example demo project demonstrates how to use and integrate the GLNPianoView into your project, using AVAudioEngine and an AVAudioUnitSampler as the sound source.
func pianoKeyDown(_ keyNumber: UInt8) {
// Called when the key corresponding to midi number keyNumber is pressed
}
func pianoKeyUp(_ keyNumber: UInt8) {
// Called when the key corresponding to midi number keyNumber is released
}
- iOS 8.0+
- Swift 4.0+
Gary Newby
Licensed under the MIT License.