27 January 2006

Wolfgang Amadeus Mozart, Hacker

Today is the 250th anniversary of the birth of Wolfgang Amadeus Mozart. Most people know him as one of the world's greatest composers: a child prodigy, creator of over 600 works, and – if you believe some of the wilder rumours - fatally poisoned at the age of 35 by a rival composer. Few, though, are aware that Mozart was also a hacker.

Computers may not have existed in the eighteenth century, but the musical machines called orchestras and choirs are conceptually identical to synthesisers, which are themselves specialised music computers. Just as programming code specifies how a computer should act (and a MIDI file controls a synthesiser), so musical code – in the form of a score – directs what instruments and voices should do and when.

Conductors are largely superfluous in all this (at least for Mozart's music): they do not create the output, which is specified by the score. All they do is interact with the score “loaded” on the orchestral or choral machine, in the same sense that someone might interact with a video game loaded on a console. The incidental nature of humans in the performance of classical music is shown by some pieces that Mozart wrote at the end of his life for a clock with built-in mechanical organ. Here the scores completely determined the audio output: there was no human intervention once the music had been converted to a kind of piano roll – a forerunner of the punch cards employed a century and a half later by the early commercial mainframe computers.

More generally, though, hacking is a state of mind, a way of understanding and exploring the world, independent of a particular technology (and not to be confused with “cracking”, which is the correct name for the kind of digital smash and grab too often in today's headlines). Richard Stallman, perhaps the greatest hacker of modern times, has defined the essence of hacking as “playful cleverness” - as good an encapsulation of Mozart's genius as any.

The cleverness showed itself early. Mozart started learning the piano when he was three, began composing when he was five, and wrote his first symphony and opera at the age of eight and 11 respectively. Like many top coders, he frequently worked out everything in his head before consigning it to paper at a single sitting (often just hours before a deadline – again, just like some programmers), and usually without the need for revisions (that is, bug-free). He could also multi-task: he is supposed to have written one of his finest works during a game of skittles.

Like any red-blooded hacker, Mozart adored mathematics as a child (and gambling as an adult), found word-play irresistible (email would have been perfect for him) and loved setting himself puzzles. His Musical dice game uses dice throws and pre-composed short fragments of music to form compositions created by random numbers; the challenge was writing fragments that would fit together whatever the throws. At one point in his opera Don Giovanni, in addition to the main orchestra accompanying the singers, there are three more orchestras on stage, each playing completely different music. It all fits together so perfectly that most opera lovers are unaware of the compositional tour-de-force they are witnessing.

Mozart's playfulness was a key facet of his character. The musical form he seems to have enjoyed writing most – opera buffa – is simply Italian for “funny opera”. In several concertos composed for a horn-playing friend, Mozart added jocular comments to the music - “Slowly, Mr Donkey”; “Breathe!”; “Go on!”; “Oh, filthy swine!” - an early example of commented code. He sometimes employed different coloured inks in a score, rather as modern programming tools do to differentiate various elements. Another piece, called A musical joke, includes notes that are blatantly wrong. If the musicians play them as written, they sound incompetent; if they play the “right” notes, they have failed to perform the piece as the composer intended, and so are indeed incompetent.

Significantly, Mozart was a big fan of a key hacking concept known as recursion, whereby something refers to itself to create a kind of infinite loop. For example, a core hacking project started and led by Stallman is called “GNU”, an acronym for “GNU's Not Unix”, which uses itself in its own explanation. (Recursion is another example of playful cleverness).

Recursive music is created by employing a delayed version of a tune as its own accompaniment. Formally, this is known as a “canon” (simpler versions, like the song “London's burning”, are called “rounds”), and Mozart wrote dozens of them, mostly for himself and his friends to sing at purely private performances. They are notable not only for their fine music, but also for the texts Mozart chose to set: “Lick my bum” is one memorable line that crops up more than once. Today's hackers, too, enjoy dubious lyrics, and have an earthy turn of phrase: the injunction “RTFM” - often thrown at hapless newbies - does not stand for “Read The Flipping Manual”.

Another notable characteristic of hackers is their fondness for science fiction. Overt references to Star Wars may be thin on the ground in Mozart's works, but many of his operas written in the older, “serious” style are based on the same eternal themes of good versus evil and love versus duty that lie at the heart of George Lucas's epic.

The science-fiction writer Arthur C. Clarke once suggested that any sufficiently-advanced technology is indistinguishable from magic; the corollary is that magic is indistinguishable from sufficiently-advanced technology. So Mozart's last opera, The Magic Flute - full of other magical objects, too - is, from this viewpoint, a work of science fiction. It is also a Masonic opera, steeped in mysterious symbols and rituals that will be nonetheless be familiar to the hackers who participate in MMORPGs (Massively Multiplayer Online Role-Playing Games), where characters join guilds, complete quests and seek to gain experience points - just like the hero in The Magic Flute.

The close links between music and hacking run both ways, and many of today's top coders are highly musical. Richard Stallman – whose dedication to the cause of freedom is positively Beethovenian - carries with him a soprano recorder wherever he travels. The profoundly-religious and frighteningly-cerebral Donald Knuth – a kind of hacker J.S.Bach - was moved by his love of music to have an 812-pipe baroque organ built in a specially-designed room in his house. Appropriately enough, Knuth's life-work is called The Art of Computer Programming (Bach called his The Art of Fugue). Representing a different musical tradition, Brian Behlendorf, the prime mover behind the Apache Web server program that runs two-thirds of the Internet, DJs ambient and dub music. And it is well known that for most hackers the crucial first step when they start working is to fire up some particularly loud and inspirational music on their computer. Mozart would have approved.

8 comments:

Anonymous said...

This is a (heavily laboured) joke right ?

I hope so - because you clearly have no idea about music.

Anonymous said...

The above comment is a heavily laboured joke, right? Because I am a degreed classical piano and voice major currently working as an IT professional, and I see nothing wrong with it.

Anonymous said...

"Computers may not have existed in the eighteenth century, but the musical machines called orchestras and choirs are conceptually identical to synthesisers"

As a classical music playing web developer, I can see where you're going with this - but I think you are mistaken in stating that the two are conceptually identical.

There is an incredible amount of cooperation, collaboration, two-way communication when playing in an orchestra. I actually view it as near opposite of the "rote execution" that a synthesizer does.

The score is a sketch, an early plan meant to help musicians coordinate their efforts - but it is the composer's vision (in the form of the score) AND musicians AND the conductor who imbue the music with the feeling and emotion that makes it enjoyable and compelling. This three way relationship is not strictly hierarchical as you wish it to be.

It is this process of variable and collaborative interpretation that makes playing and listening to Mozart's music, even several hundred years after he has died, worthwhile.

Your analogy is an overly deterministic view of music making. Music (even Mozart's) is much more than "following directions."

But don't take my word for it - I hope you get the opportunity to play Mozart in an orchestra. It can be an exciting, emotional and thrilling experience in a way that listening to a synthesizer execute a midi score simply is not.

Glyn Moody said...

Well, maybe I simplified the argument slightly....

But what I wanted to get across was this interesting similarity in the process of programming a computer and "programming" the orchestral or choral machine.

Of course, music is much more than just feeding in those programs, but nonetheless I think it throws an interesting light on Mozart - and on composing in general - to think of it in these terms.

(And even if I've not played in Mozart in an orchestra, I've played his chamber music, so I do have some idea of what you mean.)

Anonymous said...

To the classical pianist:

As a person with a Masters Degree in Music Composition who makes a living doing computer programming, I can state that it is my experience that this is totally right on, and while frought with whimsy, not at all a joke.

The universe is an elegant machine, and defining variables and playfully manipulating them is what creates the music that we dance to. Even our usage of words is the implementation of code into sentences and paragraphs. We are all always defining and manipulating variables.

I have met lots of pianists who really don't understand composition. In fact, I have met very few people who are fascinated with the concept of defining and manipulating variables. Most folks just want to play the songs that other people write.
Mozart wasn't like that, in the same way a hacker who manipulates a different set of variables isn't like that.
If you think there is something more to Mozart than the playful manipulation of variables, then your don't understand Mozart, the weather, the sea, or the sun. It's all the same joy.

Anonymous said...

Ok, so Mozart was great; but let's see what L.v Beethoven gets.

Anonymous said...

a joke? no; i'd regard it rather as playful cleverness. the author clearly _could_ know more about both hacking and music, but touches on several good points.

i'd give the author minus points for: stating that there is a consensus that all malicious hacking activity ought to be called 'cracking'; comparing conductors with video game players; stating that canons employ recursion.

plus points for: drawing an analogy between piano rolls and punch cards; finding similarities between musical scores and computer code; mentioning bach.

for anyone not already familiar with all of the above, well worth a read.

Anonymous said...

Ultimately all you can really say is that both programming and music making have rules, and both use a special code for the communication and preservation of an idea or process. But this is fundamentally similar to a variety of professions.