I’m at Hack & Tell right now presenting an HTML5 Javascript piano app that recently wrote. It was a fun experiment with generating audio files for different synths via good 'ol JavaScript and data URIs. You can play it with the same key-strokes that you’d use to play the garageband keyboard.

I’m generating mono files at pretty low sampling rate to deal with software limitations, but that, plus the current support for playing HTML5 audio adds to a more retro feel. In the future, people will be trying to get old copies of Firefox 12, so they can play this piano “as it was meant to be heard”. However, for future audio experiments I might just use some of the newer Audio APIs.

I added some extra features, like a looper, a demo mode, different colors for the piano, and a “visual mode”—which shoots out representations of the actual wave forms, as seen below. Hitting "0" or "?" or clicking on the button on the top right of the app will show more settings for the piano.

The entire piano is just CSS styling (except for that little lightning bolt, which was canvas). I use a bunch of box-shadow and text-shadow to make things look more 3d and responsive. Also, I setup a sticky below-the-fold footer, which is something I first noticed on ifttt.com and thought was pretty cool.

Give it a try…


I was supremely fortunate this week, because I got to see Kraftwerk’s 7th performance in their 8 night retrospective at the MoMA. This show covered their 1991 remix album “The Mix.” The sound was excellent, just at the right levels, and behind the “operators” was a massive screen showing 3D visualizations in time with the music. The above pictures don’t give due justice to the experience, but I was able to snap some quick photos from my phone during the show (I had my flash turned off and my screen brightness all the way down, sorry gothamist, your princess is in another castle). Enjoy!

Setlist (via)

  1. The Robots
  2. Computer Love
  3. Pocket Calculator
  4. Taschenrechner
  5. Autobahn
  6. Radioactivity
  7. Trans-Europe Express
  8. The Man-Machine
  9. Spacelab
  10. Neon Lights
  11. Numbers
  12. Computer World
  13. Home Computer
  14. Tour De France 1983 / Tour De France 2003
  15. Expo 2000
  16. Planet Of Visions
  17. Boing Boom Tschak / Techno Pop / Musique Non Stop

As you can see it didn’t follow the album exactly, but that was fine with me!

Also, I added some HTML5 canvas pixelation stuff above and the slide show viewer just because.

We are the robots…

An interactive console to see how jQuery keyboard events get triggered, and some extra techniques for dealing with key event repeats. read full post…
A simple web based tool to convert JavaScript into a bookmarklet and optionally include external scripts, like jQuery. There is an automated demo included at the bottom of the page. read full post…
A short script to speed up page loads by making it easy to load sections of your page via AJAX calls. read full post…

Peter Coles

Peter Coles

is a software engineer who lives in NYC, works at Hunch, and blogs here.
More about Peter »

@lethys · github · hunch
tumblr · rss