PianoKeyboard

master

Piano keyboard view for iOS, in Swift
garynewby/PianoKeyboard

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.

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Mar 28 2024 03:55:05 GMT-0900 (Hawaii-Aleutian Daylight Time)