Page  00000001 FREEDOM WITHIN STRUCTURAL CONSTRAINTS IN THE DARKRIDE COMPOSITION HARRICAN DAY Robert England Rhodes College Department of Mathematics and Computer Science ABSTRACT The immediate goal of the DarkRide music software project is to develop a self-contained computer application in C++ that allows composers to generate original, incompletely specified, pattern-based compositions. A piece of music composed with DarkRide may consist purely of a hierarchy of programmed indications of musical elements such as melodic and harmonic structures, rhythmic motifs, and dynamics indications, without specifying any particular notes or chords. For subsequent performance, an abstract composition programmed using DarkRide is instantiated, or filled in with actual notes, and written out as a Standard MIDI File. Because these compositions specify musical structure alone rather than actual notes, it is possible that each instantiation of a DarkRide composition is unique. This paper presents the first complete composition programmed using DarkRide, Harrican Day. 1. INTRODUCTION In a typical DarkRide composition, a composer abstractly specifies how musical structures will develop around a main row that is freely or randomly generated per performance, where a main row is defined here as any sequence of tones. Thus, DarkRide seeks to allow for an infinite variety of realizations of a composition without completely relinquishing control to chance: All melodic and harmonic indeterminacy is resolved in a DarkRide composition before an actual performance of the piece occurs. The composition engine component of the DarkRide system provides object types to represent fundamental musical constructs such as chords and melodies, plus an extensive collection of functions that generate and manipulate patterns constructed from these objects. Several more general computer music environments exist that support a broad range of compositional styles and objectives --- perhaps most notably Nyquist [2] and Common Music [6]. Much related work in algorithmic composition has already been completed. In an important computer music survey article, Roads [5] described constraint representation models of music, which are able to "(Oill in the blanks' from a partial description of an object.O The DarkRide environment is designed around such a model. Work in the development of other objectoriented programming tools for high level composition based on pitch classes has been reported by Castine [1]. Formal grammars that represent musical structure have been described recently in [3] and [4]. These few examples represent only a brief overview of related work and are not intended to be exhaustive. 2. TEMPLATE COMPOSITIONS A DarkRide template composition is analogous to a written form document with blanks to be filled in. To perform a template composition, the corresponding DarkRide template program is run, and this program fills in the blanks of the template composition with actual notes. This filled-in form is called an instantiation of the template composition. An instantiation thus provides an audible surface on top of the underlying musical structure defined in a template composition. Notably, the blanks representing individual notes in a template composition may be filled in with different notes each time a template composition is instantiated. Depending on the implementation of a specific template composition, notes for the blanks in the composition may be chosen according to some computer algorithm selected by the composer, or they may be chosen purely at random, introducing an aspect of indeterminacy to an otherwise fully specified composition. A key feature of the DarkRide software is that it allows a composer to define musical structures of a piece in terms of previously defined musical structures of the same piece very easily. For example, because of this feature, in the Harrican Day composition described below, only one row of eleven notes must be chosen in order to fully specify an instantiation --- all melodies, harmonies, and remaining musical structures in the composition are defined upon this one row and its permutations. How this is done is illustrated in the next section. 3. SPECIAL DARKRIDE FUNCTIONS In addition to the basic object types such as Note and Tone Row, DarkRide also provides a variety of functions that operate on these objects. For example, the slice function allows a composer to generate a new chord sequence from an existing chord sequence by selecting chords from the sequence at uniform positional intervals. In its simplest or default use, a composer would provide some chord sequence object, say S 1, and some positive integer N to the slice function, and then the slice function would create and return a new chord sequence object S2, where S2 is constructed by taking

