]> Agilo's Weblog
Get over here!Scorpion (Mortal Kombat)
(Add a new entry)  

Sunday, April 8 2007, 12:05PM

Guitar Chords and other stuff.

A few days ago I had a couple of hours to kill at my internship so instead of doing nothing I decided to pass time by building up a fretboard of a guitar in a text file for fun and profit.

As I was doing it, I wondered if I could make it in HTML so I could have a better visual on it (i.e. using CSS).
As I built up a basic HTML layout I stopped and thought about a couple of aspects (amount of frets/strings) and pondered about making it in JavaScript instead (so I could change these aspects dynamically).
I then started writing it all up and after some time I got it the way I wanted to; basic fretboard that's easily adjustable.

After I had the ground layers built up, I then thought of adding chords to it if it would be easy to implement, so I started experimenting and worked it out and managed to get it working very smooth and easily.

The only thing I had left to do then was fill up the page with some guitar chords.

I initially wrote just the basic chords (classic C, D, E, F, G, A and B) but as I was doing that, I thought about something I've been thinking about for a while now: I could write some shell scripts to "rip" and use the chord database of a site I use often as reference; jguitar.com.
I've thought about it often because I've always wanted a "random chord" feature from some site but never ran across it (granted; I never really looked).

So I started contemplating and working out the site's structure and found a way to get their entire chord database (I won't say how exactly but I do want to thank them for making it so damn easy for me).

After putting in the chords into the script I started writing the long-wanted "random chord" feature (which was a bit of messing around) and finished that not-too-long after that.

The end result can be found here:


PermaLink  |  Edit