Writing a song is a lot like writing a computer program. They both require clever management of control flow. The simplest sheet music reads as a straightforward top-to-bottom list of instructions. You start on measure one and read through to the end sequentially. That’s fine unless the music is very repetitive, which most popular music is. The loop is the basic compositional unit of nearly every song you could dance to.
Loops are easy to remember, but it’s tedious to write the same passage over and over. You can save yourself a lot of laborious writing by using repeat markers. They’re like the GOTO instruction in BASIC. Here are the first four bars of “Chameleon” by Herbie Hancock.
This four-bar phrase repeats dozens if not hundreds of times over the course of the song. You wouldn’t want to write them all out. With repeat markers, you don’t have to. The repeat markers are the things on the ends that look like brackets with two little dots inside them. When you get to the closing repeat marker at the end of the passage, you jump to the opening repeat marker.
By default, repeat markers tell you to just play the repeated section once. You can also specify any number of multiple repeats. For “Chameleon”, that wouldn’t help much, because if you said repeat 128 or 256 times, no musicians could count that high. For open-ended music like funk, you’re better of writing “repeat until cue,” and leave it to the performer how many repeats there are.
Repeat markers give sheet music the topology of a clock face. Here’s how you hear the Chameleon loop, read clockwise:
Western music notation also includes more complex repeats, with different conditional instructions waiting for you depending on whether it’s your first, second or third pass. Repeats get combined with special jump instructions like DC, short for Da Capo, “to the head.” DC tells the performer to jump to the beginning of the piece. Coda, “tail”, means jump to the ending.
Through clever use of repeat markers and jumps, you can fit elaborately complex musical scores onto a sheet or two of paper, which is very convenient if you’re playing an instrument that makes it hard to turn pages in mid-flight. But even with its repeats and jumps, European classical music is mostly linear. The scores can be expanded into single rows of measures like a chain of paper clips. Open-ended loops, the ones marked “repeat until cue”, are another story. A linear expansion of a piece containing open-ended loops will be different for every performance. Who knows how many paper clips you’ll wind up with in your chain?
Many people dislike America for its foreign policy and basic value system. But it’s hard to find people who don’t like American popular music. Why? I think it’s because it’s such a mutt. It’s European, African, Caribbean and Latin American and so on, all blended together. European classical music can get boring because it isn’t repetitive enough. Outside of western Europe, open-ended repetition is the central organizational element of music. We in America have been wise to pay attention to this lesson. Jazz, country, rock, funk hip-hop and dance music of all description use some form of “repeat until cue” in almost every song.
James Brown in particular was a master of open-ended loops. Usually bandleaders take the musicians in and out of loops through hand signals or eye contact, but James Brown’s shouted instructions to his band were a key element of his music. In “(Get Up I Feel Like Being A) Sex Machine,” as the band loops on the main E thirteenth chord riff, James Brown and Bobby Byrd debate whether it’s time to take it to the bridge:
James Brown: Bobby! Should I take ‘em to the bridge?
Bobby Byrd: Go ahead!
James Brown: Take ‘em on to the bridge!
Bobby Byrd: Take ‘em to the bridge!
James Brown: Should I take ‘em to the bridge?
Bobby Byrd: Yeah!
James Brown: Take ‘em to the bridge?
Bobby Byrd: Go ahead!
James Brown: Hit me now!
The band turns a tight corner into a loop on A ninth. They play that loop until James Brown orders them back to the main part. At the end of the song comes another debate:
JB: Can we hit it like we did one more time, from the top? Can we hit like that one more time?
BB: One more time!
JB: One more time, let’s hit it and quit!
BB: Go ahead!
JB: Can we hit it and quit?
BB: Yeah!
JB: Can we hit it and quit?
BB: Yeah!
JB: Can we hit it and quit?
BB: Yeah!
JB: Hit it!
Loops are easy to memorize, but not so easy to perform. It takes deep concentration to play James Brown songs. Musicians trained in the Western classical tradition often find reading through a complex linear score to be easier than sustaining an open-ended groove.
Electronic instruments, on the other hand, make looping a breeze. Once you have a drum machine pattern, sample or MIDI sequence set up, you can loop it effortlessly and endlessly. The effort comes in breaking the symmetry, deciding how long the loop should play, when parts should enter or exit. My friend Josh Koppel likes to use the phrase “a digital thing in analog form.” In the hands of James Brown, his band functioned as an analog loop and sample player, one that could improvise to boot.
The computer science equivalent of “repeat until cue” is the for loop, also known as the if-then loop. Instead of explicitly telling the computer how many times to repeat a given instruction, you can have it keep repeating until some condition is met. Let’s say you want the computer to list every number from one to ten thousand. Here’s one way to do it in pseudocode – the second to last statements is the if-then loop.
Input starts at zero.
Input plus one equals output.
Print output to screen.
If output is less than ten thousand, then take output as the new input and repeat.
If output equals ten thousand, then end.
Using a few if-then loops, you can generate huge or even infinite amounts of complexity from very short programs. Fractals like the Mandelbrot set are generated using just a few simple loops.
Computers need to be told explicitly when and how to terminate their loops. Otherwise, they go around and around forever, a condition you experience as a crash. Humans are smarter in this regard: when told to repeat forever, we eventually get bored and stop.

Post a Comment