Page  00000002 every Nth chord of sequence S 1. For example, if the chords of the original sequence S1 are represented as Si: A B C D E F G H I J K and N is 5, then the slice function would generate a new chord sequence by taking every fifth chord of this sequence, wrapping around at the end of the of the original sequence: A B C D E F G H I J K A B C D E F G H I J K... A F K E J... The result of this operation would then be: S2: A F K E J D I C H B G Observe that when using this technique of selecting every fifth chord, or every third, or every ninth, etc., of an eleven chord sequence, the result will be another chord sequence of eleven chords. In fact, whenever N and the length of the original chord sequence are relatively prime, the slice function will generate a new chord sequence that has the same length as the original sequence. Many of the special compositional functions in DarkRide have several variants or overloads to allow the composer to assume a greater degree of control over the behavior of these functions. For example, the slice function described above could alternatively be invoked with either a chord sequence or a tone row and two positive integers, say NI and N2, rather than just a single integer. In this case, the slice function would create a new chord sequence or tone row with elements that match up positionally with the original sequence in the ratio NI against N2. For example, given an initial tone row RI = A B C D E and the relationship 3 against 4, the slice function will produce the new row R2 = A C E B D, which is the permutation of row RI in which every fourth tone matches every third tone of the original row RI: R1: A B C D E A B C D E... R2: A C E B D A C E B D A C E... The slice function and its variations are used extensively throughout the experimental DarkRide template composition Harrican Day. 4. AN EXAMPLE DARKRIDE COMPOSITION: HARRICAN DAY To illustrate the use and results of some of the special compositional tools available in DarkRide, two different instantiations of a single musical passage from the template composition Harrican Day are shown below. This composition was written for computer-driven player piano, but parameters are set within the Harrican Day template program to allow for the possibility of performance by a human pianist: All phrases in Harrican Day are associated with either a left hand part or a right hand part, and neither of these parts contains a reach larger than an octave. Harrican Day is the first of a planned series of benchmark DarkRide template compositions. These compositions are intended to demonstrate capabilities of the DarkRide software as the project progresses. Source code for DarkRide and these compositions will be made publicly and freely available on the Web as new versions of the software are developed. All musical structures in Harrican Day are based on an abstract tone row object of eleven pitch class names called the main row. The pitch classes that appear in the main row are chosen at program run time either by the composer or at random. (It is easier for a listener to hear the different melodic patterns if a different pitch class is chosen for each of the eleven main row elements, but this is not a requirement.) An example of the default instantiation of a main row is shown in Figure 1. The pitch classes of the main row are associated with index numbers zero through ten corresponding to their positions within the main row sequence. For example, the third value in any main row will always have index number 2, but for the Harrican Day instantiation based on the main row shown in Figure 1, this third element has pitch name "D.0 Figure 1. Eleven note main row. Using the original main row sequence, four other eleven element sequences are generated by selecting every third element, every fourth element, every fifth element, and every ninth element of this original sequence, with wraparound, using the slice composition function described earlier. This collection of five tone rows is particularly wellsuited to combinations in musical passages that involve polyrhythms, such as three-four time against four-four time, but where simultaneous notes in the different rows are the same, as illustrated by the rows RI and R2 described in the previous section. The following C++ code example illustrates how functions of the main row are used in Harrican Day to compose performable musical passages with precisely controlled relationships to the main row or to permutations of the main row. 4.1. A Code Example The excerpt of C++ code shown here demonstrates the use of DarkRide object types and functions. It generates a melody for the right-hand part of a section of Harrican Day. All functions called in this code example are part of the DarkRide programming library. For the purpose of this discussion, suppose that the main row illustrated in Figure 1 is used as the basis for the current

Page  00000003 instantiation. /7 right hand melody, section 10 Chord cdRight= Maj orTriad (mainRow [0] + int (OCTAVE)); ChordSeq csRight= ChordSeq(mainRow, mainRowSize). slice (5). matchShape (cdRight). alignAcross (cdRight); Motif mtRight(t.half(), 3); PhrasePattern ppRight (csRight. select ("2"), mtRight); Phrase pRight = Phrase(ppRight).tie(0); PhrasePattern ppRight (csRight select (121!), mtRight); This code sequence starts by creating a chord object named cdRight and defining it to be a major triad based on the first note of the main row of notes, raised an octave from what would ordinarily have been its default location on the keyboard. This chord is shown in Figure Figure 2. Major triad built on the first note of the main row. Next, a chord sequence object named csRight is built around a permutation of the entire eleven note main row. The permuted row of notes used for this sequence is obtained by calling the DarkRide slice function to select every fifth note of the original main row, wrapping around at the end of the main row. The default instantiation of the new row that results is shown in Figure 3. 99-F~F Figure 3. Row 2, derived from the main row of Figure 1. After the new row is defined, the matchShape function uses the sequence of eleven notes to generate a performable sequence of eleven major triads by matching the shape of chord object cdRight. The result is shown in Figure 4. Figure 4. Sequence of major triads built on row 2. Accidentals apply only to the immediately following note. The call to DarkRide function alignAcross then inverts each chord of sequence csRight up or down to its inversion that is nearest to the chord cdRight on the keyboard, as shown in Figure 5. ~ I Figure 5. Aligned chord sequence. Although these f~igures show a step-wise, incremental development of an aligned chord sequence, all of the functions used are applied to an anonymous object at the time of construction of that object. In other words, only the f~inal, fully developed chord sequence shown in Figure 5 is ever stored as a named object in this program. This saves space, increases simplicity, and relieves a possible source of inconsistency among incompletely specified objects. In the next statement of the code excerpt, the motif object mtRight is defined to be a simple rhythmic pattern of three consecutive half note durations. Unlike in traditional musical usage where a motif may comprise both rhythmic and melodic elements, a motijf object in DarkRide is an object that defines a pattern of rhythm alone. To obtain the duration of a half note, the ha/f member function is invoked on object t --- a unique object of the DarkRide type time frame. (The duration value will be some number of MIDI clock ticks, but this number is not relevant to the compositional process at the level of abstraction represented by this code excerpt, which is why such technical calculations and details are hidden within the separate, special purpose object of type time frame.) The remaining two statements of the code example use the chord sequence csRight and the motif mtRight to generate the melody for this section of the composition. An abstract phrase pattern object named ppRight is created by applying the mtRight motif object to the highest note of each triad (note 2, out of notes 0, 1, and 2) in the csRight chord sequence object. The first several measures of the melody defined by this phrase pattern are shown in Figure 6.:s::::::::::::::::::::::: Figure 6. Phrase pattern based on the chord sequence of Figure 5. Finally, a performable phrase object is created from the abstract phrase pattern object, tying notes among consecutive chords whenever the notes are the same. The f~irst few measures of this final melody are shown in Figure 7.

