MusicWords Logo

Here's a Little Number I'd Like to Play for You...

If you're sitting close to the stage, sooner or later you'll hear the bandleader start a tune by counting it off: "One, two, three, four...." That may not seem like an "aha!" moment, but I'll tell you something -- painters don't count off their paintings. Novelists don't count off their novels. The close relationship between music and mathematics is unique, and speaks volumes about how we perceive music. It also helps explain why computers have quickly become so important in the creative process of so many musicians.

The basis of music is rhythm. But rhythm isn't just a monotonous boom-boom-boom. It's more like boom-bidda-boomity-boom-(wait...)-ba-boom. As we listen to music, we notice the patterns. When a pattern repeats, we recognize it because we've heard it before. When it changes, we recognize the changes by comparing them mentally to the earlier version. The ability of the human brain to recognize patterns is the basis for almost all music, from Barry Manilow to the Sex Pistols. Indeed, you could make a good case that if pattern recognition weren't a fun game for hominid brains to play, music itself would never have come into existence.

You'll note that I said "almost all music." In the mid-20th Century, a few composers, most notably John Cage, started creating music that was deliberately devoid of repeating patterns. This outraged a lot of people. In any event, it proved not to be the wave of the future. Today even classical music has moved firmly back into the "play the tune three times so they won't forget it" camp.

Some of the earliest uses of computers in music involved generating a musical score with the computer, the score then being performed by traditional instruments. (It would be another 20 years before the computer itself could generate even simple tones in real time, thus becoming an instrument in its own right.) The Illiac Suite for string quartet, generally credited as the first such work, was composed in 1957 by Lejaren Hiller and Leonard Isaacson using the ILLIAC computer at the University of Illinois. Basically, they used the computer to generate long strings of random numbers and then decided which numbers to use for the melody and which numbers to skip, based on certain rules -- the melody had to start and end on Middle C, certain leaps from one pitch to another were forbidden, and so on.

This was the beginning of what today is called algorithmic composition. In algorithmic composition, the composer develops a computer algorithm that describes how notes will be generated. The composer then presses a button and sits back and waits while the computer churns out the music. There are often elements of randomness in the results, but the idea is to constrain the computer's random number generator with an algorithm that produces recognizable patterns. If the patterns are not only recognizable but pleasing to human listeners, so much the better.

The birth of MIDI in 1983 gave a big boost to algorithmic composition. For the first time it was possible to write a computer program that would play a conventional synthesizer in real time. Joel Chadabe's MIDI generator software, called M, was distributed for a while by a now-defunct company called Dr. T's Music Software, as was Jim Johnson's wonderful Tunesmith. Dr. T (Emile Tobenfeld) had his own visionary ideas about MIDI-based algorithmic composition. Unfortunately, his platform of choice was the Atari ST computer; niether Tobenfeld's code nor Johnson's has never been ported to MS-DOS, much less to Windows or the MacOS.

Miller Puckette's work at IRCAM has had a more lasting impact. In the mid-'80s, Puckette developed a program for the Macintosh called Max. Max was revolutionary in two senses. First, it not only generated MIDI music algorithmically, it processed incoming MIDI data in real time and retransmitted it within a few milliseconds, thereby opening up a host of new possibilities for electronic music performance. Second, Max was (and is) a graphic programming language, designed to be friendly and easy for non-technically-minded musicians to deal with. Programming in Max involves placing little boxes on the screen and connecting them to one another with the mouse using virtual "patch cords."

As sexy as this concept is, it doesn't actually make programming much easier, once you get beyond the most basic level. There are times when I waste half an hour figuring out how to create a graphic hookup among four or five obscure objects to do something I could do in 30 seconds with a few lines of old-fashioned typed-in code.

Maintained today by David Zicarelli and sold by his company Cycling '74, Max has been expanded to include audio synthesis and processing. It's a full-featured, high-end music programming environment that can handle anything from algorithmic composition to hip-hop drumbeats. Cycling '74 also distributes M, by the way.

Until the fall of 2003, Max was a Macintosh-only program. The Windows version, I'm happy to report, has finally been released. There are other options for PC users. Puckette supports and distributes a freeware version of a very similar program called Pd, which runs under MS-DOS, Linux, MacOS, and some other operating systems.

I've also spent some quality time with a powerful freeware music language called Csound. First developed in the '60s by Max Mathews and Barry Vercoe, Csound is not graphic-based: Both instruments and the score that plays them are created by typing code. Csound is capable of making an incredible range of musical tones, and is well supported by a user community. In case you still think I'm blowing smoke about the whole music/math connection, I've found that Microsoft Excel is an excellent "front end" for composing in Csound.

Another wonderful program that hovers in the gray area between music and computer programming is Native Instruments Reaktor. Available for both Windows and the Mac (and it's commercial software, not freeware), Reaktor is primarily a "synthesizer builder's toolkit." Standard synth components, such as oscillators and filters, are provided. As in Max, you connect them to one another with graphic patch cords. And as in Max, your hookup will grow to include not only the high-level components but also a host of math-oriented widgets -- adders, multipliers, logic testers, constants, and all the rest.

Music tools of this sort will always be a specialty item: The average musician can get results faster, and with less effort, using preconfigured off-the-shelf software. But the college undergrads who are studying Csound and Max today will be tomorrow's developers. From software tools to developers to musicians to listeners -- it's all mathematical patterns, every step of the way.

Except where noted, all contents of MusicWords.net are (c) 2006 Jim Aikin.
All rights reserved, including reprint and electronic distribution rights.