Using Binary Numbers in Music: Vi Hart Music Department Stony Brook University Stony Brook, NY, USA
Using Binary Numbers in Music: Vi Hart Music Department Stony Brook University Stony Brook, NY, USA
Using Binary Numbers in Music: Vi Hart Music Department Stony Brook University Stony Brook, NY, USA
Vi Hart Music Department Stony Brook University Stony Brook, NY, USA E-mail: vi@vihart.com Abstract
Composing using binary numbers as rhythms can create music that is both interesting and accessible. I shall demonstrate, using whimsical examples, that binary numbers and music can indeed live in harmony.
Binary Numbers as Rhythm. Let 1 be a note and 0 be a rest. Thus a number becomes a rhythm! The numbers one through eight, in binary, are shown in Figure 0. Below each number is the corresponding rhythm. In computer science, binary numbers are usually seen in groups of eight bits (a byte), which happens to fit perfectly into a 4/4 measure if we assign bits to eighth notes. Powers of two are involved in the usual form of western music, where four or eight bar phrases might make up a 16 measure section of a 64 measure song. This creates a constraint on the rhythm, but leaves the composer free to choose the melody.
Figure 0: Binary numbers 1-8 above corresponding rhythms. Ways to use Binary Numbers as Rhythms
ASCII Code. There is a computer standard, ASCII, for encoding data into binary. Every letter of the alphabet (as well as other characters) has a corresponding 8 bit ASCII code. While mathematically arbitrary, it is a natural encoding for people familiar with Computer Science. This means that one measure can encode one letter (if youre using eighth notes). Figure 1 shows a self-referential string quartet where each instrument plays the letters of its name as the rhythm. The code for each lowercase letter used begins with 011, and the following five digits are the position of the letter in the alphabet. Lowercase a, then, is 01100001. The melody is unconstrained. If one heard the segment without knowing there was any math behind the rhythms, one would still hear how each measure starts the same way and how the violin and viola play the same rhythm for the first four measures. Even when not consciously noted, patterns make a piece cohesive. A random string of ones and zeroes would not have nearly as nice an effect.
Figure 1: A string quartet where each instrument plays its own name in ASCII.
This is a great way to hide secret messages and suggests various types of musical steganography. Famous examples are the motives which Bach and Shostakovich used to sign their name, Bach with the notes BACH (Bb A C B), and Shostakovich with his initials: DSCH (D Eb C B). The German system of note names uses B rather than Bb, and H instead of B. Using Eb to represent S is a precedent created by Shostakovich, which I follow in Figure 2. Brahms, Schumann, Elgar, Berg, and others have also used the letter names of pitches to sign or dedicate their work. The technique of encoding binary into music improves upon this, allowing messages of any length and with any letter. Of course, both techniques could be used at once. As seen in Figure 2, which is a section of a longer piece, I hide a name within the notes of a lyrical melody, while the rhythm of the chords spell it in ASCII. Also note that instead of 1 meaning play and 0 meaning rest, a 0 means hold the previous note, to allow a more lyrical melody.
Figure 2: sasha is hidden in both note names and rhythm. Equations. One can add numbers by making an equation where a number played by one instrument, plus a number played by a second instrument, equal a number played by both together, as seen in Figure 3. It shows the creation of the Fibonacci sequence by adding previous terms to get new ones. Each eighth beat represents a 0 or 1. A 1 must start a note but it may be held over any number of 0s, and all other 0s are rests. Because previous terms are used again in addition, there is a structure to the form. The numbers grow from beginning to end of the piece, and so the trend is an increasing number of ones with earlier entries, making the piece gain momentum and excitement as it progresses. The beginning of the Fibonacci sequence can also be found hidden in the piano part, where middle C is 1, D is 2, E is 3, G is 5, and so on.
Fractional Binary Numbers. Binary numbers with fractional parts have an additional problem: how to indicate the binary point. One could use bar lines or a musical cue, such as having all the bits played in a different range or by a different instrument. In the following example (Figure 4), has been turned into music. The first two bits which make up three (binary 11) are a pickup, and from the first measure onwards the violin and flute play the non-repeating bits for, in theory, an infinitely long piece (unfortunately this example only shows four measures of it). Also new in this segment is that both instruments play the same number, with the flute sounding on ones and the violin on zeroes. While is functionally a random number generator, the compositional choices made using this random number are very specific to this number, and a different number (such as e) could lead the composer to an altogether different piece. When notes skip back and forth between two voices, one must be careful to give shape to the groups of notes which are together (as in the end of the first measure in the flute) and keep the music from sounding too jumpy when the parts are very disjoint (such as in the second measure). It is not merely a matter of writing a single melody and then separating it out into two voices.
References
[1] [2] [3] [4] Hofstadter, Douglas R. Gdel, Escher, Bach: An Eternal Golden Braid. New York: Basic, 1979. Gardner, Martin. Penrose Tiles to Trapdoor Ciphers. New York: W H Freeman, 1989. Burkholder, J. Peter, et al. A History of Western Music. New York: W.W. Norton & Co., 2006. Cross, Jonathan. Composing with numbers: sets, rows, and magic squares. In Music and Mathematics. Fauvel, John, et al. Oxford: University Press, 2003. [5] Hart, Vi. http://vihart.com/bridges2008 [6] Online Encyclopedia of Integer Sequences: http://www.research.att.com/~njas/sequences/index.html [7] Rothstein, Edward. Emblems of Mind. New York: Avon Books, 1995.