Page  00000004 Figure 7. Final, performable melody. Other code that follows exactly the same melody-based, rhythmic pattern design appears in several sections of Harrican Day. This repetition of code leads to a recurrent and recognizable rhythmic character for each different instantiation of the piece: The places where notes are tied will differ among different instantiations of these parts of the template composition because of the different sequences of chords that will appear, resulting in a variety of different melodic and rhythmic personalities. Figure 8 shows the first few measures from the full instantiation produced by this code excerpt based on the main row of Figure 1. The left-hand accompaniment part was also constructed by applying DarkRide functions to motifs and chord sequences based on the main row of Figure 1.:,i:A ^:~i~ ~^..^^d...^.................... -- - - -- - - ---...................:g....i................................................ i ~~~~: ~~~~~ ~~~~~~ ~~.............~~;........................................................................................................................ L~~~ ~~~~~~~~~: ~rr ~.........................~~~~~............................................................................................................................................... l p!; ^ ^ rD '^' 1 H:.....................,........^ ^....................^.... liiiiiiiliii^ ^"............................~;~.....................................................~~~~~~~................:W' ^.................................................................................... ~' p~~............................~...................................... ~~ ~~~~~~* X......~................: '".................~-, ~~~~........................ ~~ ~~~~~ The differences between these two instantiations of the same passage clearly illustrate the variety of melodic and rhythmic flavors possible using purely structural specification of music with the DarkRide system. 4.2. Listening to a DarkRide Template Composition Just as a three-dimensional human face cannot be perceived fully and accurately from a single twodimensional photograph, the musical structure embodied in a template composition such as Harrican Day is not fully revealed by listening to a single performance of the composition. After hearing several different instantiations, the listener will notice both strong similarities and clear differences among the pieces generated from the one template. Over time, the listener gradually discovers what structural music patterns hold true for the template composition in general but which would not be apparent after hearing just one instantiation. New instantiations begin to take on a strange familiarity at first hearing, even when the current instantiation of the piece has never been heard before. 5. FUTURE WORK Work continues on the DarkRide composition engine to include additional basic object types such as traditional cadences and standard embellishment devices such as turns and trills. The next major phase will be the incorporation of a more complete formal music grammar based on the seminal ideas of Lerdahl and Jackendoff [4] which will facilitate a much more abstract method of structural specification for a composition. 6. REFERENCES [1] Castine, P. 1994. Set Theory Objects. Frankfurt, Germany: Peter Lang. [2] Dannenberg, R. B. 1997. "The Implementation of Nyquist, A Sound Synthesis Language.O Computer Music Journal 21(3): 71-82. [3] Hirata, K., and T. Aoyagi. 2003. "Computational Music Representation Based on the Generative Theory of Tonal Music and the Deductive ObjectOriented Database.O Computer Music Journal 27(3):73-89. [4] Lerdahl, F., and R. Jackendoff. 1983. A Generative Theory of Tonal Music. Cambridge, Massachusetts: MIT Press. [5] Roads, C. 1985. "Research in Music and Artificial Intelligence.OACM Computing Surveys 17(2): 163 -190. [6] Taube, H. 1997. "An Introduction to Common Music.OComputer Music Journal 21(1): 29-34. ~ H..........C....::-............... ~ ~ ~~ ~ ~~~....... iC...................... Figure 8. Performable passage from Harrican Day. Figure 9 shows a different instantiation generated by exactly the same code excerpt but when the main row is different; i.e., same program, different data. Ss...'..~........................................................ -- giliil.------t-^---- ~ll.S, ~ s. ^.................,.....................................................................:........................................................................... ^1-- I-------------------.....:.......................................................................... -- Y~-------------.......----------- --~----------.............. ssss ^^i^^:::::::" ^2"............................................................... ' L...........................^^.E..........::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ~ Y;...:i......................:~...........~..............-............................................................................, - -.................... i i! ...................... i'! i...................................... i i......................................... i ii.....~jl"''.......!"^ Figure 9. Different instantiation of the same Harrican Day passage.