All Projects → garynewby → PianoKeyboard

garynewby / PianoKeyboard

Licence: MIT license
Piano keyboard view for iOS, in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to PianoKeyboard

PianoView
Fully custumisable piano keyboard view with IBDesignable properties in swift
Stars: ✭ 34 (-67.62%)
Mutual labels:  keyboard, piano
hotkey
⌨️ cross-platform hotkey package
Stars: ✭ 82 (-21.9%)
Mutual labels:  keyboard
dasher-web
Dasher text entry in HTML, CSS, JavaScript, and SVG
Stars: ✭ 34 (-67.62%)
Mutual labels:  keyboard
masterkeys-linux
MasterKeys SDK for Linux
Stars: ✭ 22 (-79.05%)
Mutual labels:  keyboard
kinesis-advantage-2
Keyboard layouts and macros for the Kinesis Advantage 2 keyboard.
Stars: ✭ 72 (-31.43%)
Mutual labels:  keyboard
uchroma
An advanced driver for Razer Chroma hardware in Linux
Stars: ✭ 45 (-57.14%)
Mutual labels:  keyboard
intuiter
Global productivity app for anyone who use Windows
Stars: ✭ 24 (-77.14%)
Mutual labels:  keyboard
aframe-keyboard
An Aframe component that renders a fully functional 3D keyboard, that works on mobile, desktop browers, and VR headsets!
Stars: ✭ 23 (-78.1%)
Mutual labels:  keyboard
vue-number-keyboard
vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。
Stars: ✭ 51 (-51.43%)
Mutual labels:  keyboard
react-native-sticky-keyboard-accessory
📎 A sticky wrapper above keyboard to include whatever you want.
Stars: ✭ 22 (-79.05%)
Mutual labels:  keyboard
react-keys
Simple way to bind keyboard to react with redux.
Stars: ✭ 50 (-52.38%)
Mutual labels:  keyboard
DialogUi
关于toast、等待框、对话框、选择框、地址选择框、软键盘等工具的封装
Stars: ✭ 49 (-53.33%)
Mutual labels:  keyboard
keyboard-layouter
Footprint auto placement plugin for keyboard layout
Stars: ✭ 73 (-30.48%)
Mutual labels:  keyboard
nativescript-numeric-keyboard
🔢 Replace the meh default number/phone keyboard with this stylish one
Stars: ✭ 33 (-68.57%)
Mutual labels:  keyboard
launchlet
Make the web yours.
Stars: ✭ 34 (-67.62%)
Mutual labels:  keyboard
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (-60%)
Mutual labels:  keyboard
keynavish
Control the mouse with the keyboard, on Windows.
Stars: ✭ 59 (-43.81%)
Mutual labels:  keyboard
react-native-awesome-pin
A highly interactive and customisable PIN code screen for React Native.
Stars: ✭ 28 (-73.33%)
Mutual labels:  keyboard
react-native-custom-keyboard-kit
React Native Custom Keyboard - Use your own custom keyboard instead of the system keyboard with React Native Custom Keyboard Kit. Its working on Android and iOS.
Stars: ✭ 83 (-20.95%)
Mutual labels:  keyboard
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (-63.81%)
Mutual labels:  keyboard

PianoKeyboard

Build and test

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

  • Number of keys
  • Hide/show note names on keys
  • Black key height and width
  • Hightlight keys, with individual colour (optional play note)
  • Custom key labels
  • Latch, toggle key on/off

All images are drawn using Core Graphics.

Example app

alt tag

Installation

CocoaPods

To use via CocoaPods, add the following line to your Podfile:

pod 'PianoKeyboard'

Swift Package Manager

With Xcode 11+ you can add PianoKeyboard to your project using the Swift Package Manager. From the File menu select Swift Packages and then select Add Package Dependency. A dialogue then will request the package repository URL, enter:

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

Demo

The Example app demonstrates how to integrate and use PianoKeyboard in your project. It includes a simple AVAudioEngine/AVAudioUnitSampler 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
}

Key Labels

A key's label must be assigned a value for it to show:

keyboard.setLabel(for: 60, text: "Do")
keyboard.setLabel(for: 62, text: "Re")
keyboard.setLabel(for: 64, text: "Mi")

for noteNumber in 65...72 {
    keyboard.setLabel(for: noteNumber, text: Note.name(for: noteNumber))
}

Requirements

  • Swift 5

Author

Gary Newby

License

Licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].