Computer Synthesis Computer Synthesis of Jazz Improvisation Dhroova Aiylam Massachusetts Academy of Math and Science Abstract In computer synthesis of jazz music, randomly generated notes do not reflect the chord changes upon which they should be based. Furthermore, those systems that do harmonically verify the quality of the music perform harmonic analysis independently of the chords, considering only the intervals between successive notes. The purpose of this project is to design a program that can improvise over and perform harmonic analysis on a jazz melody. Based on the moving tones in the chord changes for a tune, a melodic line of guide tones was established. Music was be interpolated through these guide tones with either discrete tones or scales, based on the available tensions on the chords and the harmonic analysis on the progression. The notes chosen are known to be consonant with the corresponding chord. It was determined that the software written was capable of synthesizing music that both sounded good, adhering to the musical rules by which a solo must abide, and generated music dynamically and in a way which could not be repeated. The final project not only contributes to general knowledge regarding computer applications to synthesis of music, but can also be used as a teaching tool of the jazz style. Introduction Randomly generated music does not always sound good. Most controlled generation of music is somewhat deterministic – it will allow only a certain degree of randomness within its own set of rules, in a way that seldom reflects the original. The goal of this project is to design a computer program that can perform harmonic analysis on a jazz melody and improvise appropriate music over it. The purpose of the project is to explore the applications of computer algorithms to synthesis of original music based on a set of chord changes. Although it is one of the most truly American styles of music, jazz is really a reflection of cultural diversity and individualism of this country. It is made unique by its emphasis on the solo, in which performers invent and play music in real time. Although the music is rooted in the chord changes, there is room for incredible creativity on the part of the performer. Given the nature of the jazz style, applications of computers to synthesis of jazz music abound. Computer reproduction of sheet music is well-established and fairly easy, so the jazz style provides a unique challenge to the engineer in its demand of new and innovative music generated dynamically. There are musical rules which need to be followed, but they are quite comprehensive. If they are properly followed, the resulting music will not only sound harmonious, but will also reflect the music upon which it is based. Computer algorithms that generated music by these rules, then, are very likely to produce melodic music. Furthermore, a computer can check that generated music abides by these rules much more quickly and reliably than a human can. 1 Computer Synthesis Literature Review Music Theory Even more so that other styles of music, jazz is a very theoretical style of music. To completely understand a jazz tune, it is necessary to be able to describe it musically and analyze it harmonically. Only when a soloist has a very deep understanding of the music they play can he even begin to synthesize their own music. Music is, at its most basic, an arrangement of sounds in time. Western, tonal music is based the note, a sound played for a certain duration of time. Notes are differentiated by the pitch they resonate at. Although they are technically arbitrarily many possible pitches, the human ear is essentially unable to distinguish between consecutive notes. While most instruments allow for inflection, sliding between tones and thereby hitting “non-notes” in between, the piano is only capable of playing discrete notes. In an octave, there are 12 different musical notes – C, C#/Db, D, D#/Eb, E, F, F#/Gb, G, G#/Ab, A, A#/Bb, and B. The note C exists in multiple octaves, but its pitch is an integer multiple of the frequency of each other C below it. The range of an instrument consists of some number of octaves – in the case of the piano, there are 8. Music is written on a staff, a set of five lines with four spaces in between. Lines and spaces on the staff correspond to white keys on the piano. The clef, written on the left at the very beginning on the piece, assigns an individual value to lines and spaces. The two most commonly used clefs are the treble (G) and bass (F) clefs. Each fixes its respective note and all the other note positions are uniquely determined. When there is no more room on the staff, it is extended with ledger lines. Music is divided into measures, each of which has a fixed length. Notes in a measure must be additionally described by their duration. A whole note has the longest duration of all. All other notes are determined relative to the whole note – the half note has half its length, the quarter note ¼, and etcetera. Notes of duration less than a quarter note are denoted with flags. Each flag halves the duration. Placing a dot after a note gives it 1 ½ times its normal value. A dotted half note, for example, lasts ¾ as long as a whole note. Rests, breaks in the stream of musical notes, also have time values like notes. Each type of note has a corresponding rest. Generally, however, rests are not dotted. Time is additionally described by a time signature and a tempo. The tempo describes how fast the music is played. This can be either a word (like allegro), or an actual BPM value (200). Notes in a tune can be individually modified as well. A note can be played legato, meaning smoothly, or staccato, meaning choppily. A slur line over a series of notes is used to designate the former; the latter is indicated by a dot beneath the note. Time signature describes the amount and type of notes in a measure. The upper value of a time signature gives the number of notes in a measure, and the lower value gives the type. For example, 4/4 time, by far the most common in jazz and in all music, describes a measure with 4 quarter notes. The question naturally arises – why do 3/4 and 6/8 time exist as two separate entities? The difference is in meter. (Introduction to Music Theory, retrieved October 20th , 2011) 2 Computer Synthesis Meter can be either simple or compound. In simple meter, a beat can be broken down into two notes. In compound meter, the beats are divided into three notes. Odd meter is some combination of the two. Most jazz tunes are in 4/4 or 3/4 time (both simple meter), but some exceptions stand out. Dave Brubeck’s Unsquare Dance is in 7/8 time – odd meter. So is his Take Five. Both are jazz standards, but are clear exceptions. (The Real Book, 2004) Rather than working in terms of notes, most music is conducted in terms of the interval. That way, the music can be transposed (shifted) up or down to yield the same song, just in a different key. A half step is the distance from one key on the keyboard to the next adjacent key. A whole step is the same as two half steps. Nearly all scales, which form the basis of all music, are composed solely of whole and half steps in different combinations. As a result of the way the staff is constructed, it is impossible to play anything other than a white key without adding notation to denote moves by a half step. These are called accidentals. An accidental can be either a sharp (#) or a flat (b), sharps raising the note by a half step and flats lowering them by the same amount. This means that a note can usually be written in many ways. Consider, for example, the note a half step above C. We could write that note as C#, but also as Db. In fact, since sharps and flats allow multiplicity, we could write it as B double sharp or D# double flat. Although these distinctions do not make any difference on their own, they depend on, and are central to, key of the tune. Music is based on scales. The two simplest types of scales are the major scale and the minor scales. To construct the major scale of some note X, simply start X and play whole, whole, half, whole, whole, whole, half, where the intervals stack. This means the X major scale is given by the notes (X, X + 1, X + 2, X + 2.5, X + 3.5, X + 4.5, X + 5.5, X + 6.5) For example, the C major scale is given by the notes C, D, E, F, G, A, B, (C). There are several types of minor scales : the natural minor, harmonic minor, and melodic minor. The natural minor is given by the sequence whole, half, whole, whole, half, whole, whole. The harmonic minor is given by sharping the 7th scale tone of the natural minor. The melodic minor is obtained by raising the 6th and 7th scale tones of the natural minor by a half step. Thus: C natural minor: C, D, Eb, F, G, Ab, Bb, C. C harmonic minor: C, D, Eb, F, G, A, Bb, C. C melodic minor: C, D, Eb, F, G, A, B, C (Miller, 2005). Scales give rise to the next basic musical construct – the notion of key. The key of a tune is the scale upon which the notes of the melody are based. For example, a melody based on the notes C, D, E, F, G, A, B is in the key of C major. A melody based on the notes C, D, Eb, F, G, Ab, Bb is in the key of C minor. For brevity, the sharps and flats are placed once that the beginning of the tune, and are implied on all affected notes throughout. This is the key signature. Because there are no sharps or flats in the key C major, there is no key signature. C minor has 3 flats – E, A, and B. Thus, the three flats are placed on the corresponding lines and spaces at the very beginning of the tune, and are implied everywhere else unless otherwise stated. There are a total of 15 major key signatures and 15 minor ones (Humphries, 2007). 3 Computer Synthesis Figure 1. Major Keys. The 15 major keys in music are uniquely determined by their key signature, which can range from 7 flats to 7 sharps (“Key and Intervals”, n.d.). Figure 2. Minor keys. The 15 minor keys in music are uniquely determined by their key signature, which can range from 7 flats to 7 sharps. Each has a relative major, which is the major key of the same signature, and a parallel major, which is the major key of the same tonic (“Key and Intervals”, n.d.). Scales are also the root of the most fundamental concept in jazz and in most music : the chord. A chord is a collection of notes of specific degree in a scale. Playing all these notes at once is playing the chord. For example, the major chord is built on the root (1st tone), 3rd (tone) and 5th of the major scale. The C major chord comprises the notes C, E, G. The minor chord is built on the root, 3rd and 5th of the minor scale. The C minor chord comprises of the notes C, Eb, G. (Humphries, 2007) 4 Computer Synthesis The major and minor chords are the only two popular three note chords. Most chords, especially in jazz, are four note chords. The most popular chord four note chords are shown in Figure 3. Figure 3. Four note chords. Most jazz chords are four note chords. The basic, major 7 four note chord consists of the root, third, fifth, and seventh. Accidentals and substitutions on these tones give different four note chords like the ones above. (“Key and Intervals”, n.d.). Construction of a Solo and Melodic Rules for Soloing Harmonic analysis of a tune exists on several levels. From small to large, there is the melodic movement over an individual chord, the transitions between chords change, net harmonic movement over a chord progression (ii – V – I, for example), and the moving tones throughout the tune as a whole. For any melody or solo to “sound good” over a set of chord changes, they must abide by a number of rules. All the necessary theory is based on the key of the tune. Firstly, the solo must mimic general melodic motion, the largest level of harmonic detail. The chords “pull the ear” in a certain direction, and a solo trying to go in a completely different direction will clash with the chord progression. Furthermore, there must be some melodic continuity or unity that ties the whole solo together, lest it be a collection of random licks. Repeated phrases and patterns achieve this end. However, one must strike a balance between unity and creativity – the solo cannot be too repetitive. Any music so generated, however, is grounded in the melodic motion (Personal Communication, November 28th, 2011). General melodic motion can be described at several levels. The most simple of these is a bass-line, which can be as simple as just the root of the chord, or more detailed, like walking bass. The bass-line, when combined with the guide tones, is usually a good skeleton for melodic movement. Guide tones, which are usually the moving tones, are the 3rd and 7th of each chord. Chords in jazz are 4-tone chords as opposed to triads, so each chord consists of a root, a third, a fifth, and a seventh. Depending on the chord, different accidentals are applied. The third and seventh of a chord solidify its harmonic identity, but with the root the chord is all but spelled out. The melody is also an adequate indicator of melodic motion. We know the melody sounds good against the changes by default. Thus, quoting the melody, playing small, perhaps articulated fragments of the melody in the solo, constitute a good starting point for a solo. 5 Computer Synthesis Furthermore, harmonies on the melody, like some of the alternate instrument parts and alternate left hand lines, are ready-made to function over the changes. As with the bass-line, one can never go wrong. The next largest level of detail is the individual chord progression. Recognizing these is fairly easy if you look. Some popular jazz progressions are depicted in Figure 4: Figure 4. Popular chord progressions. Although there are many variations, most if not all make use of the ii-V-(I) progression (“Popular Chord Changes”, n.d.). and others. All standard jazz tunes, however, makes use of the ii – V – I progression. Its importance and frequency in the jazz style cannot be overemphasized. It is important that a soloist is aware of lines that sound good over common progressions like this one, so that all they need do is modulate when playing in a different key. It is usually possible to solo over a common chord progression with just a scale or two because of the close musical relationship the chords have to one another. Moving tones usually move stepwise within the group of chords, so chord voicings and moving tones are greatly simplified (Tomassetti, 2003). Next is the individual chord change. Sometimes a chord change will take place within a measure, whereas other times it will occur between measures. Through moving tones or otherwise, it is important to anticipate the chord change, to make it so the ending notes of each phrase resolve to the next chord. Some variance is permitted in the time here, and the resolution can take place slightly before or slightly after the change. Generally, chord changes can be outlined by connecting the appropriate guide tones of the chords and playing the transition with some melody connecting the start and end tones. What is allowed as part of this transitory melody depends on the two chords and their interval. More quickly moving chords are harder to improvise over for a soloist because they require you hit chord tones and available tensions, so as to outline the harmony, but that melodically, the chord change is anticipated. Although this is difficult for the performer because 6 Computer Synthesis of the amount of information he have to process in such a short span of time, it also diminishes the time he have to think up of a melodically creative idea – in other words, it takes some of the ingenuity out of the equation, making it much easier for a computer to do. As is the case with performers, it is difficult for solos over very repetitive chord changes to be innovative every time. A single chord with little change, however, makes it easy to find scales that work over the chord. Finally, there is the individual chord. These are the building blocks of the progression, and each is a canvas for improvisation. Each chord offers a collection of tools, all of which work over the chord. It is up to the soloist to put them together musically. Generally these tools include : chord scales, a blues scale, modal scales, chord tones, and available tensions (11ths, 13ths, etc.). If the soloist stays works with these tools and does not stray too far from them, the solo will come out well. Finally, and perhaps most obviously, the chords themselves are important soloing tools. They dictate the musical flow of the tune, so even just playing chords directly in solos will never fail. Alternate approaches involving chords include arpeggios, playing the notes of the chord separated, resolved dissonance, where a chord is played with one wrong note that resolves to a chord tone, and simply playing chords with the left hands. There are many different methods for voice leading, and chords add texture to solos. One can even play shifted chords based on the scale tones, which is a powerful way of ensuring multiple notes in unison sound good as a group. This system of playing spaced intervals on the scale in question is effective in generating melodic volume, especially for rhythm instruments. Since guitars and pianos normally comp during solos, the sound of the solo is weakened by held notes and rests. The difference lies in the inability to achieve and sustain tone like a wind instrument can, so guitars and keyboards require constant motion in the melody. Playing chords or chord variants in the solo can make up for this lack of volume. One can take, for example, the I, III and VI of a scale and shift them up as a “chord”. As the notes are drawn from the same chord scale, they sound good. Algorithmic Synthesis of Music Using Markov Chains The stochastic approach is one of several major methods by which music is pseudorandomly generated. For example, a number could be chosen which would correspond to interval size. Intervals would be weighted differently depending on their scale degree with respect to the previous note. This is known as first order approximation because note selection is a function of only the previous note. By increasing the order of the randomness , the solo is made more structured. The process is inherently stochastic, however ; to prevent repeated sequences, one could add exception cases. Alternatively, Markov Chains offer another solution. Then as opposed to working solely in the realm of intervals, which do not depend on scale position, the program will take into account the different states in which the program could be (different notes), and change the probability distribution accordingly. Then, the software would not treat a minor 3rd on the supertonic the same way it would a minor 3rd on the submediant. The Markov Chain is rigid, but 7 Computer Synthesis still stochastic. It can also be easily nested and parallelized, so that the notes and their organization in time, two completely different but related things, could be randomized in parallel (Franz, 1998). There is always the question of total randomness in generation of lines. The programmer must place some sorts of limits on the musical range of a phrase, lest it jump around the keyboard too much. One can approach the task by simply mapping guide tones and resolutions, and focusing only on the connection between two consecutive guide tones. Naturally, any string of connecting tones can be decomposed into a number of ascending and descending lines (Franz, 1998). Rest D1 Ab1 A1 B1 Db2 D2 Rest 0.52 0 0 0 0.1 D1 0 0 0 0 0 B1 0 E2 F2 Gb2 G2 Ab2 A2 0.01 0.02 0.01 0 0 Bb2 B2 C3 Db3 D3 Eb3 E3 Total 0.08 0 0 0.07 0 0.03 0.02 0.05 0.03 0.03 0.01 87 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0.07 0.07 0.14 0 0.07 0.64 0 0 0 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0.5 0 0 0.5 0 0 0 0 0 0 0 0 0 0 2 D2 0.04 0 0 0 0.2 0 0 0 0 0.36 0 0 0.36 0 0.04 0 0 0 0 0 25 E2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 F2 0.5 0 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 2 Gb2 0.1 0 0 0 0.02 0 0.34 0 0 0 0 0 0.46 0.05 0 0 0.02 0 0 0 41 G2 0 0 0 0 0 0 0 0 0.33 0.33 0 0 0.33 0 0 0 0 0 0 0 3 A2 0.26 0 0 0 0 0 0 0 0.03 0.45 0.03 0.16 0 0 0 0.03 0.03 0 0 0 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 B2 0.05 0 0 0 0 0 0 0 0 0 0 0 0.9 0 0 0 0 0 0 0.05 20 C3 0 0 0 0 Db2 0 Bb2 1 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0 0 0 0.5 4 Db3 0.13 0 0 0 0 0 0.03 0 0 0 0 0 0.13 0.03 0.17 0 0 0.33 0 0.17 30 D3 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0 0.91 0 0 0 0 0 11 E3 0.9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0 10 F3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 Figure 5. First order Markov Matrix. This is an example stochastic matrix, which gives the probability of any given state following the current state. (“Markov Chains as Tools”, n.d.). 8 Computer Synthesis Rest Rest Rest Rest Rest Rest B1 B1 B1 Db2 D2 D2 D2 D2 E2 F2 Gb2 Gb2 Gb2 Gb2 Gb2 G2 G2 A2 A2 A2 A2 A2 Bb2 B2 B2 B2 C3 C3 Db3 Db3 Db3 Db3 Db3 Db3 Db3 D3 E3 E3 F3 Rest B1 Db2 D2 E2 B2 D1 Db2 D2 D2 Rest B1 Gb2 B2 Rest G2 Rest B1 D2 A2 Bb2 Gb2 A2 Rest F2 Gb2 G2 Db3 Rest Rest A2 E3 A2 E3 Rest D2 A2 Bb2 B2 D3 E3 B2 Rest D3 Rest Rest 0.61 0 0 0.5 1 0.33 0 0 0 0 1 0 0 0 0.5 0 1 0 0 0.33 1 1 0 0.63 1 0 0 0 0 0 0 1 0 1 0.5 0 0 1 0 0 0.8 0 0.33 0 1 D1 0 0.11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Ab1 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A1 0 0 0 0 0 0 0 0 0 0 0 0.67 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Db2 0 0.11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 D2 0 0.78 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0.4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 Gb2 0.16 0 0 0.5 0 0 0 1 0.11 0 0 0 0 0 0 0 0 0 0.58 0.67 0 0 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0.67 0 0 0 0 0 0 0 0 G2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 Ab2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A2 0.06 0 0 0 0 0.67 1 0 0.89 1 0 0 0.89 1 0 1 0 0 0 0 0 0 0 0.13 0 0.6 0 1 0.67 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 B2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 1 0 0 0 1 0 0 0 0 0 C3 0.06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Db3 0.03 0 0 0 0 0 0 0 0 0 0 0 0.11 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0 0 0 0 0 0 0.33 0 0 0 0 0 0.11 0 0 D3 0.03 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0 0.22 0 0 Eb3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0 E3 0.03 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Total 31 9 1 2 1 3 1 1 9 1 1 3 9 1 2 1 4 1 12 9 2 1 1 8 1 10 1 1 3 1 5 1 2 2 4 1 3 1 5 10 5 10 9 1 2 Figure 6. Second Order Markov Matrix. The following is the stochastic matrix of a Markov Chain that generates notes based upon two-note series. (“Markov Chains as Tools”, n.d.). Random Music and Binary Trees Another approach is given by binary trees. The approach involves stringing out triads in a linear representation and then piecing together the tones differently. The first note so generated is the root of the tree. The subsequent notes are compared, and smaller sub-trees are established again and again until the binary tree is complete. The advantage is that it is a good way of combining strings of known notes with controlled variability. A sizeable disadvantage is its inability to deal with repeated notes effectively. These can by synthetically introduced, however (Chen, 1992). 9 Computer Synthesis One way to construct and ascending/descending line is randomly, that is by choosing a note lower than the higher note, then choosing another note lower than that, and so on until the lower note is reached. However, this does not adequately consider the melodic quality of these notes. For running eighth note lines, however, this is often sufficient; connecting tones are not always heard distinctly (Chen, 1992). The Markov chain approach works here as well. Because a note can never be taken to a note higher than itself, the stochastic matrix is triangular. This reduces total multiplications from n3 to n2. Dynamical systems provide yet another approach. When one wishes to “ornament” a note (articulate it), one can use a discrete dynamical system with complex eigenvalues (norm < 1) as a way to ensure that the note of choice is the one that is landed on at the end of the phrase, but that there is controlled variance in between. Dynamical Systems A dynamical system is a system whose state vector can be modeled by matrix multiplication. It the state vector is of dimension n, the transform matrix is n x n. The first coordinate of the matrix entry will give the current state, and the second will give the state under transformation. The value of the entry is the probability that this change happens (Bretscher, 2008). The underlying mathematics of a Markov Chain is recursion. When expanded, the equation gives a recursion of n linear functions in terms of themselves, which can clearly be computed. Diagonalizing is a means to solve this in closed form for t, provided the eigenvalues can be obtained. If the matrix can be diagonalized, the number of computations goes from n3 to n, as only entries along the diagonal have to be multiplied. Dynamical systems can be both discrete and continuous. Discrete dynamical systems satisfy the matrix equation above, and they only exist in stages. Alternatively, the rate of change of the state vector can be given by the matrix product, in which case the system becomes discrete. For a discrete model, it is enough to consider the discrete system, as long as points are chosen properly (Bretscher, 2008). JFugue and the MusicString After downloading the jfugue.jar library simply create a project and import to start playing music. Soundbanks are available for download from the Sun website (Koelle, 2008). 10 Computer Synthesis The MusicString is the input form with which the player object works. This makes it very easy to embed JFugue into Java code, because the MusicString is a string and can therefore be worked with in non-musical Java code. Player player = new Player(); player.play("C"); player.play("C7h"); player.play("C5maj7w"); player.play("G5h+B5h+C6q_D6q"); player.play("G5q G5q F5q E5q D5h"); player.play("T[Allegro] V0 I0 G6q A5q V1 A5q G6q"); player.play("V0 Cmajw V1 I[Flute] G4q E4q C4q E4q"); Figure 7. Basic player elements in JFugue. It is very easy to specify almost completely the sequence of notes with all vital musical information in but a single line of code. (“Complete Guide to JFugue”, n.d.). JFugue is also set up to handle algorithmic music very well. As opposed to using a name, one can specify a note by its MIDI value, which eliminates time spent trying to convert between the two with a lookup table. Algorithmic work can be done by the program, which will pass only a final string to main() to play (Koelle, 2008). Notes and Chords in JFugue Octave 0 1 2 3 4 5 6 7 8 9 10 C 0 12 24 36 48 60 72 84 96 108 120 C#/Db 1 13 25 37 49 61 73 85 97 109 121 D 2 14 26 38 50 62 74 86 98 110 122 D#/Eb 3 15 27 39 51 63 75 87 99 111 123 E 4 16 28 40 52 64 76 88 100 112 124 F 5 F#/Gb 6 17 18 29 30 41 42 53 54 65 66 77 78 89 90 101 102 113 114 125 126 G 7 19 31 43 55 67 79 91 103 115 127 G#/Ab 8 20 32 44 56 68 80 92 104 116 A 9 21 33 45 57 69 81 93 105 117 A#/Bb 10 22 34 46 58 70 82 94 106 118 B 11 23 35 47 59 70 83 95 107 119 Figure 8. MIDI value table for notes. Algorithmic music generation is much easier when conversions between notes and MIDI values can be skipped, which JFugue allows for. (“Complete Guide to JFugue”, n.d.). 11 Computer Synthesis JFugue Name Maj Min Aug Dim dom7 maj7 min7 sus4 sus2 maj6 min6 dom9 maj9 min9 dim7 add9 min11 dom11 dom13 min13 maj13 dom7<5 dom7>5 maj7<5 maj7>5 minmaj7 dom7<5<9 dom7<5>9 dom7>5<9 dom7>5>9 Intervals (0 = root) 0, 4, 7 0, 3, 7 0, 4, 8 0, 3, 6 0, 4, 7, 10 0, 4, 7, 11 0, 3, 7, 10 0, 5, 7 0, 2, 7 0, 4, 7, 9 0, 3, 7, 9 0, 4, 7, 10, 14 0, 4, 7, 11, 14 0, 3, 7, 10, 14 0, 3, 6, 9 0, 4, 7, 14 0, 7, 10, 14, 15, 17 0, 7, 10, 14, 17 0, 7, 10, 14, 16, 21 0, 7, 10, 14, 15, 21 0, 7, 11, 14, 16, 21 0, 4, 6, 10 0, 4, 8, 10 0, 4, 6, 11 0, 4, 8, 11 0, 3, 7, 11 0, 4, 6, 10, 13 0, 4, 6, 10, 15 0, 4, 8, 10, 13 0, 4, 8, 10, 15 Figure 9. Chord symbols in JFugue. In order to generate left hand voicings, it is necessary to have the full chords at easy access. JFugue comes with this functionality. (“Complete Guide to JFugue”, n.d.). Engineering Proposal Even controlled “random” music generation over jazz chord changes does not always adequately analyze the tune harmonically before synthesizing music, and often any analysis is independent of the chords themselves, so the music does not outline the harmonies. The engineering goal is to write code that can take as input the chord changes for a tune, analyze it harmonically, and synthesize music that reflects that analysis. Based on the moving tones in the chord changes for a tune, a melodic line of guide tones will be established. Music will be interpolated through these guide tones with either discrete tones or scales. The tones will be based on the available tensions on a chord while the scales will be chosen based on the harmonic analysis. The scales will be chosen from a set of scales unique to each chord, which are known to sound good over that specific chord. (Insert results here, along with summary of outcome). 12 Computer Synthesis The following are the design criteria and secondary goals: 1. 2. 3. 4. The generated music sounds good over the chord changes The generated music outlines the harmony The user interface is manageable Generated music is new and varied each time The device will be tested by comparing the generated music against the set of musical rules that dictate improvisation. Having verified that the results sound good, they will be further checked to make sure there is not too much musical repetition Methodology The Java programming language and JFugue libraries (open source) were used as a way for the computer to produce controlled sound. Java code was written to internally generate a sequence of notes that was then be passed to the player to play. First, the basic musical elements were constructed internally to the code. These included chords, notes and scales, each of which the program used to process and create music dynamically. The program took as input the chord changes for the tune, in the form of the JFugue musicstring. Once the computer had obtained, as input, the changes and the key, it began harmonic analysis on the tune. This involved breaking all chords down into their scale degrees and identify moving tones. Moving tones were obtained by comparing consecutive chord forms, whereas scale degrees were obtained from the key of the tune. Moving tones were used to decide how to voice chords with the left hand in addition to the primary purpose of outlining the harmony. The code took into account the chord, the tones to be connected, scales that work over the chord, and the key of the tune in synthesizing a line over a measure. Using the analysis, a set of guide tones were established, which outlined the general melodic motion of the tune. Then, lines were interpolated through the guide tones, which serve as but a melodic skeleton for the program. Music was interpolated in four different ways – tone based, harmonic based, chord based, scale based. Tone based interpolation is two-fold. In one method, two notes are connected using notes from a fixed set. This is similar to the scale based method, but it includes chord tensions. Every valid note between the two was strung out, and notes were dropped randomly. In another method, the space between consecutive guide tones is small enough that there need not be any significant melodic motion. Here, notes are weighted by how musically relevant they are to the chord; as a consequence, most of the notes that are generated are either chord tones or available tensions on the chord. The number of notes was chosen to fit the time signature, and each line was appended to the final musicstring after completion. Additionally, chord based interpolation was used to give a fuller sound to the solo. Chord based interpolation is simply a variant on tone based interpolation where instead of notes, triads 13 Computer Synthesis built on the chord scale were selected. The process for root selection was identical to the tone based system. All root notes are chosen from the chord’s guide tones. In scale based interpolation, guide tones will be connected using scales known to sound good over the chord. Since the guide tones are specific notes of the chord, they are contained in the chord scale and in other functional scales. The scale will then be split into its constituent tones, rearranged, and pieced back together semi-randomly to generate the phrase. Harmonic interpolation is a method in which every note between the two guide tones is played in the phrase. It is normally reserved for intervals that are small, so this was reflected in the code. Based on the size of the gap between two notes, different methods are used to interpolate harmonically. Finally, the program will be given a specific function for articulation. This will take spaces reserved for held notes, rests, or articulation and replace them with small, articulated phrases. These will be hard-coded, since they are unlikely to occur synthetically. The final product, the musicstring, was played by the player after computation was finished. Tests were conducted to measure the frequencies of specific phrases to ensure no phrase occurred disproportionately frequently. The only materials used in the construction of the device were the Java programming language and JFugue libraries. Results Design Criteria and Secondary Goals 1. 2. 3. 4. The generated music sounds good over the chord changes The generated music outlines the harmony The user interface is manageable Generated music is new and varied each time The device was tested by comparing the generated music against the set of musical rules that dictate improvisation. Having verified that the results sound good, they were further checked to make sure there is not too much musical repetition. Prototype Designs and Diagrams An initial prototype of this device focused on the ability to play processed music as opposed to focusing on improvisation. The prototype voiced chords in the left hand in one of several different ways, based on user input. Being a prototype, however, input was in the musicstring format, internal to the program. The prototype not only give an idea of the plausibility of the project, but it demonstrated the ability to take chords, process them, and generate varied sequences of tones. 14 Computer Synthesis Criteria 1. Generated music sounds good* 2. Generated music is new each time 3. Generated music reflects the chord changes of the original music 4. Harmonic analysis is displayed and explained 5. Chords or a bass-line are added to the LH 6. Easy to implement 7. User manageable interface is Design A Design B Design C Design D Design E Design F 8/10 8/10 8/10 8/10 9/10 9/10 5/10 5/10 9/10 9/10 10/10 10/10 7/10 7/10 9/10 9/10 9/10 9/10 7/10 5/10 9/10 8/10 10/10 9/10 6/10 6/10 9/10 9/10 10/10 10/10 5/10 8/10 2/10 5/10 2/10 4/10 10/10 6/10 10/10 6/10 10/10 6/10 Design A: The music is based only on the chord and chord scale. Design B: The music is based only on the chord and chord scale. User interface is not graphical. Design C: Using binary trees and Markov chains for quasi-stochastic tone generation. Design D: Using binary trees and Markov chains for quasi-stochastic tone generation. User interface is not graphical. Design E: Using binary trees, Markov chains, and dynamical systems for controlled tone generation. Design F: Using binary trees, Markov chains, and dynamical systems for controlled tone generation. User interface is not graphical. * The notes are generated by algorithms that are based upon musical criterion for a melodic solo. 15 Computer Synthesis Data and Graphs T120 C4w+B4w+[43]i [45]i [47]i [48]i C4w+B4w+[55]i [52]i [53]i [54]i C4w+Bb4w+[50]i [49]i [48]i [51]i F4w+A4w+[51]i [48]i [49]i [50]i Bb3w+A4w+[55]i [53]i [58]i [58]i Bb3w+A4w+[53]i [51]i [53]i [55]i Bb3w+Ab4w+[40]i [39]i [38]i [41]i Eb4w+G4w+[41]q [42]i [43]i Ab4w+C5w+[41]i [39]i [37]i [36]i Ab4w+C5w+[36]i [33]i [34]i [35]i D4w+C5w+[48]i [50]i [52]i [50]i G4w+B4w+[45]i [43]i [41]i [40]i C4w+B4w+[39]q. [38]i A4w+C5w+[38]i [41]i [41]i [41]i D4w+C5w+[43]i [45]i [43]i [41]i G4w+B4w+[43]i [45]i [47]i [45]i C4w+B4w+[47]i [48]i [48]i [48]i C4w+B4w+[47]i [48]i [47]i [45]i C4w+Bb4w+[38]i [43]i [45]i [46]i F4w+A4w+[49]i [48]i [47]i [46]i Bb3w+A4w+[43]i [41]i [39]i [38]i Bb3w+A4w+[38]i [39]i [38]i [36]i Bb3w+Ab4w+[48]i [46]i [48]i [48]i Eb4w+G4w+[43]i [44]i [44]i [44]i Ab4w+C5w+[43]q [44]i [45]i Ab4w+C5w+[46]i [51]i [49]i [48]i D4w+C5w+[51]q. [50]i G4w+B4w+[50]i [52]i [52]i [53]i C4w+B4w+[52]i [50]i [48]i [47]i C4w+B4w+[47]i [47]i [50]i [47]i C4w+B4w+[47]i [48]i [50]i [50]i C4w+B4w+[39]i [38]i [37]i [40]i D4w+C5w+[40]q [41]i [42]i D4w+C5w+[43]i [45]i [43]i [45]i G4w+B4w+[45]i [41]i [40]i [38]i G4w+B4w+[38]i [40]i [41]i [43]i C4w+B4w+[47]h C4w+B4w+[47]i [45]i [47]i [48]i A4w+Db5w+[49]i [50]i [52]i [53]i A4w+Db5w+[55]i [55]i [55]i [55]i D4w+C5w+[56]i [55]i [54]i [53]i D4w+C5w+[46]i [45]i [44]i [47]i G4w+B4w+[47]i [52]i [50]i [48]i G4w+B4w+[41]i [40]i [38]i [36]i D4w+C5w+[36]i [33]i [34]i [35]i D4w+C5w+[38]i [38]i [43]i [43]i G4w+B4w+[38]i [41]i [43]i [38]i G4w+B4w+[43]i [38]i [40]i [41]i C4w+B4w+[47]i [48]i [50]i [52]i C4w+B4w+[55]i [52]i [53]i [54]i C4w+Bb4w+[55]i [57]i [57]i [58]i F4w+A4w+[53]i [50]i [48]i [46]i Bb3w+A4w+[45]i [46]i [46]i [46]i Bb3w+A4w+[41]i [36]i [38]i [39]i Bb3w+Ab4w+[46]i [44]i [43]i [41]i Eb4w+G4w+[37]i [37]i [37]i [41]i Ab4w+C5w+[36]i [37]i [37]i [37]i Ab4w+C5w+[43]i [44]i [43]i [41]i D4w+C5w+[42]q. [41]i G4w+B4w+[40]i [41]i [36]i [41]i C4w+B4w+[36]i [33]i [34]i [35]i C4w+B4w+[36]i [33]i [34]i [35]i C4w+B4w+[42]i [41]i [40]i [43]i C4w+B4w+[43]i [38]i [40]i [41]i Figure 10.The musicstring output for trial 1 of the software on the same set of chord changes, to Afternoon in Paris. 16 Computer Synthesis C4w+B4w+[43]i [43]i [47]i [45]i C4w+B4w+[47]i [50]i [49]i [48]i C4w+Bb4w+[39]i [36]i [37]i [38]i F4w+A4w+[45]i [51]i [48]i [51]i Bb3w+A4w+[45]h Bb3w+A4w+[46]i [49]i [48]i [47]i Bb3w+Ab4w+[36]i [41]i [37]i [41]i Eb4w+G4w+[41]i [46]i [44]i [46]i Ab4w+C5w+[48]i [45]i [46]i [47]i Ab4w+C5w+[56]i [53]i [54]i [55]i D4w+C5w+[40]h G4w+B4w+[41]i [43]i [41]i [41]i C4w+B4w+[43]i [44]i [45]i [46]i A4w+C5w+[47]i [44]i [45]i [46]i D4w+C5w+[57]i [62]i [60]i [59]i G4w+B4w+[57]i [60]i [59]i [58]i C4w+B4w+[50]i [48]i [45]i [43]i C4w+B4w+[43]i [40]i [41]i [42]i C4w+Bb4w+[43]i [43]i [46]i [43]i F4w+A4w+[46]i [50]i [48]i [53]i Bb3w+A4w+[53]i [50]i [51]i [52]i Bb3w+A4w+[58]i [60]i [62]i [60]i Bb3w+Ab4w+[41]i [39]i [41]i [43]i Eb4w+G4w+[35]i [34]i [33]i [36]i Ab4w+C5w+[36]i [36]i [39]i [43]i Ab4w+C5w+[43]i [37]i [39]i [41]i D4w+C5w+[48]i [48]i [48]i [50]i G4w+B4w+[43]i [47]i [45]i [47]i C4w+B4w+[40]i [41]i [45]i [47]i C4w+B4w+[39]i [38]i [37]i [40]i C4w+B4w+[40]i [40]i [43]i [40]i C4w+B4w+[43]i [45]i [48]i [50]i D4w+C5w+[53]i [55]i [55]i [55]i D4w+C5w+[57]i [55]i [57]i [57]i G4w+B4w+[55]i [55]i [59]i [55]i G4w+B4w+[59]i [56]i [57]i [58]i C4w+B4w+[55]i [53]i [52]i [48]i C4w+B4w+[45]i [43]i [40]i [37]i A4w+Db5w+[37]i [38]i [40]i [40]i A4w+Db5w+[40]i [37]i [38]i [39]i D4w+C5w+[50]q. [51]i D4w+C5w+[51]q. [50]i G4w+B4w+[43]i [41]i [40]i [38]i G4w+B4w+[38]i [41]i [43]i [47]i D4w+C5w+[47]i [45]i [41]i [40]i D4w+C5w+[40]i [43]i [45]i [47]i G4w+B4w+[45]i [47]i [48]i [50]i G4w+B4w+[45]i [43]i [41]i [43]i C4w+B4w+[52]i [47]i [48]i [50]i C4w+B4w+[52]i [50]i [52]i [53]i C4w+Bb4w+[42]i [41]i [40]i [39]i F4w+A4w+[39]i [39]i [41]i [39]i Bb3w+A4w+[41]i [44]i [43]i [42]i Bb3w+A4w+[41]i [44]i [43]i [42]i Bb3w+Ab4w+[55]i [53]i [51]i [49]i Eb4w+G4w+[44]i [46]i [46]i [49]i Ab4w+C5w+[44]i [39]i [41]i [43]i Ab4w+C5w+[44]i [46]i [48]i [46]i D4w+C5w+[40]i [37]i [38]i [39]i G4w+B4w+[48]i [50]i [52]i [50]i C4w+B4w+[43]i [43]i [48]i [48]i C4w+B4w+[43]i [40]i [41]i [42]i C4w+B4w+[48]i [47]i [45]i [47]i C4w+B4w+[48]i [45]i [46]i [47]i Figure 11.The musicstring output for trial 2 of the software on the same set of chord changes, to Afternoon in Paris. 17 Computer Synthesis T120 C4w+B4w+[50]i [50]i [50]i [52]i C4w+B4w+[50]i [48]i [47]i [48]i C4w+Bb4w+[45]i [43]i [41]i [39]i F4w+A4w+[39]i [39]i [41]i [41]i Bb3w+A4w+[46]i [43]i [44]i [45]i Bb3w+A4w+[58]i [63]i [62]i [60]i Bb3w+Ab4w+[48]i [47]i [46]i [49]i Eb4w+G4w+[49]i [44]i [48]i [49]i Ab4w+C5w+[35]i [34]i [33]i [36]i Ab4w+C5w+[36]i [39]i [38]i [37]i D4w+C5w+[41]i [36]i [38]i [40]i G4w+B4w+[41]i [43]i [45]i [47]i C4w+B4w+[44]i [43]i [42]i [45]i A4w+C5w+[45]i [47]i [48]i [47]i D4w+C5w+[45]i [47]i [45]i [50]i G4w+B4w+[50]i [47]i [48]i [49]i C4w+B4w+[50]i [52]i [52]i [55]i C4w+B4w+[55]i [57]i [55]i [53]i C4w+Bb4w+[42]i [41]i [40]i [43]i F4w+A4w+[43]i [46]i [48]i [50]i Bb3w+A4w+[53]i [55]i [55]i [57]i Bb3w+A4w+[57]i [60]i [59]i [58]i Bb3w+Ab4w+[39]i [41]i [44]i [44]i Eb4w+G4w+[37]i [36]i [37]i [37]i Ab4w+C5w+[36]i [37]i [37]i [37]i Ab4w+C5w+[43]i [48]i [46]i [44]i D4w+C5w+[46]i [45]i [44]i [47]i G4w+B4w+[47]i [47]i [47]i [47]i C4w+B4w+[43]i [40]i [41]i [42]i C4w+B4w+[52]i [49]i [50]i [51]i C4w+B4w+[39]i [38]i [37]i [40]i C4w+B4w+[40]i [37]i [38]i [39]i D4w+C5w+[50]q [51]i [52]i D4w+C5w+[53]i [59]i [57]i [55]i G4w+B4w+[52]h G4w+B4w+[39]i [38]i [37]i [40]i C4w+B4w+[40]i [38]i [36]i [40]i C4w+B4w+[36]i [36]i [40]i [38]i A4w+Db5w+[40]i [43]i [45]i [46]i A4w+Db5w+[51]i [50]i [49]i [48]i D4w+C5w+[47]i [43]i [48]i [48]i D4w+C5w+[41]i [38]i [39]i [40]i G4w+B4w+[40]i [40]i [38]i [41]i G4w+B4w+[38]i [40]i [40]i [45]i D4w+C5w+[45]i [47]i [52]i [53]i D4w+C5w+[57]i [57]i [57]i [57]i G4w+B4w+[57]i [57]i [59]i [59]i G4w+B4w+[57]i [60]i [59]i [58]i C4w+B4w+[48]i [45]i [46]i [47]i C4w+B4w+[55]i [53]i [52]i [53]i C4w+Bb4w+[45]q [44]i [43]i F4w+A4w+[43]i [45]i [46]i [48]i Bb3w+A4w+[50]i [47]i [48]i [49]i Bb3w+A4w+[57]i [58]i [57]i [55]i Bb3w+Ab4w+[51]i [48]i [53]i [53]i Eb4w+G4w+[48]i [48]i [48]i [51]i Ab4w+C5w+[51]i [46]i [48]i [49]i Ab4w+C5w+[51]i [54]i [53]i [52]i D4w+C5w+[45]i [42]i [43]i [44]i G4w+B4w+[50]i [50]i [50]i [50]i C4w+B4w+[42]i [41]i [40]i [43]i C4w+B4w+[43]i [50]i [47]i [45]i C4w+B4w+[49]q. [48]i C4w+B4w+[48]i [53]i [52]i [50]i Figure 12.The musicstring output for trial 3 of the software on the same set of chord changes, to Afternoon in Paris. Table 1. In 100 trials of the software on a single set of chord changes, following table depicts those musical phrases that appear at least 5 times, along with the number of such phrases and the percentage of phrases they account for. Number of 8 Appearances Percentage of 0.44% all phrases Number of 2 such phrases 18 7 6 5 0.97% 1.6% 3.2% 5 10 23 Computer Synthesis Data Analysis and Discussion The data show that any particular phrase has a very low probability of being repeated as is in a single improvisation – no phrase accounts for more than 0.1% of all phrases and no phrase appears more than 8 times in any of the 100 trial runs (each with 36 phrases). In fact, the frequencies were low enough that the expected number of times one would have to run the program to get it to produce the same phrase is more than 20. Thus the program abides by the fourth element of the design criteria: the generated music is new and varied each time Conclusions Given the immense amount of variety possible in a piece of music, it is no surprise that it is quite easy to generate, even algorithmically, music that is quite irreplicable. Music that is generated algorithmically, however, is guaranteed to abide by the rules upon which it is based. The program did both of these – the music was new and varied and abided by the set of musical rules which guaranteed its consonance. Guide notes were chosen from chord tones, so as to outline melodic motion and match the chord progression in tonality. Each method for interpolation between the guide notes was used consistently in improvising the final musicstring. Limitations and Assumptions Because of the incredible variety of tunes within the jazz style, several assumptions were made in the development of the program for the sake of simplicity. It is designed to improvise over swing tunes, where time is divided into even 8ths. Additionally, all time signatures are assumed to be 4/4. These assumptions eliminate the need to consider different rhythms and time subdivisions for different tunes. However, 4/4 swing is by far the most popular jazz time feel, so the assumption is minimally restrictive. The program is also incapable of combining different methods of improvisation within a phrase, like a performer might. Because there is no reliable way to “blend” two phrases, the program instead chooses a single improvisation method for each pair of guide tones. Although this may seem like a very limiting assumption, it is not so, due to the multiple different methods the program is capable of executing and the fact that there are 2 guide tones per measure. The most significant assumption made is that all of the standard musical rules are enough to guarantee a good quality solo. While they must be followed to ensure the solo is good, they may be necessary but not quite sufficient. While one can guarantee that the solo is not dissonant, it cannot be melodically creative enough to compare to a real soloist. In terms of execution, the biggest limitation is the absence of a GUI. Input is currently read from text files that correspond to the changes of the tune, which have to be transcribed manually. A graphical UI would make the process of user input easier for the user. 19 Computer Synthesis Applications and Future Experiments The purpose of the project is to explore the applications of computer algorithms to synthesis of original music based on a set of chord changes. Although it is not immediately applicable to a problem, the results of the project, whether affirmative or negative, could help contribute to general knowledge in the field of computer music generation. A functional project could also (after further refinement) serve as an introductory teaching tool of the jazz style. Although they were not implemented in this project, more advanced Markov Chain methods could be used for a different method of improvisation. Dynamical systems, while not implemented, could also be used. Both provide a better method of improvising over chords which are held for several measures, because they create more continuous melodic motion. The methods used in this project are better suited to chords that move quickly. Future research could also include development of methods for computer music transcription, which would make a solo even more authentic. If it were possible to transcribe recorded solos with accuracy, it would add great variety to computer generated solos. Further, it might be possible to analyze musical styles based on transcribed music. Computer generated music would be given a whole new dimension if music could be synthesized in the style of a particular musician. Alternative algorithms and styles of music could also be experimented with. Since the program can only be measured against the standards by which it abides (by construction), sources of error are more subjective than they are quantifiable. They can still, however, be measured. The two major potential sources of error are repetition and musical dissonance. The first can be measured by running the program over a single tune a large number of times, and counting individual phrases to monitor their frequency. The second, however, is more difficult. Passing dissonance and even sustained dissonance are frequent in many jazz tunes, so discrediting dissonance of any sort would be a mistake. Again, although perhaps with less success, relative frequency of dissonance can be measured. Literature Cited Bretscher, O. (2008). Linear Algebra (3rd Edition). Chen, D. (1992). Computer Improvisation of Jazz Solos. Retrieved October 3, 2011, from https://ritdml.rit.edu/bitstream/handle/1850/11088/DChenThesis07-131992.pdf?sequence=1 Franz, D. (1998). Markov Chains as tools for Jazz Improvisation. Retrieved October 31, 2011, from http://scholar.lib.vt.edu/theses/available/etd-61098-131249/unrestricted/dmfetd.pdf Gannon, P. (1999). Automatic Improvisation System and Method (Patent). Retrieved September30,2011http://www.google.com/patents?id=YgUZAAAAEBAJ&printsec= abstract&source=gbs_overview_r&cad=0#v=onepage&q&f=false Humphries, C. (2007). Piano Workbook. Jawbone Press. 20 Computer Synthesis Hal Leonard Corporation (2004) The Real Book (6th ed.). Hal Leonard Corporation. Introduction to Jazz (n.d.) Retrieved October 15, 2011 from http://jazz.about.com/ Introduction to Music Theory (n.d.) Retrieved October 18, 2011 from http://www.8notes.com/theory/ Keys and Intervals (n.d.) Retrieved October 28, from http://library.thinkquest.org/15413/ theory/intervals.html Koelle, D. (2008). The Complete Guide to JFugue: Programming Music in Java. Retrieved from http://www.jfugue.org Miller, M. (2005) The Complete Idiot’s Guide to Music Theory (2nd ed.) Penguin Group. Popular Chord Changes (n.d.) Retrieved October 14, 2011 from http://www.guitar-chordtheory.com/images/chordprog2.jpg Tomassetti, B. (2003). Beginning Blues Improvisation Pedagogy for the Non-Jazz Specialist Music Educator [electronic version]. Music Educators Journal, 89 (3), 17-21. van der Linden, P. (1999). Just Java 2 (4th ed.). Sun Microsystems Press Acknowledgements The author wishes to thank Mr. James Barys for advising the project and helping guide it to completion. Additionally, he would like to thank Dr. Judith Sumner for reading and helping to edit the project paper and Mr. Richard Odgren for teaching him the fundamentals of jazz theory. 21