Skip to content

garynewby/PianoKeyboard

Repository files navigation

PianoKeyboard

Build and test

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

Example app

Installation

Swift Package Manager

https://github.com/garynewby/PianoKeyboard.git

Demo

The Example app demonstrates integrating PianoKeyboard in a SwiftUI project and creating a custom style, and includes a simple AVAudioEngine based 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
}

Requirements

  • Swift 5, SwiftUI

Author

Gary Newby

License

Licensed under the MIT License.

About

Piano keyboard view for iOS, in Swift

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages