Piano Keyboard for iOS

Piano Keyboard for iOS

Released 5 years ago , Last update 2 years ago

High-performance code for multi-touch piano keyboard for iPhone and iPad. This MIDI enabled keyboard is ready to plug straight in to your App.

Questions & Comments

Or enter your name and Email
  • G GREGORY License holderApplication License
    Purchased on Mar 16, 2013
    3 years ago
    Hi Ben, Did you get my request for a quote yesterday for an app using this and your MIDI animation kit
    • Ben Smiley Publisher 3 years ago
      Hi Gregory, I've replied to your email. Thanks, Ben
  • PC Peter C. 3 years ago
    Hi Ben ! I was wondering if you also have this available in Swift as a download? Best, Peter
    • Ben Smiley Publisher 3 years ago
      Hi Peter, I'm afraid that there's currently no version available in Swift. Thanks, Ben
    • PC Peter C. 3 years ago
      Ok, thank you. I am currently trying to create a piano app myself in Swift, but am having some trouble with the response of the keys. On the upper left side of this webpage it says you use UIKit as a framework. What framework do you use to create the music part? I'm just wondering if it's worth it for me to download the objective-c version and translate it to Swift myself. The problems I'm having with my piano app (AVFoundation) is that there is a latency/delay issue, non responsive behaviour and not able to do precise multi-touch. When I look at your video of this app, it looks exactly what I'm looking for and I'm considering downloading it. Did you use any other specific framework that's not standard in Xcode? I'm just trying to decide if I should go for it or not. Thank you for your fast response ! Peter
    • Ben Smiley Publisher 3 years ago
      Hi Peter, The audio part of the piano is created using CoreAudio - An AUSampler (with a piano SoundFont) attached to a remote IO unit. I didn't use any custom frameworks - just created some custom views and overrode the touch detection methods. Getting the multi-touch to work is tricky. Personally I'd recommend just leaving the component in Objective C. The piano only requires about 5 lines of code to add it to a project. Thanks, Ben
    • PC Peter C. 3 years ago
      So, just to be clear. Would it be easy for me to add your files (in Objective-C) to my Xcode-project which I wrote in Swift and make it work? I'm new in iOS programming and have only been working with Swift so far. Would I be able to translate the entire file to Swift or should I just do like you said and add the Objective-C files to my app and try to make a bridge? Just want to make sure I understand correctly. Thank you for responding this fast ! And you are saying that if I want to add your piano to my current project it would only need 5 lines of code? Peter
    • Ben Smiley Publisher 3 years ago
      Hi Peter, Here's a guide which explains how to import Objective C to Swift: http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift You could try to translate the classes into Swift. But the problem may be that if you make one small mistake, the component wouldn't work properly. To add the component you just need to add the piano view to your view, create a new audio controller instance and set your view as the piano delegate. It is very straightforward. There's an example in the project file. Thanks, Ben
    • AF Albert Frantz 3 years ago
      Hi Ben, Could you perhaps create a bare-bones Swift project that imports the Objective C classes and creates a piano view? It seems there are many of us just getting started with Swift who have the same questions. I understand that this task must be trivial for you but it's still daunting to beginners who don't yet know the syntax. This would be an enormous help! Kind regards, Albert
    • BS Ben Smiley 3 years ago
      Hi Albert, I'll try to create a SWIFT template this week. Thanks, Ben
    • AF Albert Frantz 3 years ago
      Thanks, Ben! Much appreciated.
    • AF Albert Frantz 3 years ago
      Any update on the Swift template? I'm eager to get started with your library (and thus far haven't been able to get it working in Swift). Many thanks in advance.
    • AF Albert Frantz 3 years ago
      Hi Ben, Any news on the Swift template? It's been over a month and I'm eager to get started. Many thanks, Albert
    • Ben Smiley Publisher 2 years ago
      Hi Albert, The Swift package has now been added. Sorry for the delay! Thanks, Ben
    • AF Albert Frantz 2 years ago
      Thanks, Ben, works beautifully! The only small issues is that Xcode (7.3) says setDelegate and AudioSessionSetProperty have been deprecated. The code will likely still run into the next major iOS version or two, but maybe a future version of your code will have a workaround?
  • S Sabine License holderApplication License
    Purchased on Dec 26, 2014
    3 years ago
    is the pianokeyboard class available in swift langage ?
  • LB Levent Biyikoglu License holderApplication License
    Purchased on Dec 20, 2014
    3 years ago
    does your keyboard respond to multitouches well, movement of 2 or more fingers at the same time, while playing chords etc? are there any projects or apps we can test it?
    • Ben Smiley Publisher 3 years ago
      The keyboard does respond well to multi touch - you can drag up to 8 fingers at once. If you provide your email address I'll invite you to TestFlight to test the app.
  • IA Ilavenil Arumugam License holderApplication License
    Purchased on Jul 14, 2013
    3 years ago
    iOS 8 compatibility with auto-layout and size classes?
  • L Levent 3 years ago
    Hi, are the keys scaleable?
    • Ben Smiley Publisher 3 years ago
      The keyboard is scalable - one of the inputs when you create a new keyboard view is the scale.
  • AJ Azfar Jafri 5 years ago
    Is this keyboard scrollable? If so, does it implement any gesture recognisers?
    • Ben Smiley Publisher 5 years ago
      Hi Azfar, The piano isn't currently scrollable. However it would be very easy to add that functionality as the piano is just a UIView. It doesn't implement any gesture recognizers. Thanks, Ben
  • OS Oguz Sehiralti 5 years ago
    A few questions: 1) Is it possible to put this in another UIView, so it's not full screen? 2) Is it possible to turn off user interaction and trigger the notes programmatically? I'd like to use this just for monitoring. I'll generate some notes within the app and the keyboard will just visualize them.
    • Ben Smiley Publisher 5 years ago
      Hi Oguz, 1) The piano view overrides UIView so it is possible to nest the piano inside a different view. 2) This isn't enabled by default. It would be fairly easy to disable user interaction (just disable it on the piano's UIView). It would also be possible to highlight keys. Each key stores it's MIDI note as a byte. To highlight note 0x50 for example, you would loop over all the keys and compare the midi note property of each to 0x50. When you found the correct note, you could set it to be pressed using the isPressed: (BOOL) pressed method. Thanks, Ben
  • SA Soney Antony License holderApplication License
    Purchased on May 10, 2013
    5 years ago
    Hi Ben, Is it possible to integrate 12 key keyboard component with a Cocos2d application. Also your keyboard component has any sample to play key board notes from sound fonts?
    • Ben Smiley Publisher 5 years ago
      It would be possible to use the component with Cocos2D but it would depend on the details of the implementation - sometimes using UIView animations with Cocos2D causes slowdown. Take a look at this tutorial about using Cocos2D with UIKit - http://www.raywenderlich.com/4817/how-to-integrate-cocos2d-and-uikit This component includes the ability to trigger sounds based on a SoundFont. You could easily use a different sound font if you wanted to.
    • SA Soney Antony 5 years ago
      Is there any way to control the piano volume? I have tried with http://www.deluge.co/?q=core-audio-mixers-master-volume-ios but always throwing assertion AudioUnitSetProperty while setting the property.
    • Ben Smiley Publisher 5 years ago
      I've added the functionality and I'll upload a new version of the project now.
    • SA Soney Antony 5 years ago
      Thanks, Excellent support. Its working fine :)
  • HC Hillel Coren License holderApplication License
    Purchased on Mar 13, 2013
    5 years ago
    I thought I'd share a link to the app I made with this great component. http://www.youtube.com/watch?v=DIYLPU__dmk https://itunes.apple.com/app/music-maker-pro/id625146505
You need to log-in or create an account
  • Create an account
  • Log-in
Please use your real name.
Activation link will be sent to this address.
Minimum 8 characters
Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.


Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.