Day 26: Piano

Today’s app was possibly the most challenging one yet. It may not look difficult, but I had to figure out a lot of stuff I didn’t know in order to get it to work the way I wanted it to. It’s easy to simply play a sound file like an MP3 or a WAV - but it’s a very, very different process to play sounds that are generated and mixed dynamically. So not only did I need to discover how to do that, but I also had to learn a lot I didn’t know about waves and audio and how computers generate them, etc. It was all a pretty intense learning experience and I’m quite happy about it. :)

So yes, today’s app is a little piano. It doesn’t sound anything like a piano.. more like the sound effects of an 8-bit video game. :) It’s also only 1 octave. And unfortunately I couldn’t figure out how to read more than two touches at a time on the screen, so you’re limited to playing only two tones at a time - which is a real bummer because a lot of the time I spent working on this was to get an engine in place where you could mix an arbitrary number of tones - only to have the touch interface seriously limit the effect. Ah well. It’s still fun!

Update 1: HanHookie pointed out that it’s actually not quite a full octave.. oops!

Update 2: I’ve played around with the ADRS envelope stuff mentioned by HanHookie and I think I’ve improved the sound dramatically. I also changed the mixing code a bit, so perhaps it is better now. I’m no audio expert, though. :) So run off to Installer and update!

51 Responses to “Day 26: Piano”

  1. HanHookie Says:

    Hey Sean, very cool app! It would be particularly helpful if you added volume envelope parameters (ADSR). Also, its not quite 1 octave, stops @ B (7th). A guy over @ modmyifone, made a siiick synth thats still in beta, has a little 16step seq, the accelerometer controls the filters cutoff and reso! It’s cool, but this one is equally as dope! Thanks again Sean…november’s almost over… :(

  2. RANDY DANDY Says:

    DAMN man this application is titty’s! now I can play Chopan And Bach and Beetovan and shit like that. W00T!

  3. RANDY DANDY Says:

    and although it doesn’t sound much like a piano it does sound like an organ. so now i can play inagaddadavida

  4. RANDY DANDY Says:

    sorry to triple post but i really love this application and thought I would suggest an update. OK so hear me out sean/ When you touch the key… It lights up!

  5. Jemand Says:

    I was waiting so long for this application to come! Thank you very much for that!

  6. Jemand Says:

    My speaker “clicks” when I tap on the piano. But thats no real problem.

  7. Sean Says:

    @HanHookie: Volume envelope parameters… hmm.. I’ll have to research that. I learned just about everything I know about audio within the last 24 hours… so I’ve had to come a long way in a short time. :)

    Arg on the octave! It makes sense now that I think about it… oct == eight. Doh!! Of course there’s a screen real estate problem as it is.. adding another key might start making things a bit narrow for fingers. Still.. bummer. :)

  8. Sean Says:

    @Jemand: Yeah.. I’m thinking that perhaps the stuff HanHookie mentioned would help with that - although I didn’t know anything about it a few minutes ago. :P

  9. Sean Says:

    @Randy: Yeah.. I wanted it to light up - but I just plain ran out of time last night. :) Glad you like it, though!

  10. Steve Jobs Says:

    Now you’ve done it sean! taking money away from such apple branded products like Garageband(tm) and logic(tm) and umm itunes? well, now we’re losing billions of dollars

  11. iApp-a-Day - Piano Says:

    […] on the keys to hear the tone. However, you will not hear the typical piano sounds, according to the developer, the sound is straight out of classic 8-bit video games. The only issue I have found with this app […]

  12. Steve Jobs Says:

    OK, I just made myself laugh by playing innagodadavida on it during a bored meeting… you are forgiven by Apple() Sean, Keep up the good work..

    (iappaday december?)

  13. Anonymous Says:

    This has been done already (kinda)
    its on the MMI source list,
    but anyways I love noodling around on things like this..

    :)

  14. Sean Says:

    @Steve: I’m glad you approve… :P

  15. Anonymous Says:

    by the way, if you were wondering
    which 5 or 6 apps you should keep developing after the month is over.
    THIS IS ONE OF THEM.

    great work.

  16. Anonymous Says:

    great app man been messing with it all morning lol as hanhookie said its not quite 1 octave but apossible solution could be a scrollable keyboard. Maybe even use the acceleometer to scroll through the keyboard.

  17. Carl Says:

    Hey Just letting you know that I can play chords (up to 6 or 7 notes) in the program on my iPod Touch. Great Job, I was just thinking about something like this last week!

    Thanks Again,
    Carl

  18. kyle Says:

    woah, great, this definitely one to keep developing. ( like adding the eighth note) lighting up the keys is a good idea.

    but I can’t play two notes at a time, when I do it creates like a low pitch instead of two notes. maybe making one come from L and one from R might solve this but idk

    another idea if the keyboard is scrollable then you should put a dot on middle c so its easy to know where you are . and because length of the keys doesn’t really effect easiness to play, there can be a thin scroller on the bottom perhaps.

    just ideas

  19. Ed Says:

    updated to 1.1 and got kindof dissapointed. I actually liked the old school loud and beepy sounding 1.0 version more

  20. Sean Says:

    @Ed: I just released 1.2.. It’s more loud/harsh/oldskool now.. I’ve been messing with this so long I can’t remember exactly what 1.0 sounded like anymore… :)

  21. Ed Says:

    actually yes. as others have mentioned already - this one is for further developing. very promising iSynth.

    great apps, keep it up

  22. Bill Gates Says:

    Why does no one care enough to make hacks like this for the Zune?

  23. Matt Says:

    Because the Zune has a fake scrollwheel.

  24. Paino Update 1.3 Says:

    […] There has just been an update in installer.app to today’s iApp-a-Day - Piano. The update vastly improves the sound of the piano…instead of the video game tones you once heard…it now sounds much more like a piano. I did find that you can only play one note at a time now. Before the update you were able to play two notes at the same. And for some reason I am still getting the weird staticy noise every time I play a note. But, I like the update…I much prefer the new new sound of the piano…good job Sean. […]

  25. Zcott Says:

    Unfortunately there’s still a bit of a click when I hit and also when I release a note…any chance that could be fixed? This is my favourite app so far! :-)

  26. Curtis Says:

    Hi! I just updated and now it sounds more like a guitar than a keyboard… Any chance we can get the old sound back?
    Thanks!
    -=C=-

  27. Jerry Says:

    Wow, way awesome app man. I think I’ll buy you a pizza tomorrow night for this one, man. I’ll eat it for you in your honor.

  28. Steve Says:

    Another qualtiy app.. I agree November nearly over not happy. :(

  29. Zcott Says:

    Damn, that was a fast update!

    Thanks!

  30. Lebanon Says:

    Awesome app really!
    I like how you removed the click, but the other voice clips were SO much better, especially when you typed in double notes. now they just ..screech like on a guitar
    Really awesome apps so far….
    We love you Sean!

  31. Lebanon Says:

    Wow! that was fast… I can’t believe how fast you’ve been coding. I hope you get hired by apple or something; you really seem to master your stuff! The clicking is mostly gone except in some transitions but it is MUCH MUCH better.
    I like the new sound, very smooth.
    Thanks again!

  32. RANDY DANDY Says:

    http://www.youtube.com/watch?v=Q-wKJtAUJsI

    Well here you go

  33. Sean Says:

    @RANDY: That’s awesome! :-)

  34. Piano Update 1.4 Says:

    […] staticy noise is now gone and the piano sounds great! I can even play more then one note at a time. Sean is really on a ball tonight…great job! digg_url = […]

  35. Chill23 Says:

    Sean,

    Another jewel. You remain my hero. I hope that on Dec1 you pour yourself a nice tall drink, or load yourself a fat bowl, or do whatever it is you do to celebrate and relax after a job well done.

  36. Andrew Says:

    THANK YOU! Finally a working keyboard application. As a musician this is going to come in VERY handy. Keep up the great work.

  37. tanc Says:

    thanks Sean, this allowed me to tune my bicycles spokes. Strange but true!

  38. Norman Says:

    this is so cool ! I already wrote you an email about it, but you didn’t answer yet, maybe you just get 2 much mail, so im writing it here :D

    THIS ROCKS ! we need a full octave, and you shouldnt be able to hit the white keys when you tap at the upper screen, this way you always hit the black ones that you want to hit (which at the moment is kind of hard cause white keys are hit instead) so bottom = white, top = black, but dont change the look of they keys :P (well if you add 1 more for a full octave thats something different)

    PLZ try to improve this app, since it is one of the few i think are really outstanding …. like others already mentioned, i also installed some of your apps but deleted most, but this here (and air hockey :P) totally ROCK !!!!! improve them plz, 5 outstanding applications are better then 50 that arent really working …

    and THANKS for ally our work !!!!

    Norman, Germany

  39. Jeremy Says:

    Love the piano app! Please add more sounds in the future! More authentic NES sounds would be awesome!

  40. Casey Says:

    Piano App 1.2 trick:

    Make your iPhone sound like a US phone line:

    Dial Tone: F + A
    Ringback: G + A

    busy signal, not quite certain, but i think its G+B

  41. towelie Says:

    Great app…how did you stop clicks?
    Also, really needs a full octave. Then i’d be able to play Funky Town

  42. coolie Says:

    i love this app!!! you are the best

  43. Piano Update 1.5 Says:

    […] that much but, I must say, I do like the app better now!! It just sounds complete! I know the developer was concerned that the keys would be too small with an eighth key…I don’t think it is a […]

  44. Norman Says:

    wooooow it has a full octave now !!! YOU ROCK, finally i can play “Amazing Grace” on it ;P

    is it me or is this version pretty muted? i raised the sound of the “music” player but that didnt change much … where can i set the volume?

  45. Norwegian Says:

    Where can I get this app, and other of this apps? Is it just to add a source in the installer?

  46. monkeys_rock Says:

    zunes suck (no offense Bill :) )

  47. owen Says:

    Not sure if you are still reading this forum, but, I have had piano 1.5 installed since it was released on the 26th. Today I go to play it and the icon is missing. I SSH into the phone and in the application folder i see Piano.app with files App,Default.png,icon.png,Info.plist and keyboard.jpg
    I go to INSTALLER and piano is showing in my UNINSTALL list. I uninstall/reinstall several times, still no icon. I refresh springboard, still no icon. I installed some other i-app-a-day files to check, and they installed fine. I am using custom icon so I drag icon.png to my summerboard theme icon file, rename it Piano.png, still no icon for piano.

    Any suggestions ? Anyone ?

    P.S. the last program I installed before noticed the icon was missing was VoiceNotes 0.22 I have unistalled that program and reinstalled piano several times, still no icon.

  48. owen Says:

    I installed XLaunch which shows the piano icon. I then did a restore an piano icon is again on my desktop.

  49. » iPiano » iPhoneFan Says:

    […] de las aplicaciones del iApp-a-Day, mas especifico la del 26 de noviembre fue ‘Piano’ no llega ni a una octava y tiene sonido de juego de video del año del […]

  50. Michael Says:

    The piano is the greatest app that you’ve made!

    A pitty though that you can’t include real piano sounds. That would be SUPERDUPER!!!

  51. Ankit Says:

    Thanks buddy