A piano keyboard view, written in Swift. Has an IBInspectable key count property and IB_DESIGNABLE preview. All image elements drawn via 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.
##Delegate Methods
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
}
- Requires iOS 8.0 or later
- Requires Automatic Reference Counting (ARC)
Gary Newby
Licensed under the MIT License.