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 Dec 05 2024 02:36:12 GMT-1000 (Hawaii-Aleutian Standard Time)