Tuesday 1 April 2008

Virtual keyboard

My latest fascination these days is to play music. I own and am learning the guitar, but I'm also interested to play the keyboard (musical). Few days back I came across "Virtual Keyboard", which is a flash application which lets you play few notes. The nice thing is that the notes on the musical keyboard are mapped to the keys on the keyboard connected to your computer. So for example hitting 'e' on your keyboard produces a 'D#' note. So I wrote a small program in perl which takes in the notes and converts them to keystrokes. Being a touch typist I can play the notes decently enough.

eg: Notes for Clocks by Coldplay:

Eb Bb G Eb Bb G Eb Bb G Db Bb F Db Bb F Db Bb FDb Bb F Db Bb F Db Bb F Db Bb F Db Bb F Db Bb F C Ab F C Ab F C Ab C

Converted to keystrokes:

e u g e u g e u g w u f w u f w u u f w u f w u f w u f w u f w u f a y f a y f a y a

0 comments: