computation [0]

computation[0]: algorithmic thoughts of the electric brain

for amplified orchestra (2015-2016), 11’07”
instrumentation: 2222/4231/timp/1perc/strings

to Philharmonia Northwest, Julia Tai, conductor

Program note:

Computation is the engine that powers the information age. This piece attempts to offer a glimpse inside some real-world algorithms, a sort of window into the “thoughts” of a computer. It reflects my fascination with music’s astounding ability to express abstract thought. Some of the algorithms you’ll hear are critical building blocks of a staggeringly huge amount of modern software and are being executed by an equally staggering number of computers right now… and indeed every second of every day.

The primary through-line in this piece is sorting. There are four main sections. Each takes a repeating fragment and uses the specified algorithm to sort it. Every pattern gets sorted by pitch, from low to high (or from high to low). Some also get sorted by rhythm, from shorter to longer (or longer to shorter) values. If you listen closely, you may be able to hear notes switching places in the pattern—this is the algorithm at work! All these algorithms are interchangeable, of course, in that given the same input, each would arrive at the same result. The fun, I think, is in listening to the diverse ways they get there:

[0]: bubble_sort ( “con brio” )

Bubble sort starts by examining the first pair of elements (in this case, the first and second notes), switching their order if the first is larger (higher). Then it does the same with the second pair (second and third notes), then the third pair (third and fourth)… When it reaches the end of the pattern, the largest value will now be in place at the end. Then it starts over with the first pair and goes through the same process again, at the end of which the second-largest value will be in place second from the end. And so on.

[1]: selection_sort ( “ritmico” )

Selection sort looks through the pattern, finds the lowest value (lowest note), and puts it in place at the beginning by switching it with the first note. Then it looks for the second lowest value (note) and switches it with the second note. And so on. That’s the front-to-back version; it can also do the same thing going back-to-front. Listen for both versions!

[2]: insertion_sort ( “espressivo” )

Insertion sort at each stage focuses its attention on a single position in the pattern. It scans each prior position in turn, compares the value it finds there with that under its “pointer,” and switches them if the latter is smaller. By the time it finishes with the given position (and moves on to the next position), no larger values will appear to the left of the pointer. The sorting here forms a backdrop to a duet for cello and bassoon.

[3]: merge_sort ( “agitato” )

Merge sort, by far the most efficient of the sorting algorithms heard here (and therefore much used in real-world applications), adopts a divide and conquer approach. It splits the full pattern in half. Then it splits each half in half. It continues to do this until it’s produced a pair of fragments of one element each. It weaves these fragments back together, sorting them in the process. Then it splits the next chunk into one-element fragments and weaves them back together in sorted order. Then it weaves these two pairs together. And so on. Musically, I split and then reassemble the pattern while also splitting and reassembling sections of the orchestra.

In addition to the sorting algorithms, computation[0] also uses a few other bits of logic. Perlin noise, an algorithm invented to produce surface textures for the 1982 Disney movie Tron and still used extensively in computer graphics, plays a large role in the piece, sometimes determining the number of repeats of a given pattern, other times governing the rhythm/durations of a melodic line. You may also hear arithmetic sequences (like 1, 2, 3, 4, 5, 6, …), prime number sequences (2, 3, 5, 7, 11, …), and more. It’s not all bloodless processes, though—there’s plenty of the author’s personality in this music as well.

Of course, it’s perfectly fine if you don’t follow the algorithms while listening. Though one of my aims was to make these algorithms discernible and comprehensible, another equally important aim was to write a piece that would be enjoyable however one chooses to listen to it.