chakery / GLNPianoView

Piano keyboard view for iOS, in Swift 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GLNPianoView

An iOS piano keyboard view, written in Swift 4. Has an IBDesignable preview in interface builder with IBInspectable properties for:

  • Number of keys
  • Hide/show note names on white keys
  • Black key height and width

All image elements are drawn using Core Graphics.

alt tag

Installation

GLNPianoView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GLNPianoView'

Demo

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: 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
}

Requirements

  • Swift 4.0+

Author

Gary Newby

License

Licensed under the MIT License.

About

Piano keyboard view for iOS, in Swift 4

License:MIT License


Languages

Language:Swift 97.0%Language:Ruby 3.0%