Sunday, 26 September 2010

Total Eclipse Pt II: The Explanation

So what on earth was the last post all about?  Well, you know how it is.  It's Saturday night, you've had some wine and cheese and pate and olives and suddenly you start having "good" ideas.  Yup, sorry, I was drink-coding.  These things happen.

Whilst researching for an 80's themed fancy dress party I came across a stunning piece of work by Jeannie Harrell, a flow chart that generates a section of Jim Steinman & Bonnie Tyler's cult hit "Total Eclipse Of The Heart".

As this gloriously demonstrates, most songs have a structure, bits repeat.  Total Eclipse does this repeatedly, and as such is ideal for a really silly coding exercise, which (if you're not familiar with PHP) is what all that gibberish does.  It generates the entire song using a mere 2366 characters, rather than the 3050 in the official version from Bonnie Tyler's website (not including whitespace).  That's a 22.4% saving on keyboard wear and tear if you ever need to type the lyrics out on a website.

Bat Out Of Hell should also work quite fact, I'm tempted to compile a league table of songs and how compressible they are....2 Unlimited may well end up near the top...

No comments:

Post a Comment