THE EXPRESSION OF AESTHETIC PRINCIPLES AS SYNTACTIC STRUCTURES AND HEURISTIC PREFERENCES AND CONSTRAINTS IN A COMPUTER PROGRAM THAT COMPOSES JAZZ IMPROVISATIONS From: AAAI Technical Report SS-93-01. Compilation copyright © 1993, AAAI (www.aaai.org). All rights reserved. D. J. H. BROWN Department of Mathematics and Computing University of Central Queensland Rockhampton QLD4702 Australia and S. SIDLEY Department of Applied Mathematics University of the Witwatersrand Johannesburg South Africa Abatract. A computationalmethodof synthesising contemporaryjazz melodiesover a harmonicbase is described. The methodimplementscertain aesthetic principles of musicalcompositionin the formsof constraints uponphrasingpatterns and of context-sensitiveprobabilistic preferencesin choosingnote durationsandpitches. 1. Introduction Popularmusicsl oomposifionsare not created out of thin air; they follow a set of aesthetic principles which distinguishes a l~rticular style. Althougha completeset of criteria for the comlx~tionof aesthetically pleasing music has thus far defied formalism, someheuristic principles of aesthetics have been established. For example,in jazz improvisation,Coker(1964) remarks: believe that it should be a basic principle to use repetition, rather than variety - but not too much.The listener is constantly making predictions; actual infinitesimal predictiousas to whetherthe next event will be a repetition of something,or somethingdifferent...if heis too successfulin predictinghe will be bored;if he is too unsuccessful he will give up and call the music The three primary ~ts of music are melody, harmonyand rhythm Informally, ~dody is a suction of single notes" (Rnsso,1968) of varying pitches, which instantiate a rhythmic pattern; harmonyrefers to a supporting note or group of notes which provide a backgroundto the melody;and rhythmis the division of the time continuum through which the notes of the melodymdtmmny A musical score may be divided into phrases, sentences and pmagraphs; for exm~e" the~ phrase or motifof Beethoven’s "TheEmperor’s Concerto" is expended, embellished, emphasised andrelxeated toform an eight-bar sentence, whichisfurther expanded and transformed intoa 32-barparagraph. Manymusical compositions, especially jazzimprovisations, are sU-uamed into phrases that repeat orpartially repeat ead/er phrases; for example"typical jazz patterns mea-b-a-c and a-a-b-e, whereeach letter denotes a particular phrase rhythm. The phrases of popular music scores are usually twobars in duration, but mayrun over one or four bars, depending upon the tempo of the piece. Coker (1964) has described a phrase as: "a short but completemelodic idea, usually having a logical rhythmic 133 close’either by thenseof a note of greater duration or by the use of rests’. JAZ(Brownand Sidley, 1974) is cougm~programlhat a~,es musical compositions over a harmonicbase by c:~fing fnsdy a smamaed sentence of rhy,hc 0rues and*,=i,. ovi g a maody bya lrobabilistic technique that embodiesrules of aesth~cs and of playability derived from the compositional expefien~of one of us (StevenSidley). JAZ compositions have a simple hierarchical struetme: A pmagaph is a set of smtenceswhichdefines a completemusicalstatement; JAZis restricted to the most popular song form A-A-B-A,ie. four eight-bar sentinel, the secondof whichis a repetition of the first, followed by a modulationto a separate "middleeight" and a telmn to the first eight bars. Eachsentence comprises fourphrases, eachoftwo bars(thisis a restriction sincemanymusical forms ea~Ioy twdve-bar smtmces). Eachphrase hastwobars, usually dcsed by a dotted minimum or longer note 2. Rhythm Generation As mentioned previously, JAZuses a single standard paragraph form A-A-B-A, to which two sentence s~ me assigned, one for the A sectiom and one for the B sections, selected randomlyfrom the set shown below, whereeach lower case letter denotes a two-bar phra a-a-a-b a-a-b-a a-a-b-b a-b-a-b a-b-a-c a-b-b-a a-b-c-b a-b-c-a The syntaoic s~ of the sample score in Figure 1 is abab ab~ ccdd ab~ where phrases x and x have the sane rhythmbut diff=mt pitches. 3 134 In fine with Coker’sargument,noted previously, phrase rhythm~ are gezg~Aedby a ~ which tends to duster shorter notes toward the beginning of the phrase and longer notes towardthe end. Three classes of notes ate defined, as shownin Table I (lengths are shownin parentheses). Utilising a o’otcbet base and common time (four beats to the bar), wehaveeight units in each two- ~pt~ra~ short notes semiquaver (0.25) quaver(0.5) doaedquaver(0.75) crotchet(1) crotchetrest (1) crotchettriplet Ox 0.33) conventional rules for establishing parent scales and modular bases (Mehegan,1968). Once a parent scale has beenselected, the actual degreeof that scale chosenis a probabilistic function of the duration of the note to be assigned. The conditional probabilities of notes are obtained froma consideration of several constraints and preferczgesconcerninothe aesthetics of hazmony and the physical limitations of musicims. JAZ distinguishes three types of note within the associated scale of any chord: these are the basic tones, the sensitive tones end the destrt~ve tones. Basic tones always sound"comx~"~t a given chord;thesenotes arc those of the chord itself. For example,the C triad comprises the notes C-E-G. Anyof these notes maybe played in the melody against a C triad harmony. Sensitive tones are those notes of the scale that are not theoretical inadmissablebut whichcreate an intangible tension, as if waitingfor resolution. Destna:fivetones am those notes of the scale that, whensustained for too long against a given chord, tend to destroy the "impl/cafion" of tbe chonf Forexam~e, a G major chord "implies" a Groot, whereasits eleventh tends to reduce the feeling of a G tonality. Table 2 details the basic, sensitive and destructive tones for various chordtypes. It will be noted that the sixth of a minorchordis taken from the harmonic minor scale or the melodic minor scale ~n~ on the modal base of the meledy. medium notes dotted crotchet (1.5) minim(2) minim rest (2) minim triplet (3x 0.67) long notes dotted minimO) dottedminimrest O) semibreve(4) semibreve rest14~) TABLE1 Thethree classesof rhythmic entities. JAZproceeds through a phrase from beginning to end, selecting notes in the followingnumne~.L~ b deao~the ~t position within a phrase; then the probability of selectinga notein a particularclass is: medium Io ng short low 1 .=b<3 high 3 =; b < 5 high high low low high 5 .~ b < 7 7<b: a short noteis neededto fill the phrase(wecould of coursehavefilled phrasesbackwards to ensurethat a phrase is alwaysclosedbya longnote,but wepreferto allowthe occasionalclosureby a short note). 3. Melody Generation Melodylines are assigned, one to each sentence, on a probabilistic basis within the aesthetic and playability constraints detailed below. Although any phrases repeat~ within a sentence will have the same rhythmic structure, their melodylines c, aa differ. In general, the melody is allowedto range over three octavesfounded by the tonicof thefirstchordof theharmony. For anygivenchord(tlmharmony comprises onechordper bar), a related or parent scale is assigned.In general, chord maybe related to more than one scale; this is resolved by choo~ngthat pertaining to the key in which the music is written, or, when appropriate, to the modular base of a particular section. JAZuses the 135 Basic Sensitive Destructive Major 2,6,7 4 1,3,5 Major7th 1,3,5,7 2,6 4 4 Major Oh 1,3,5,6 2,7 Minor 1,3,5 2,6,7 4 Minor7th 1,3,5,7 2,4 6,7 2,4 F Minor6th 1,3,5,6 Dominant701 1,3,5,7 2 4,6 Dominant9th 6 4 1,2,3,5,7 Augmenmd 1,3,5 Diminished D D 1.3.5 (notes: I represents firsL 2 second etc. Dreim~sentsthe dominant of the next chord. F represents the flattened fifth I TABLE2 Degrees of Scalesfor differenttoneclassea The above considerations are reflected in JAZby the followingrule: if a note is of very short duration, all notes in the parent scale are equally probable; the longer the note, the less likely destructive or sensitive tones will be chosen. Table 3 displays the exact probabilities used. Dotted notes take the same probability as the note 2/3 its duration (eg. dotted trocheetakesthe same~ty as a~,tche0. semkluave: quaver c .m~.her immtm lsemibreve Basic 0.4 0.4 0.6 0.9 0.9 Sensitive 0.3 0.3 0.3 0.1 , 0.1 grammar to create certain patterns of rising or falling Destructive 0.3 0.3 O.1 0 0 we a te, TABLE3 Probabilityof assigninga particular tone class, as a functionof duration. As it is intended that JAZcompositionsbe playable on conventional instruments, their natural limitations are brought into account. Whenan instrumentalist is playing a very fast passagehe is limited in the size of interval jumpsthat he can make,due to finger and/or lip control problems.Consequently,a fast passageshould be a sequence of small interval jumps, whereasa slower passage is moreable to cs~ompasslm’gejumps(with the overall limitation of one octave). The maximum jumps allowed in J~ ~’e shownin Table 4. Duration of previous note ~nuquaver quaver cpotchet minim semibreve Maximumjump allowed major seco~ majorthird fourth octave octave TABLE4 Allowedinterval jumps 4. mque to notes fromwithin the scale associated with the harmony. JohnsonLaird uses "a grammarwith relatively limited computational powerto generate the bass-line" (Boden, 1991. p156), whereas JAZuses a harmony (ie chord ~quence)provided to it- JAZis not the sole creator of themusical ideabehind a score (which resides largely in theharmonic construction supplied toit),butitisthe c~’~_ :,~ofvarim/om ~ thattheme. Fromthe point of viewof the listener, it could be argued that the "meaning"of a piece, in the sense in which that term is used by Minsky (1989), mayhave moreto do with the contours of the harmonythan of the rhythmand mdodyJAZimprovises upon it; the harmony defines the theme and the rhythm and melodydefine a variation. Nonetheless, when another musician was shownthe sample score andasked to improvise further uponit, and did so,he afterwardremarkedthat he felt he was as muchinfluenced by the colour of the melodic phrasing that JAZhad improvisedas he was by the basic harmony, l~ahn (1989) remarks: "rhe notion representation remains intriguing .... the kind of nonverbalisable representation that occurs, even in my listening mind, gathering each specific aspect of a performanceinto a wholethat is greater tlmn the sumof itsparts, endowing everymusicalpart witha strongly-cast supportingrole in the emergentdmaoerof that piece or perform~ce.If these representatious are not inherently nonverbalizable, a theory dealing with them wouldbe both possibleand mostinte:esfing". The syntactic structures that JAZ uses are 2dimensional(harmonyand rhythm).It is fair to say that the true dime~onalityof musicalstruox~ is (at least) dimensional(ie,including mc/ody). Ourmeth~ ofusing empirically-derivedhcmisticprcfaeuces(probabilities) and ~ostraints to improvise a melodyline captures someO~g of the essenceof musicalaesthetics and seemsto workup to a paint, but we wouldnot care to claim that we know just wherethat point is nor whatties beyondit. Conclusions and Confessions JAZrelates phrases only whenthey are rhythmically similar; many other relations (contour, partial repetition, paraphrase, embellishmentetc.) need to be considered. Other compositional factors as yet missing f~i JAZinclude the use of deliberate unresdved dissonanceto create effect, passing non-chordtones and the introduction of more complexrhythmic structures (eg. offbeat triplet dusters). Furthermore, as JAZ intended to produceonly popular style melodies,complex modesand scales found in modemclassical music and centmVcv~jazz have been omitted. TheVallOUS pal’alnet~pl~3]~bifities usedin JAZwere initially basedon the compositional experience ofoneof us(Sidley); astesting progressed these probabilites were tuned so that the generated compositionsapproximated moredosely our personal aesthetic criteria for pleasing melodies. Possible extensions to JAZinclude automatic harmonygeneration, computer generated voicings of given chords to enhancethe melodyto maximum effect, central melodies and ov:hemafon. Webecame aware of the work of Johnson-Laird (1989) last year, whichappears to take the samebroad approach of creating a melodyline as a function of harmonyand rhythm. Johnson-Laird uses a generative References Boden,M. (1991) The Creative Mind: Myths and Mechanisms, Weidenfeldand Nicholson. Brown,D.J.l-l. and Sidley, S. (1974)AComputational Model of Jazz Improvisation. Technical Report, Dept of AppliedMathematics. Universityof the Witwatersrand. Coker,J.(1964)ImprovisingJazz, Prentice-Hall. Johnson-Laird,EN. (1989)JazzImprovisation: A Theory the Computational Level. Unpublished Working Paper. Mehegan,J. (1968) Jazz Improvisation, Simonand Schuster. vol. 2. Minsky,M.(1989) Music, Mindand Meaning.In: Roads.C. (ed.): TheMusk:Mac/n’ne,MITPress, 639-655. Rahn,J. (1989) OnSomeComputationalModelsof Music Theory. In: Roads,C. (ed.): The Music Machine, MITPress. 663-669. 136