Ivars Peterson's MathTrek

January 6, 2003

Sound-Byte Math Music

Ivars Peterson's MathTrek

The decimal digits of the mathematical constant pi, 3.14159265. . ., ring out an intricate melody that sounds vaguely medieval. Those of the constant e, 2.718281828. . ., progress at a relentless, suspenseful pace. Euler's prime-number-powered phi function bounces about with a semitropical rhythm. Lorenz's butterfly meanders through a ragged soundscape. Pascal's triangle echoes with an eerie beat.

Lorenz's butterfly.

Created by Swedish composer Daniel Cummerow, these mathematical sound bytes belong to a category known as algorithmic music. Each musical fragment is determined by a mathematical recipe—a formula that links digits with musical notes and their duration, as governed by the musical preferences of the composer.

If you have browser software that can play MIDI (Musical Instrument Digital Interface) files, you can sample Cummerow's compositions at his Web page (http://www.geocities.com/Vienna/9349/). The MIDI specification is often used in computer programs to represent musical notes. It assigns a number to each note on a keyboard: Middle C is 60, C-sharp is 62, and so on, for a total of 128 tones.

Composers of algorithmic music can employ a variety of strategies to achieve interesting results. For example, you could simply convert prime numbers, evenly divisible only by themselves and 1, directly into their corresponding MIDI notes, at least up to 127, to get a curiously rising scale.

There are infinitely many primes and they get larger without limit, however, so you could continue by dividing each prime by a certain number, then use just the remainder—a neat application of modular arithmetic. Adding a constant keeps the corresponding notes within an "accessible" part of the MIDI scale. See Chris K. Caldwell's "Prime Number Listening Guide" (http://www.utm.edu/research/primes/programs/music/listen/) for examples of this sort of transformation.

Instead of mapping digits directly to MIDI numbers, you can also assign them to notes of a specific scale. In one of his pi compositions, Cummerow constructed the piece by assigning each digit from 1 to 8 to a note of the A harmonic minor scale. The digit 0 signaled a pause, and 9 meant either a pause or a repeat of the previous tone. Identical consecutive tones were tied together into a longer note.

In another pi venture, Cummerow used a special musical alphabet formulated by French composer Olivier Messiaen (1908–1992), which extended the German names of the notes, A, B, C, D, E, F, G, H, by giving each letter of the alphabet from A to Z its own pitch, octave, and note value. Cummerow went through the first 255 digits of pi in pairs. If the number were 26 or less, he assigned to that pair of digits the corresponding Messiaen note. If the value exceeded 26, he followed a different recipe.

For a four-part piece featuring the digits of e, Cummerow worked with three-tone chords of the E whole-tone scale. Within an octave, there are 10 ways to construct such a chord. Taken in pairs, the first digit (from 1 to 8) of each pair determined the pitch, and the second digit determined the chord. Also mapped to the E whole-tone scale, his "Prime Numbers Whole Tone Quartet" was determined by prime numbers expressed in base 5.

Pascal's triangle. Start with the number 1 and make it the apex of what will become a triangle of numbers. In the second row, write two 1s. For each subsequent line, add together adjacent numbers of the previous row and write the sums in the new row, then place 1s at both ends of the line. This diagram shows what you get for the first eight rows.

Other recipes led to compositions featuring the Fibonacci sequence, trigonometric functions, Pascal's triangle, and fascinating structures such as the Sierpinski triangle and Lorenz's butterfly, now intimately associated with chaotic dynamics.

Stages in the construction of the fractal structure known as the Sierpinski triangle.

Cummerow is not the only composer to have delved into mathematical music. For example, a number of musicians have played with the fractal notion of self-similarity, in which each smaller piece of a structure is a miniature version of the larger structure. Brazilian composer José Oscar Marques has some interesting examples (see http://www.midiworld.com/c/jmarques.htm).

It all adds up to some intriguing sounds of music.

References:

Peterson, I. 1999. Dancing chaos. MAA Online (Jan. 11).

______. 1998. Prime listening. MAA Online (June 22).

Daniel Cummerow's "The Sound of Mathematics" Web site can be found at http://www.geocities.com/Vienna/9349/.

More pi music and other information about pi can be found at the "Fun with Pi" page at http://www.geocities.com/lady_lizzie/why.html.

Chris K. Caldwell's "Prime Number Listening Guide" is available at http://www.utm.edu/research/primes/programs/music/listen/.

"The Strange Beauty of Fractal Music" by José Oscar Marques can be found at http://www.midiworld.com/c/jmarques.htm.