|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Full Text | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PAGE 1 AN ALGORITHMIC STUDY OF SCHOENBERG'S APPROACH TO COUNTERPOINT BY WALTER MAISEL A Thesis Submitt e d to the Division of Humanities New College of Florida In partial fulfillment of the requirements for the degree Bachelor of Arts Under the spon sorship of Dr. Bret Aarden Sarasota, Florida May 2012 PAGE 2 ! "" A HISTORICAL AND ALGORITHMIC STUDY OF SCHOENBERG'S APPROACH TO COUNTERPOINT Walter Maisel New College of Florida, 2012 ABSTRACT Arnold Schoenberg's Preliminary Exercises in Counterpoint a method for learning to compose counterpoint in a modern tonal style, was published in 1963 In it, Schoenberg crit icizes the use of Giovanni Pierluigi da Palestrina's music as a model for counterpoint Despit e this, his method uses the cant us firmus and rhythmic species techniques associated with Johannes Fux's Gradus ad Parnassum a central text in contrapuntal pedagogy that is closely associated with Palestrina's music Schoenberg also completes some exercises demonstrating the ru les he ha s given A computer program that is intended to e ncapsulate all of Schoenberg's rules for two voice, f irst species counterpoint has been used to analyze some of these examples and compose its own T his program's analysis and composition s help to highlight certain issues with Schoenberg's rules and show that he often did not fo llow them completely Why given that he treats his own rules so fluidly, Schoenberg might teach counterpoint using these strict pedagogical devices becomes clearer Schoenberg's pref erence for proceeding systematically meant that each option must be tried in turn The cantus firmus and rhythmic species techniques enabled him to do that more easily and allow ed the student to learn this fluid approach first with simple problems first Professor Bret Aarden Division of Humanities PAGE 3 ! """ TABLE OF CONTENTS Preface Chapter 1: Schoenberg and the historical context of Preliminary Exercises 1 Chapter 2: Asclepius and Schoenberg's method 8 Chapter 3: Asclepius and the literature 28 Chapter 4: Analyses and conclusion 41 Appendix A: Software code 55 Appendix B: Program out put, graphs and scores 80 Bibliography 92 PAGE 4 ! # Preface Arnold Schoe nberg worked with editor Leonard Stein to create his Preliminary Exercises in Counterpoint until 1950 when he became ill, and died the fol lowing year. He entrusted the finishing and publishing of the book t o Stein, who did so in 1963 ( Preliminary Exercises in Counterpoint xiv ). The book was eventually published in the United States in 1969. Critical response to it was mixed, as it was both p raised and criticized for its use of the cantus fir mus and the rhythmic species closely associated with Johannes Fux's Gradus ad Parnassum (Rubbra 59; H. K. A. 79 ). In his textbook Schoenberg criticized the use of G. P. da Palestrina's music to which the Gradus strongly alludes, as a model to be used when teaching composition ( 223 ) In fact Palestrina's style had been a central notion in the history of counterpoint pedagogy in the academy for some time, as evidenced by the number of prominent counterpoin t manuals that attempt to capture and convey it (Fux; Jeppesen; Morris) many of which are mentioned in the rev iews of Schoenberg's book Schoenberg clearly criticizes the position given Palestrina's style in the tradition of counterpoint pedagogy in a pre face to his textbook In his capacity as professor at the University of California Los Angeles, he taught students with a range of abilities, and his general pedagogical attitude placed much emph asis on the German masters ( Arnold Schoenberg: His Life, Worl d and Work 420 ). Although Schoenberg is most thought of for his atonal music and twelve tone technique, he did n ot make it a central part of the pedagogical method embodied in his teachin g as a professor of composition Schoenberg loved tonal music, like t hat of Bach, who he pays some praise in a preface of his to his textbook by saying, "t here is no greater perfetion in PAGE 5 ! #" music than in Bach!" ( Preliminary Exercises in Counterpoint 223 ) Therefore, in stylistic terms, Preliminary Exercises makes use only of di atonic major and minor scales and its rules require harmonic motion from tonic to dominant chordal areas and then back again with particular motion in the bass at stopping points, in contrast to much of the music that came both before J. S. Bach's music an d af ter Schoenberg's The bo ok is, however, distinct from other counterpoint texts in multiple ways, such as its use of intermediary tonal regions in its exercises, which promotes facility with modulations, or its technique of alternating cantus firmus tre atment between voices in order to begin to achieve greater overall freedom in writing, or its instruction of canon and imitation without reference to a more specific form or genre. Schoenber g's pedagogical method in the classroom involved according to L eonard Stein ( Preliminary Exercises in Counterpoint xi ), either bringing example portions of music in from the repertoire or improvising music himself during class in order to highlight particular compositional issues. As this music would exist in varying degrees of complexity, the process of trying different solutions to a given compositional problem may potentially uncover a great many possibilities. By adopting the cantus firmus and rhythmic species into his counterpoint manual, Schoenberg was able to pr oceed through compositional issues that aris e in his examples in a systematic way, weighing all options and judging them based on multiple, sometimes contradictory, concerns. In this way Schoenberg was able to both criticize the counterpoint pedagogy that had gone before and borrow what was useful from it at the same time. In my study of this text, I took Schoenberg's rules from the first chap ter of his text and translated them into a prog ramming language calle d Scheme. I did this as a way PAGE 6 ! #"" of trying to get hold of this more systematical view This began as an attempt to completely automate the composition of co ntrapuntal music according to Schoenberg's rules. What I ultimately created is a way to both automatically generate counterpoint examples in this fir st species style and analyze examples that have already been composed for rule violations. I use these capabilities of my software which I have named Asclepius, to demonstrate how Schoenberg was making conscious compositional decisions instead of randomly choosing from a list of more per fect options. This is demonstrated by highlighting the difference between Schoenberg's complete d examples and Asclepius 's and by an analysis of Schoenberg's examples using Asclepius In analyzing some of Schoenberg's exampl e cantus firmi and counterpoint melodies with this software and using it to auto matically generate counterpoint melodies for the cantus firmi in his examples and compare them to Schoenberg's counterpoint melodies I attempt to show that Schoenberg often di d not follow his own rules and composed his examples using more than a li teral and strict practice of tho s e rules set out by him in that first chapter. I then argue that, since his method of composition involved the weighing of values in context rather tha n the strict and simple application of prohibitory rules, the cantus firmus and the rhythmic species in his counterpoint manual enabled him to retain his familiar pedagogical method of exploring and weighing different options in different contexts in a ver y systematic way even while decrying the Fuxian legacy of the veneration of Palestrina PAGE 7 ! $ Chapter 1 Schoenberg and the historical contex t of Preliminary Exercises T he fundamental task of this project was to take the text Preliminary Exercises in Counter poin t by Arnold Schoenberg and translate it into the programming language Scheme in order to see if this yielded melodies that were very similar to or different from those by Schoenberg's hand. We will take a look at Schoenberg, a bit of his history, and h is text on count erpoint and what it has to do with Asclepius's significance. We begin with some biographical information on Schoenberg as relates to his situation as an artist, theoretician, aestheticist, and teacher. Arnold Schoenberg was born on Septemb er 13, 1874 in Szecseny, Hungary. ( Schoenberg: his Life, World and Work 15 16) His middle class father and mother loved music, and gave their childre n at least the standard middle class education which included some instruction in music. Both he and his brother ended up claiming music as their professions. Arnold's father died when he was fifteen, and so his education began to suffer. Still, he studied violin in school and then switched to cello. He also wrote his earliest compositions around this time. H e played cello with a chamber ensemble of friends, for which he composed some of his earliest pieces. Schoenberg became acquainted with Alexander von Zemlinsky, a fellow musician, and the two became close friends. Schoenberg entered some competitions with pieces he had written, and was characterized as a Brahmsian, though Schoenberg was also very interested in Wagner's music. Schoenberg was very active in the social and cultural life of Vienna and would often get into group discussions of Wagner's music. He spent a short time employed with a bank, but ended this employment to never again be supported by anything other than PAGE 8 ! % musical pursuits. He eventually composed and premiered his string quartet in D major, which received some attention. Schoenberg had begun work on his large Gurreliede r, but conducted, arranged and scored light music to sustain himself ( Arnold Schoenberg 21). Schoenberg was married to a sister of his friend Zemlinsky and continued to score operettas and light music until he received some att ention from Richard Strauss, who arranged for him to receive a scholarship with the Liszt Foundation and recommended him as teacher of composition to the Stern Conservatoire. And so, with these works as well as his Verklarte Nacht and Pelleas und Melisande Schoenberg had established himself as one of the top contemporary composers in W estern Europe in the early twentieth century. His work was e xpressionistic and at times chromatic, but still more similar to the music of his contemporaries than dissimilar. While still scoring his Gurrelieder, he began taking on more responsibility as a teacher. He took on many students, amongst whom were Anton von Webern and Alban Berg. He began an off and on friendship with Mahler and began and dissolved a club for musician s including the other composer. He wrote his Harmonielehre and began to draw and paint. He wrote his String Quartet No. 1 and had it performed which seemed to push the boundaries of the contemporary expressive musical language. He broke with the language of the times dramatically with his opus 11 piano pieces, but at the same time was arranging works of Bach and Handel for orchestra. This is an aspect of Schoenberg that tends to be forgotten in light of his notori ety as the originator of twelve tone compos ition or the more radical atonal language of his Pierrot Lunaire This work was premiered in 1912 and won Schoenberg some fame as a composer. After this work he did not have a major release for some eight years. During this time, World War I brok e out in PAGE 9 ! & E urope. Schoenberg was in Berlin at the time, and served as a soldier at different points. He resumed teaching after the war. Stuckenschmidt declared Schoenberg never gave in struction in modern music, and contemporary works were rarely and only exceptional ly s tu died. He concentrated on the period of the flowering of Western music, from Bach to Brahms. The works of the Viennese classics, those by Haydn Mozart and Beethoven, were the centre of all technical, formal, harmonic and aesthetic teaching. Schoenber g always directed his pupils back to their works. Schoenberg did little composing during this period, teaching a lot and forming a small, closed society of musicians for performances of more challenging modern fare by composers like Debussy and Stravinsky. In the summer of 1922, h e is quoted as saying "I have discovered something which will guarantee the supremacy of German music for the next hundred years." He had, according to his own admission, developed the method of composing with twelve tones. This mu sic is characterized by the use of the twelve tones as part of a set that one iterates through, not using a note more than once before all other eleven notes have been used. This is the kind of music most readily identified with Arnold Scho enberg as a comp oser, and he did go on at this poin t to compose a number of twelve tone pieces, only a couple of which are his opus 23 piano pieces and his win d quintet. Schoenberg moved to L eipzig and composed a few more pieces there, also finishing his orchestration of one of Bach's E flat organ prelude and fugues. Once Worl d War II broke out, Schoenberg and many other Germans fled. Schoenberg went first to France, then to America. PAGE 10 ! Schoenberg taught in Boston and then moved to Los Angeles for the benefit of his health. Some of the first music that he composed in America for American audiences was relatively straightforward tonal music for American school orchestras. However, Schoenberg also quick ly returned to his newer twelve tone language with a number of compositions. Schoenberg himself writes "It was not given to me to continue writing in the style of Verklarte Nacht or the Gurrelieder or even of Pelleas und Melisande Fate led me along a harder road. But the wish remained constantly within me to return to the earlie r style, and from time to time I give in to this desire." Schoenberg accepted a professorship at the University of Southern California, but quickly left and joined the faculty of the University of California Los Angeles. He taught there and then retired, c omposing many works ranging from very chromatic and atonal to semi tonal for the rest of his life. He also began some more theoretical treatises, and even finished some of them. These were all geared in the manner described in the earlier quote about Schoe nberg's general pedagogical lexicon. That is, they were oriented toward the older language of European art music, the language of the German masters, and not his newer chromatic language, with the exception of his text Style and Idea where in a number of essays he makes significant discussion of the method of composing with twelve tones. One of these texts is Prelim inary Exercises in Counterpoint the book used for Asclepius. More specifically, according to the book's editor Leonard Stein, the book "had it s inception in the counterpoint classes conducted by Arnold Schoenberg at the University of Cali fornia, beginning in 1936."( xi ) By the time of Schoenberg's passing, it had all of its examples completed, but the last third of the book was left a rough draft and some of the end of the book had no text at all. Schoenberg, in hi s own preface to the PAGE 11 ! ( book, made it clear what he intend ed the purpose of the book to be: "t he theory of counterpoint will here be treated in quite a different way. It will not be consid ered as a theory at all, but as a method of training and the foremost purpose of this method will be to teach the pupil so that he becomes able to use his kno wledge later when he composes." This statement of Schoen berg's shows a kind of practice oriented p oint o f view. T hrough a systematic process of learning that Schoenberg is desc ribed as preferring ( xi), rules are learned that, given the situation, can be discarded or changed in small or large part rather than dicti that must be obeyed He describes a v iew of the history of music, over which the laws that, to some extent, govern composition change When undergoing this method of training, he says, "o n the one hand, we will make [our laws], but on the other hand, we will reduce their strictness likewise stepwise ( 222) Schoenberg is arguing in various places in his text that these rules he is setting forth should not be strict rules at all but rather rules that can be relaxed or enforced according to the various conc erns of the composition student. O ne m ay interpret from this that Schoenberg's contrapuntal language as set forth in his Preliminary Exercises cannot be clearly separated into what is grammatically correct and what is not and is therefore no langu age at all However, as Schoenberg himself say s, these exercise s are not meant to be published ( 14) suggesting that the standard for what is grammatically correct may not be very high. In other words, this strict contrapuntal paradigm that Schoenberg has created is not for acceptable composition, but rather for the learning thereof. The rules to be learned in this text are for creating grammatically co rrect melodies, analogous to sentences in a language, and these of a simple type. T hese rules are to perhaps form a subset of flexible rules to be used under the larger rules of harmony PAGE 12 ! ) An important thing to realize about Schoenberg is that his empirical approach to music, particularly his pedagogical frame and methods, are not exclusive of a more scientific understanding of music as a language, even th ough he considered music an art and himself an artist. This is similar to the difficulty, or at least the seemingly apparent misguidedness, inherent in considering what a poet does from a scientific point of view. Yet much of a poet's effectiveness rests o n his or her work's reference to our understanding of sensibility, or what is grammatical and what is not, even though that work may rarely obey its rules. Similarly, much of a novel piece of music's effectiveness rests on its reference to our notions of w hat is grammatical or not in the language of music. In his book Style and Idea Schoenberg likens a musician's taste for more modern music as opposed to older music to an ox's ta ste for grass as opposed to hay: "...[T] he season is the main thing... in the winter he appreciates hay, without rejecting grass. But the uneducated and untalented musician is timeless; he knows only trends, and rejects one in exactly the same offhand way he accepts another." ( Style and Idea 373) Science, in its bro ader sense, and a rt are not sepa rate for Schoenberg, but both are necessary for a full and mature appreciation of and engagement with music. "Only a thorough knowledge of the styles makes one conscious of the difference between 'mine and thine'. And accordingly one cannot really understand the style of one's time if one has not found out how it is distinguished from the style of one's predecessors." ( Style and Idea 377) I n his Syntactic Structures the linguist Noam Chomsky states that a finite state grammar may yield simpl e grammatically correct sentences in English, but that through quite simple means o ne may create sentences that are not representable as a finite state language. M uch as English is demonst rated to not be a finite state language even though PAGE 13 ! grammatically co rrect sentenc es can be created with a finite state grammar, Schoenberg's contrapuntal language is a finite state language even though larger and more complex pieces of music cannot be accounted fo r through the means of a finite state grammar. PAGE 14 ! + Chapter 2 As clepius and Schoenberg's Method My software creates and analyzes music in the Western tradition of Common Music Notation. Asclepius, the name I have given this software composes two voice, first species counterpoint exercises according to the rules set fo rth by Arnold Schoenberg in his text Prelim inary Exercises in Counterpoint Counterpoint can be defined as "the coherent combination of distinct melodic lines in music ( Whittall ). In Schoenberg's m ethod of learning the first species a cantus firmus, L ati n for "fixed song", is created using only notes equal in duration to an entire measure, and then a counterpoint melody is composed against the cantus firmus. Species counterpoint is a way of dividing up counterpoint exercises by rhythmic complexity. The method is heavily associated with Johannes Fux and his own text on counterpoint entitled Gradus Ad Parnassum Fux prescribed five levels, or species, of rhythmic complexity. The first species which is that composed in by Asclepius, places one note in the counterpoint simultaneous to each note of the cantus firmus. In the second species, two notes are placed in the counterpoint for each note of the cantus firmus. In the third, there is a ratio of four notes to one. I n the fourth, t he ratio is one to one, bu t notes are offset by half their duration The fifth species is a free mixture of each of the previous four. As per Schoenberg's contrapuntal method, I have elected to formulate 8 ambiti, 1 each for treble clef, bass clef, and the C clefs of the choir voic es, including mezzo soprano and baritone. Each of these voices has been assigned midi numbers PAGE 15 ! c orresponding to, roughly, the 11 th that surrounds the top and bottom lines of the particular clef. There are a few concepts that are very important for an under standing of the basics of how Asclepius works. At its lowest level, Asclepius deals with MIDI numbers. This is a set of numbers 0 to 127. The number 60 is designated as middle C, and each half step above or below is one MIDI number higher or lower respecti vely, such that the D a whole step above middle C is 62, the E is 64, etc. An ambitus is simply a particular range of these midi numbers within which a melody may be written. These ambiti are often associated with a particular clef, or designation of a par ticular line on the 5 line staff as middle C with the C clef or the F below that with the F clef. Theoretically, These clefs may be fixed on any of the five lines of the staff, but they are often, such as in Scheonberg's text book, used in only a few confi gurations that correspond to the four voices of the choir. The scale degree is a number that signifies a position in a major or minor scale. The tonic is assigned the number 1, and each step in the scale away from the tonic is a correspondingly higher or lower number, such that the octave above the tonic would be designated as the number 8. Only the major key system has been implemented in my software to date. Schoenberg's method does indeed cover tonal use of the minor mo de in some detail, but I ha ve res tricted my efforts to two voice, first species counterpoint in only major keys as is outlined in the first chapter The major key is much simpler to implement, as will be seen when discussion of cadences and their structure has taken place, because of the major scale's lea ding tone degree 7 There is a half step between the seventh and eighth degrees which enables effective dominant tonic motion and causes the dominant triad to PAGE 16 ! $! be major. The major scale also has a raised 6 th which helps to ensure success ful, fluid me lodic motion by avoiding an augmented second between the sixth and seventh degrees In the Aeolian minor mode, both of these degrees must be chromatically raised from time to time, according to certain rules and procedures that Schoenberg does indeed lay out in his text. I have left this portion of the book, as it comes a bit later, for future implementational efforts. It would be possible to do all of the work of implementing Schoenberg's method while using MIDI numbers as our working unit of data for pitch. Schoenberg himself, however, makes quite a bit of use of tonal degree numbers. Taking his lead, I have elected to do the same. There are a number of interesting questions tha t arise when trying to translate this and other musical notions in to Scheme, the programming language Asclepius is written in How does one lay the degree numbe rs of a particular key over a range of MIDI numbers ? How does one la bel degrees that are lo wer than the lowest tonic note ? How does one determine the octave of th e first tonic ? The way I have gone about this is to first find the lowest MIDI number in an ambitus that is part of the desired key If this is not a tonic degree it is taken to be less than one octave lower than the first degree. In other words, Asc lepius always assigns the first tonic up from the bottom of the ambitus in question to be the central tonic note Most often, of course, as it works from the bottom of the ambitus to the top, the first member of the key that Asc lepius will find present in the am bitus is not the tonic. Once this bottom tonic is found, all of the appropriate MIDI numbers around it in a given voice may be associated with the corresponding degree numbers, according to the intervallic structure of the major scale. In this way, one ma y make use of a system for PAGE 17 ! $$ working directly with tonal degree numbers, and the differences thereof, between two voices. As all of Schoenberg's two voice exercises use adjacent voices, this will prove to be a convenient system to use; were greater overall r anges or non adjacent voices used, differing registers would require the direct use of some kind of absolute system like MIDI numbers, or perhaps some more intelligent system for discerning the register of each voice and the correct corresponding MIDI numb ers. B y the end of the procedural chain of events evolved by Asc lepius such absolute values are in fact used but given the limitations of this kind of compositional problem, using degree numbers is clearer and more useful. It is important to note that thi s is not an either/or sort of situation; one of the beauties of formalizing procedures of any sort in software is that such an association easily works in both directions. This means that Asclepius may move from an ambitus of MIDI numbers to appropriate de gree numbers just as easily as it may translate data in the reverse, from degrees to MIDI numbers. The manner in which Schoenberg goes about instructing the student using his manual to begin completing counterpoint exercises is one of restriction rather th an prescription; The overwhelming emphasis lay s on what not to do rather t han what to do. Schoenberg spells out several such rules for melodic motion, all of which have been implemented in Asclepius. There are a great many connections between this way of p roducing syntactically well formed strings of data and theories (and attempts at implementation thereof) within the domain of linguistics, and, as we will see, there are also a number of other automatic composition software packages that use the same gener al method as Asclepius. PAGE 18 ! $% Schoenberg's first such rule ha s to do with the use of any leap of a tritone. He begins by stating that intervals of a diminished fourth or augmented fifth, specifically, should be avoided at all costs, which can well be accomplish ed, in part, by using only the notes of the diatonic scale. He goes on to say that the only such interval that exists in our diatonic scale is the one between the fourth and seve nth degrees of the major scale. A kind of rule, which shall hence forth be refe rred to as a 'constraint', would be simple enough to implement in Asclepius in order to prevent any fourth degree from occurring alongside any seventh degree. This constraint acts as a kind of filter, taking in whatever input, which in this case would be a string of degree numbers in a particular order, and returning a true or false value, signifying that the string, in this case, is either truly void of adjacent tritones or not. However, this constraint, which in the source code is referred to as 'tritonel ess?' and returns a boolean '#T' or '#F' value, does a little more than merely screening for adjacent tritones; Schoenberg says that one should avoid inserting one or more tones between the fourth and seventh degrees. He refers to this as a compound triton e. Now, obviously, this simple dictum -"Those [tritone] progressions should be avoided where one or more tones are inserted between the 4th and 7th, or between the 7th and 4th tones of the scale. They shall be calle d compound tritones"( 6 ) -cannot be ta ken absolutely literally. At very least, if one uses both the fourth and seventh degrees at all in a single melodic line, there will exist such a compound tritone, even if a great many tones are inserted between those two offenders. Rather than simply leav e the discussion of tritones there (or, alternatively, using more text more explicitly to explain the situation), Schoenberg elects to give examples; he gives many blatantly erroneous ones and shows PAGE 19 ! $& them to be so, followed by some more dubious ones which a re labeled with words like "tolerable", "usable", or, more positively, "correct". From these, Schoenberg seems to suggest to the reader that if the other tones inserted in the melodic progression involve any change of direction or happen to metrically emph asize other tones in a longer stepwise progression including the two tones, they are acceptable. As his examples of the latter sort involve more rhythmically diverse melodies and only progressions from degree four to degree seven (instead of seven to four) such accommodations have been made within the code for tritoneless? that these scenarios are allowed for (i.e. not constrained). Schoenberg then goes on to offer a constraint quite similar to the first: "Strictly to be avoided are leaps of the dissonant intervals of a seventh, ninth, eleventh, etc." ( 7) As with the previous constraint, such adjacencies may be easily avoided, but the stipulation continues: "These intervals should also be avoided if they are produced by two successive leaps of intervals tha t are allowable, in the same direction. They then become compound dissonant leaps" ( 7) This is easy enough to implement; simply, in no way shall a given note and the note directly after it or a given note and the note 2 positions after it the degree numb er of the second being subtracted from the degree number of the first, have a difference in of six, eight, or nine. The next constraint presented dictates that the motion of a melodic line not be in one direction or the other for too long. One minor but cr ucial det ail that must be decided when implementing this constraint is how one regards repeated pitch classes at the ends of such a series that continues in the same direction for some time. Although Schoenberg did not explicitly discuss this, some decisio n must inherently be made. It has worked well to regard the last note of such a repetiti on that is followed by motion in the opposing PAGE 20 ! $' direction as the end of a di rection while also regarding that last note as the beginning of another direction. In other w ords, the repetition of a note continue s to be counted as motion in the direction by which that repetition was approached Schoenberg then instructs that "After a leap one should avoid proceeding in the same direction, even stepwise. Instead, the leap sho uld be balanced by movement in the opposite direction either stepwise or in leaps" ( 7) Again, we are also supplied with a number of examples, many of which make clear implications as regards some more exceptional cases. Within these examples, it is clear, for example, that Schoenberg does not intend for this rule to apply to leaps of a third. It is also clear from an initial look at these examples that at least certain consecutive leaps in the same direction are acceptable if they form a compound consonanc e such as a sixth or octave; this compound interval, however, must thereafter be balanced by motion of some sort in the opposite direction. These implied aspects for deciding what is or is not a Schoenbergian balanced leap are implemented in Asclepius. The text goes on to make a small discussion of the use of the melodic sixth, both in the context of the exercises in the form prescribed by the book and in the general sense and history of contrapuntal theory. In particular, a distinction is drawn between Sch oenberg's own call for avoidance of all leaps of the sixth and what he calls the allowance of an upward minor sixth by t heorists of traditional counterpoint" ( 7) Implementation of this constraint is simple enough; one simply disallows adjacent tones that have degrees different by 5. This constraint is made more interesting, however, by the fact that, according to Schoenberg, "Of course, in emergency... both minor and major sixths may be used, both up and down" ( 8) So, in other words, this constraint is o nly to PAGE 21 ! $( be observed when a well formed string is yielded. If the constraint, in a given case, would actually remove all well formed strings, it is not used. More will be said about this kind of variable constraint selection in the future when we discuss Asc lepius's constraint tier system. Another constraint checks for the use of broken chords in a given melodic line. Schoenberg states that "Broken chords should be avoided as much as possible" ( 8). This proves to be interesting to implement The first step is to form what in Asclepius is called a transposed chord, which is the degree of a given note and the degrees of the second, third, and fourth notes after it in a melodic line, sorted in ascending order, duplicates deleted, and transposed such that the lowe st note is either 1, as in 1 3 5 or 1 4 6, or 0 if the chord is a seventh chord, such as 0 1 3 5. T his transposed chord is then checked to see if it is equal to any known chord formation. If so, the string returns a false value when passed to the constrain t; if the constraint is called successively on each four note group within the melodic line, from beginning to end, and does not find any such chord formations, the n a true value is returned, signifying that the constraint has been satisfied. Again, with h is next stipulation, Schoenberg shows that although his textual support is good for the student reader it is still rather general, and he leaves it to his examples for the reader to search through to find more explicit instruction for more peculiar situat ions. It concerns the amount of monotony in a melodic line, or a particular aspect of it, namely, the repetition of individual notes. Rather than give hard numbers as limits for these things, one may derive from his examples that Schoenberg wanted no more than two of any particular note within any given eight notes. The implementation of this constraint is straightforward enough. PAGE 22 ! $) Another aspect of melodic monotony that Schoenberg addresses in his text is a line's width of compass over time. Just as with the previous constraint, Schoenberg leaves it to the reader to search through the examples in order to try and glean specific rules, stating in his text that remaining within the range of a fourth or fifth for "too long" is to be avoided. Judgements in this r egard based on his examples are tenuous at best, but the working values implemented in Asclepius are such that to remain within a fifth over the course of seven notes or a sixth over the course of nine notes returns a false' value The implementat ion of the next constraint, which prevents sequential repetitions, forces decisions with regard to the nature of what does or does not constitute a repetition. These decisions require one to consider s ome theoretical precepts that are almost subliminally consider ed when composing by hand or listening to or analyzing music. In his his definition reads : "repetitions of a succession of tones at another degree (a second, third, fourth, etc., higher or lower)" ( 8). Yet consider the following melodic progression in tona l degrees: 1 2 3 4 5 6 0 1. One would not traditionally say that such a progression constitutes a sequence at all, yet, on a strict level, the progression is completely a repetition of a 2 note cell such that 1 2, 3 4, 5 6, and 0 1 all transpose to this sa me cell. It would be desireable to formulate our grammar such that this output is not constrained. The working implementation of Asclepius accomplishes this by simply limiting the length by which a cell may qualify as a sequence to a minimum of 3. This wou ld be inadequate if, for example, we added one note to our previous example to make it 1 2 3 4 5 6 1 0 1. That this example still does not seem exactly like a sequence while technically qualifying as one within Asclepius should and does cause concern th at perhaps our theoretical formulation of this particular constraint could be improved. Even PAGE 23 ! $* so, this constraint merely searches for such repeated transposed or untransposed cells of any length from 3 notes to half the length of the entire string of notes, inclusive. This proves to be adequate for the moment There is also a constraint implemented in Asclepius that does not arise directly fr om Schoenberg's dicta The fact that these instructions include explicit provisions that allow for steps and leaps in the opposite direction of any leap (instead of only steps), combined with the other constraints mentioned thus far, causes the output generated to be less likely to contain movements by step than is desirable A working solution to this problem that has be en implemented in Asclepius is a constraint that limits the number of consecutive leaps that may be present in a melody to two. This, at least in my own view, is sufficient to ensure that enough of the motion in the melody is stepwise so as to not stand ap art from the examples that Schoenberg himself provides. These constraints together form a grammar for producing a single series of pitch classes according to Schoenb erg's stipulations in his text. The rest of these constraints are different in that they c ontribute to what Schoenberg calls the "Establishment of Tonality" ( 12) They are largely dependent upon a given melody's position with respect to other simultaneous voices. Asclepius uses the list of all voices, starting with the number of the particular voice being generated at the time, followed by a list, top to bottom, of all voices present in counterpoint to it. We will discuss the operation of the constraint s applied to a single voice but it is important to remember that these particular constraints can apply to both one and more melodies. The implementation of Schoenberg's rules for tonality consists of three sepa rate constraints, one each for the first, penultimate, and ultimate notes of a given melody. The PAGE 24 ! $+ overall scheme that Schoenberg lays out i s intended to firmly establish the the tonic harmony on the first and last notes and to make sure that the final tonic harmony is directly prec eded by the dominant or leading tone harmony of the same key. Only certain tonal degrees are allowed for each, an d a special restricted set of tones is u sed if the tone happens to be in the bottom voice For both the first and ultimate tones the only tone allowed in the bottom voice is the tonic class. If the melody is any other voice but the bottom one, either the first or ultimate tone may be degree 1, 3, or 5 of the tonic harmony. The penultimate tone may be either degree 5, 7, or 2 in the bottom voice, or 5, 7, 2, or 4 in any other. One particular constraint on the first tone of a melody was implemented out of n ecessity, after a prolonged period of consternation As it turns out, if the 1 degree in a given ambitus is within five to ten semitones of the bottom of the ambitus and the cantus melody is on top, and the first tone of the melody is degree 2 in the ambi tus, the melody in the adjacent voice directly below it will not be able to sound a parallel tone at degree 1 as its first note, as it is required to. Therefore, if all of those conditions laid out above are the case, degree 2 is constrained from the firs t tone of the melody. Asclepius uses a two tiered system of constraint satisfaction. There are two sets of constraints; in one set, we have the following list of constraints: allcfc onstraint ? first? nobigbadleaps? tritoneless? samedirtoolong? balancedlea ps? nosixthleaps? nooctaveleaps? noadjtriadsor7thchords? nonoterepetition? rangewideenough? nosequences? no3consecutiveleaps? penultimate ultimate? PAGE 25 ! $, And in the other, we use the same list, minus the following constraints: nosixthleaps? nooctaveeaps? The se two tiers of constraints are used in such a way that sixth leaps and octave leaps are only used in situations where, without backtracking and changing any previously added tones, Asclepius has no well formed options when attempting to generate a melody. In other words, this ensures that no sixth or octa ve leaps are taken unless there i s no other option One could simply go about generating a melody by using one randomly generated number from the voice's ambitus after another each checked each time for constraint violations; This kind of process has a number of drawbacks as became clear after trying to work in this way for some time. For example, before one even begins with most of the constraints we've discussed so far, the MIDI numbers being generated would have to be converted into degree numbers for a given key and voice. In any given key, only 7/12ths of each octave will actually be notes that are in the desired key; in this way we add a lot of computational overhead to our algorithm before we even b egin using our constraints to parse our random input. Asclepius works in a better way. At every point in the generation of a melody, it generates a list of all of the well formed degrees or degrees that do not violate any of the constraints, in the voice that exist, even taking into account whatever previous notes may exist in the melody. This avoids many problems. It also means that when checking to see whether or not a given melodic fragment has any well formed notes that may be in the PAGE 26 ! %! next space, we li mit this search to only the tones of the relevant scale. A corollated procedure exists within Asclepius for the 2nd tier constraint list. Using t his prepared input at every step Asclepius begins to generate a "cantus firmus" melody in a particular voice and key for a particular length The user supplies these top level inputs and then Asclepius begins with the first tones of the melody. During this process, Asclepius keeps two lists in memory. One is the list of tones it has thus far come up with for its cantus firmus, and another is an important list called bad degrees. Backtracking is an importan t feature of Asclepius as a constraint satisf action problem solver. In order to understand the backtracking algorithm that Asclepius uses to find suitable compos itional reroutes as it runs into snags and dead ends while trying to generate melodies, one has to understand the Asclepius's list bad degrees This list is actually a list of lists; each list within the larger list consists of a first number that is the p osition in the melody, from 1 to whatever length the user specifies, followed by one or more numbers which are designated to be the degrees that have been tried but yield zero well formed possibilities for the following position. If Asclepius, while genera ting a melody, comes to a point where there are no available well formed tones at a given position, it removes the note in the previous position, and amends the bad degrees list to add that degree number to the list element for that position. Asclepius cre ates its list of well formed degrees for the current position, given whatever melody has been generated previous to that position. However, Asclepius also for any bad degrees at that position; if a list element exists for the position, its elements after i ts first are removed from that list of well formed degrees. If a suitable degree can PAGE 27 ! %$ be found the process con tinues filling in the cantus firmus, retaining these list elements in bad degrees throughout the generation of the melody. If at any point it is f ound that no degrees are well formed the bad degrees list element for the prior position is amended, and all list elements for the current positions are removed. This yields a process in which every possibility is searched through systematically until a c omplete, well formed string is generated if one is possible. Now that we have all of the necessary procedures in place to randomly generate a single string of whole notes that is melodically well formed according to the constraints that Schoenberg lays out in his counterpoint text, more procedures need to be implemented to automate the execution of fi rst species counterpoint exercises of the type Schoenberg provides examples of. Asclepius contains such procedures, specifically four other constraints on how one voice, the counterpoint, may be formed in relation to another, the cantus firmus. These constraints are added into a system of procedures that, otherwise, greatly resembles the system we just discussed for the generation of a single melody. One distinc t feature of these new constraints is that they take the previously formed cantus firmus as an argument. In other words, these constraints must "be aware" of what the cantus firmus is in order to function correctly. The first of these governs the interval s that may be allowed for each simultaneity formed by the cantus firmus and counterpoint. In Asclepius, the only simultaneities allowed at either th e beginning or end of the first species exercise s are the unison, third, 5th, or any octave transposition th at meets all other constraints imposed. I n between, these intervals and the sixth are allowed. The sixth is excluded from the beginning and the end because the bottom voice must contain the tonic in both these positions, yet both PAGE 28 ! %% positions should contain o nly tones of the tonic harmony; meeting these two constraints simultaneously would be impossible if a sixth were used. The next set of constraints has to do with the section of his text that Schoenberg calls "Independence of the Voices". He says "t he onl y rules demanding the interdependence of contrapuntal voices are these: that the voices shuld meet at certain points in comprehensible harmonies, and that together they should distinctly express the tonality ( 9). Even though the previous constraint does f it under this description, it is discussed well before this poin t in the book ( 1). This set of constraints has to do with parallel motion between the voices. Schoenberg draws a distinction between two different kinds of parallel motion to avoid, called op en and hidden. Open is defined as parallel motion from one particular interval between voices to the same interval at the next position in the melodies. Hidden motion is such parallel motion including different intervals between voices at adjacent position s. Both of these kinds of motion, though they should not pervade, are fine, and usually unavoidable to some extent, when they use imperfect consonances. Open parallel motion, however, between perfect consonances such as the fifth or octave, is to be avoide d. As for hidden parallel motion involving perfect consonances, Schoenberg makes clear through his examples that one should avoid moving by parallel motion from an imperfect consonance to a perfect consonance. Schoenberg addresses a case he refers to as the so called 'horn octaves' and 'horn fifths'" ( 10) As he says, the constraint allows for their unrestricted use. To be specific, the horn octave consists of an upper line moving by step while a lower line alternates between forming a fifth and an octave below the upper line, itself leaping by thi rd then PAGE 29 ! %& sixth alternatingly. 'h orn fifths' basically means that a fifth may be approached in the same direction as long as the top voice is moving by step. As implemented in Asclepius, these particular constraint s supersede the more general constraint on hidden parallel motion. Schoenberg writes at his clearest when he discusses the next constraint, that on the crossing of voices: Crossing of voices must be avoided. Though crossing is not wring it is in general t oo easy a way of dealing with problems. It is seldom necessary in these preliminary exercises, but later, in the more difficult exercises of contrapuntal composition, it may sometimes become unavoidable. Therefore it should be entirely avoided in these sim ple exercises and preserved for the more difficult ones. It should be considered a rule, then, in these preliminary exercises that a lower voice should never use a tone above a higher tone, and vice versa. This constraint is always enforced, then, as Ascl epius generates these exercises, and the rule is simply that the voices are never to cross. U sing the voice list the potential problem of how to keep track of crossing at unisons is avoided. The next constraint was a decision on my own part, rather than a response to any particular dictum of Schoenberg's. The closest he comes to it is in his discussion of parallel motion versus contrary motion in general: "Parallel 3s and 6s are never wrong, though as mentioned before, parallel motion should not be used fo r too long a time. (b) Contrary motion is that in which the voices move in opposite directions. It produces a greater degree of independence than parallel motion." Here, he suggests the general superiority of contrary motion in holding up "independence" of the voices as a virtue. I PAGE 30 ! %' have taken this interpretation and implemented within Asclepius a preference for contrary motion. This is achieved through the implementation of a general constraint on parallel motion and its enforcement using the 2nd tier of th e constraint tier system already implemented, effectively achieving a first preference at every stage of counterpoint melody generation for motion contrary to that of the cantus firmus. Asclepius uses two new groups of constraints for counterpoint generati on that closely correspond to the first two groups of constraints used for the cantus firmus. In fact, these two groups of constraints mirror those two previous groups in all respects except where the counterpoint constraints are concerned. Both of the two new groups contain all of the counterpoint constraints except for the constraint on voice crossing. As stated, this constraint exists solely within the group of second tier counterpoint constraints, which serves the purpose of giving Asclepius a moderate predilection for contrary motion. The cou nterpoint is then generated in this way The most impor t ant distinction between the cantus firmus procedures and the counterpoint procedures is that the string that the cantus firmus procedures return is then suppli ed to the counterpoint procedures as an argument. Again, this is because the procedures for counterpoint generation, particularly its constraints that are not used for cantus firmus generation, must be "aware" of the other line in its entirety before begin ning to constrain anything at all. Note that this is not a n arbitrary decision, but is a necessity due to the nature of the constr aint. The typesetting of the music that Asclepius produces is accomplished by way of a language called GNU Lilypond. Asclepius is itself written in Scheme, yet its purpose is, primarily, to write music that humans can read, so it writes its music in lilypond which PAGE 31 ! %( can then be rendered into score. Lilypond itself is a very large software project and is written in very many program ming languages. One of these languages, it just so happens, turns out to be Scheme. At one relatively high level of abstraction in Lilypond, all the lilypond code itself is actually represented in Scheme. This level of abstraction, though, happens to be ve ry complex to simply read through and try and understand anything about what is happening in the music. Most of it is typographical details such as line thicknesses or object positions. The developers of Lilypond, as one of their primary goals is to make L ilypond create beautiful looking scores, are steeped in these sorts of details. The end user, who might very often be a composer, would want to deal with as few of these kinds of details a s he or she could get by with. H e or she may, if forced, find it nec essary to deal with a bit of Scheme to tweak some typographical detail or other, but would generally want to concentrate more on the "stuff" of composition, and less on that stuff's exact positioning; pitches, durations, dynamics, articulations, mood indic ations, and so forth. To this end, those developers have created a language that is at an even higher level of abstraction than the Scheme representation. The language referred to by the name 'Lilypond' is that language. This is precisely the level of abs traction that Asclepius works within conceptually. So, rather than directly interface with the level of representation of music in Lilypond that is in Scheme, Asclepius simply translates its own inner representation of the music it generates to Lilypond an d writes this into a file of its own to be rendered. In summary, there are 3 levels of representation of the music that Asclepius generates that we are concern ed with; MIDI numbers, tonal degree numbers and Lilypond code. Asclepius takes all of the midi numbers in an ambitus, seperates out those PAGE 32 ! %) numbers that represent notes that are part of the desired key, and translates those midi numbers into the appropriate degree numbers. Using all of Schoenberg's rules and prohibitions as a kind of filter, randomly generated data is put through this filter. Only well formed data can make it through the filter. If at any point a dead end is met, Asclepius backtracks and tries other options. Asclepius can generate a cantus firmus in this way, and can then create a coun terpoint melody for it, using all of the same constraints plus some more. Once these melodies have been produced, they may be translated into GNU Lilypond for the purpose of typesetting them. This knowledge forms a basic sense of how Asclepius works. PAGE 33 ! %* Cha pter 3 A sclepius and the Literature M any projects that are similar in many ways to Asclepius have been undertaken. This particular kind of challenge has been taken up in serious ways for almost as long as usable microcomputers have been available to academ ics that might b e interested in it. This topic has been taken up in numerous other places (Nierhaus 7 ), and here we will review only some of its more current history Knowledge of these projects helps to shed light on both where particular configurations of Asclepius's innards may come from and what Asclepius may have to say about the collective project of using computers to automate composition in common music notation. Many authors, particularly those explaining and discussing projects that are similar t o my own, discuss the set of compositional problems that are presented by, as relates to our case, two voice, first species counterpoint. In doing so, they refer to these as constraint satisfaction problems A constraint satisfaction problem can be underst ood as a problem where one has many variables in a particular order that each have some domain of po s sible values. This ordered set of variables must have some arrangement of values that are allowed for by one or more constraints on how they may be (Ovans and Davison 1 ) These values need not necessarily be numeric, though, in our case, they do happen to be, or at least are r educible to numeric values. T his problem model fits our situation exactly. We need a s et of tonal degrees, the order of which satisfie s the appropriate constraints that Asclepius would apply. The domain for the d egree of each note is restricted to the diatonic pitch classes within the ambitus of the particular voice. PAGE 34 ! %+ Some of the a uthors who discuss projects that are similar to Asclepius devote some of their discussion to CSPs in particular. One set of these authors, Torsten Anders and Eduardo R. Miranda, in their paper "Higher Order Constraint Applicators for Musi c Constraint Programming", take a look at a number of projects that, in som e way or another, use constraint solution problems to to compose music automatically (Anders and Miranda 1 ). They write, "Each system provides three components, which are essential for a music constraint system: i) a music representation, where some aspect s (e.g., note durations or pitches) can be variables (unknowns), ii) a mechanism for defining constraints and for applying them to variables in the music representation, iii) a constraint solver which finds a solution for all the variables in the music rep resentation." ( 1) This model fits my software very well. Asclepius's code is more or less divided along the lines that Anders and Miranda set out. I n this paper the two authors argue for greater abstraction of code as a means of abstrac ting music theoreti cal concepts. For instance, a particular constraint o n the use of 6/4 chords should allow for the inversion under certain circumstances, such as the so called "cadential" 6/4 chord, which is a tonic 6/4 moving to dominant in root position. In order to do t his, one must look, on one level of abstraction, at the degree of the particular bass note in question, and on another, at the tonal area, or the R oman numeral used in a harmonic analysis perhaps, and also the metrical position This is an argument, essent ially, for a constraint that is dependent upon a number of other constraints. Each of these particular sub constraints operates with respect to different parameters on different levels of abstraction. It is important also that depending on the way in whic h the sub constraints are applied, the manner of the search that is conducted through the search PAGE 35 ! %, space must be changed. This is because these different constraints, in this case the different parameters just mentioned, require different implementations acc ording to these authors' model. They are trying to combine software packages developed by others in order to develop a larger scale constraint solver. The two authors go on to discuss the other projects that they have drafted into their service at some l ength, particularly with respect to the third aspect that they identify as "essential for a music constraint system" ( 1) They are concerned with the different ways that data can be accessed. These are the kinds of details of the workings of Asclepius that are available for those i nterested to view wit hin the source code itself in an appendix the present work but here we may say that each constraint that is implemented in Asclepius has its own method for accessing parameters of music, one that is appropria te to the given kind of constraint. Each constraint is supplied the data it needs to return a true or false value. What's ultimately important about Anders and Miranda's work here is the concept of using higher order constraints, and even requisitioning ot her projects to do so, to be able to say ever more complex and informative things about music analyzed/generated by a constraint system. The idea that different such projects may be used together synergistically in this way is exciting, and means that disp arate seeming projects needn't sit in isolation if only standard interfaces between the two can be created. Anders and Miranda's work is also important in that it gives a very succinct theoretical model for how Asclepius and other constraint based grammars for music composition work. The fact that Asclepius may be used for both analysis and generation of music is an important one. In fact, it is correct to say that these are really one and the same sort of PAGE 36 ! &! process. In its current implementation, Asclepius begins to generate a new melody by forming a list of all scale degrees from the desired key within the ambitus of the desired voice that do not violate any constraints. This list of possible values for the next variable to be assigned, the next position in the melody to be designated with this or that particular pitch class, is then assigned some random member of all the possible scale degrees that do not violate the constraints, or what are called the well formed degrees within Asclepius. This is functiona lly equivalent to a process where random input is supplied and then analyzed over and over. In fact, what is really happening is, to some degree, the reverse. The domain is analyzed and then a random member of what remains is supplied to the melody's next empty position until the melody is of the desired length. In other words, instead of random selection then analysis by way of constraints, Asclepius employs analysis then random selection thereafter. The effect however, is the same, only this alg orithm is faster than the former W hen thinking about the model of automatic composition implemented by Asclepius and many of the other projects discussed in the literature it is worth considering the generative sch ool of linguistic thought, championed by Noam Chom sky. In his book Syntactic Structures, Noam Chomsky lays out the foundation of mod ern generative linguistics (Chomsky ) His theories have undergone much criticism, and the field of linguistics presently remains somewhat divided over some rather fundamental issues ( Harris ) Chomsky elucidates some important terms : I will consider a language to be a set (finite or infinite) of sentences, each finite in length and constructed out of a finite set of elements ( 13) If one takes a "sentence" to be a set of elemen ts that is itself "finite in length and constructed out of a finite set of elements", this definition applies to PAGE 37 ! &$ what Asclepius does. The cantus firmus is, in this sense, a sentence of what may be referred to as the cantus firmus language, and the counter point a sentence of what may be called the counterpoint language. Chomsky is specifically concerned with English at points in this text, but he is laying out his theory of syntax with the intent that it may be applied more generally. He goes on to say "Th e fundamental aim in the linguistic analysis of a languag e L is to separate the grammatical sequences which are the s entences of L from the ungrammatical sequences which are not sentences of L and to study the structu re of the grammatical sequences ( 13) This is a reasonable analog to the practice of musical analysis. The fundamental aim in the musical analysis of a pi ece/fragment/corpus L is to sepa rate the sequences within L from the ungrammatic al sequences which are not such sets of L, and to study the structure of the grammatical sequences. It follows, then, that a given musical theoretical system is analogous to a "grammar". To this point, Chomsky adds "We thus face a familiar task of explication of some intuitive concept -in this case, the concept grammatical in English,' and more generally, the concept 'grammatical'." ( 13) Chomsky goes on to elucidate an elementary linguistic theory, one that he ultimately shows to be inadequate for his own purposes of discussing English. Chomsky calls this theory the finite state machine. He directs the reader to imagine a human being who is fluent in some natural language, say English, as such a machine. The machine has some initial state, under which it supplies an element of the sentence and then changes state. It repeats this procedure until it has completed the sentence. He then describes some probabilistic manner in which one may, at one given state, moving from left to right, have a probability table which would describe the likelihood of moving from this sta te to the PAGE 38 ! &% next by way of any one particular utterance, or rather by supplying any one value to a given element of the sentence. Such a table for each possible state would comprise, according to Chomsky's definition, a grammar, more specifically a finite st ate grammar, because it would "generate all sequences of morphemes (or words) that constitute grammatical... sentences, and only these." ( 18) Now, this model is problematic when applied to most natural languages such as English, and could be problematic fo r larger attempts at musical grammars. Chomsky goes on to lay the groundwork for a generative grammarian understanding of natural language syntax. Ray Jackendoff, a student of Chomsky's, and Fred Lerdahl have written a book, "A Generative Theory of Tonal M usic", that attempts to ad apt this work of Chomsky's for t he "language" of tonal music (Lehrdahl and Jackendoff xi) The central problem, in both cases, is that grammatically correct utterances can be of any length and may nest within one another recursive ly to an, ideally, infinite degree. We, however, face no such issue currently with Asclepius, as the length of each "sentence" is pre determined and its elements are completely homogenous and cannot be nested within one another. Chomsky shows some of th e problems of creating a finite state grammar for English in his Syntactic Structures, and gives a full pro of that English is not a finite state language in his "Three models for t he descr iption of language" There he begins to discuss the concept of the mod el of transformational grammar, a concept that has taken center stage in generative linguistics and remains a central focus of research to this day. Music theorists have attempted to adapt this notion to music as well (Durbin 353 ). However, just as Chomsky demonstrates the finite state grammar's usefulness for PAGE 39 ! && generating simple English sentences, Asclepius is meant to be a finite state machine for Schoenberg's Preliminary Exercises So, then, Asclepius is a constraint based finite state grammar for two voic e, first species counterpoint according to the rules in Schoenberg's text Preliminary Exercises in Counterpoint In contrast, grammars similar in concept to the probabilistic one that Chomsky describes have been developed for music composition as well. The se use the exact dev ice that Chomsky mentions, the M arkov model This is a probabilistic way of moving between states with percentage chances that are particular to the establishment of one of a finite amount of possible next states. In these systems, opt i ons prohibited by the rules can be prevented from occurring by being assigned a percentage probabi lity of zero. Both a constraint based approach and this one incorporate randomness to some degree. B oth are, in a sense, weighted randomness. However, in orde r to model many of the kinds of rules that are p ossibly modeled by a constraint based approach with a more purely probabilistic one like the ones described by Chomsky and implemented by Tanaka et al and also Fa rbood and Schoner, m any such rules would requi r e M arkov chains of higher orders, or so called second order (or higher) M arkov chains that operate based on probabilities for paths through more than just two adjacent states, as Farbood and Schoner describe ( 2 ). Other approaches such as genetic programm ing and evolutionary algorithms, have been successfully employed toward the goal of developing effective grammars for con trapuntal music, most often in the tradition of the Palestrina style (Madsen; Towsey et al ). Cheng Zhi Anna Huang and Elaine Chew ha ve developed a system of constraints for Palest rina style counterpoint that is intended to be used primarily for analysis rather PAGE 40 ! &' than automatic composition. These authors' software has a graphical user interface to implement man y different aspects of analy sis. T hey have used it on the music of Palestrina as well as that of several other R enais sance composers and they have come to some rather interesting conclusions about the ir stylistic tendencies. Of the three common components of constraint based musica l systems that Anders and Miranda identify, Huang and Chew's work (named Palestrina Pal) differs from mine in both the first and last. The representation of musical data that the authors use is primarily th e GUIDO typesetting system, which is a different b ut similar system to the one that Asclepius relies heavily on Asclepius uses its own internal list notation that is then only translated into Lilypond for typesetting purposes. Also, the method of constraint application used by Huang and Chew is different from that of Asclepius, as it is operating on preformed data and can be applied in any way it likes and to any grouping of GUIDO notated music. Asclepius must apply these constraints over and over in an iterative, backtracking tree search in order to crea te a well formed set of notes. The core of the systems both correspond to Anders and Miranda's second aspect of constraint systems, that is, the use of rules based in functions that accept a string of values and return a boolean true or false value signify ing whether the rule has been obeyed or not. David Cope has also recently published work on a constraint based first species counterpoint solver. Cope has perhaps achieved the most notoriety in the realm of automatic composition. His work is well known in the artificial intelligence community, and Douglas Hofstadter has even written a chapter in one of his book s ( 33 ). An early project of Cope's named EMI for Experiments in Musical Intelligence, works in quite a different way from all of the projects discus sed here so far. Rather than constrain PAGE 41 ! &( randomness to build acceptable strings of notes, EMI uses a corpus of some music (EMI has famously been used on corpora of Bach, Chopin, and Mozart's m usic) that has been undergone human analysis according to a phrase structure system Cope has developed called SPEAC ( 129 ). This corpus is broken up into very many pieces and then recombined somewhat randomly according to EMI's rules of recombination. EMI has been able to produce some convincing results ( Cope 33 ) that are much more musical than any project that uses a constraint grammar The recent project of Dav id Cope's that focuses on first species counterpoint is discussed in a paper of his entitled "A Musical Learning Algor ithm" Cope makes many aspects of the way his software, entitled GRADUS, works clear to the reader, particularly the ways in which GRADUS learns enough from examples, both suppli ed initially and learned from use over the course of runtime, to avoid backtracking, eventually completely. Cope sets up re strictive constraints that represent the rules of counterpoint. GRADUS then, whenever backtracking is necessary, saves the conditions, such as which intervals are in play, to a list of lists. This list of lists is then consulted at future junctures, and if the same conditions are eve r come across again, GRADUS consult s this list and rule s the offending values out, saving time that would have been spent backtracking through the melody Over time, this list of lists grows until all situations that would neces sitate backtracking are avoided. In this sense, GRADUS learns, or as Cope quotes from Webster's College Dictionary "acquire knowledge of or skill in by study, instruction, o r experience" (Costello ). This is an in triguing technique that essentially tables grammatical strings by instead tabling all the non grammatical strings. There are a couple of interesting PAGE 42 ! &) differences between GRADUS and Asclepius. In this regard, Asclepius has no kind of long term learning capabilities: i t tables no information about wha t went well or not so well in the last attempt to compose two voices in first species,. One thing it does do that Cope's software does not however, is generate its own cantus firmus. It is not the only software project of this sort that has this capabilit y, but the overwhelming majority of projects discussed here use some sort of pre supplied cantus firmus, or perhaps a great many from which to choose and learn. This latter stance is the one taken by GRADUS. This is necessarily a feature of Asclepius becau se it is an integral part of Schoenberg's approach to counterpoint outlined in the first chapter of his Prelim inary Exercises in Counterpoint He offers a series of rules, all of which can be formulated as constraints and have been in Asclepius, both for g eneral melodic motion in any voice, and in one voice that is in a first species rhythmic relationship with another. This approach is meant to enable the student to write both cantus firmi and counterpoints to them in first species, and Asclepius is therefo re able to perform both of these functions My work is in fact a working grammar of Schoenbergian first species counterpoint that can be used for both the purposes of generating Schoenbergian well formed first species counterpoint in two voices, or simply well formed m elodic motion in only one voice; and of analyzing strings, generated by Asclepius or not, to discern if these strings are grammatical in Schoenberg's language. One aspect of this forms anot her difference between m y project and David Cope's. Co pe's code does not record state information far enough back in a string to adequately learn about for example, some of Schoenberg's longer term rules, such as the constraint on note repetition which checks against any pitch class occuring too many PAGE 43 ! &* times a t both the 5 note string length and the 7 note string length. His algorithm, though still useful, would not be able to decrease the amount of backtracking caused by constraints of this kind. The algorithm could be altered to include state information from further back in the string to address this issue, which would increase the potential memory demand on the machine. Cope's Algorithm for learning first species counterpoint is largely an improvement to the third of Anders and Miranda's three aspects of cons traint systems. It is a way, ultimately, for the constraint applicator of GRADUS to save into memory all grammatical melodies by progressively saving into memory all ungrammatical sub melodies. It is essentially a constraint solution space algorithm's way of finding all well formed solutions in the constraint solution space and saving them in memory. Eventually GRADUS will hold all ungrammatical sub st rings in memory, at which point it will have effectively found all solution strings, and may just as well s tore those in memory instead. This third aspect of Anders and Miranda's three was the one that required the most mental gymnastics to create in Asclepius Namely, this is the part of Asclepius's code that actually applies the constraints and traverses the constraint solution space, backtracking its way out of dead ends when it must. Russell David Ovans has published extensively in the field of computer assisted and automatic composition and he identifies a main area of research in CSPs as focused on perfor ming the solution space search faster, and names various algorithms that improve on the standard backtracking algorithm, none of which have I used in A sclepius. Some of these are arc consistency methods, forward tracking, and lookaheads. Asclepius could po tentially stand to benefit from some of these algorithms in the future. PAGE 44 ! &+ We have established, t hen, that Asclepius is a finite state gramma r as defined by Chomsky in his Synt actic Structures There are many programming paradigms that can be used to create s uch a grammar, and Chomsky himself identifies a particular probabilistic sort that has actually been implemented by other authors Asclepius, however, models the job of making a "sentence" in Schoenberg's "language" as a Constraint Satisfaction Problem, us ing the three part approac h defined by Anders and Miranda. This grammar, particularly Asclepius's constraint applicator, could be improved, using learning methods such as t he one that Cope's GRADUS does, o r perhaps it could be reimplemented using a pr obabi listic framework or some other kind of algorithmic approach. More complex aspects of Schoenberg's counterpoint text could be further incorporated into Asclepius, b ut Asclepius does represent a full and faithful grammar for Schoenbergian first species count erpoint in two voices in any major key. PAGE 45 ! &, Chapter 4 Analyses and Conclusion In this chapter I argue that Schoenberg did not intend for his rules to be followed wholesale, but instead wanted the student to gain an understanding of how to implement them thro ugh experience with them as competing values rather than strict rules I use both S choenberg's and Asclepius's answers to the exercises at the end of the chapter, as well as both their analys es of Schoenberg's answers to support this argument The notion that Schoen berg's "rules and advice" could possibly constitute the raw materials of a computer program that can write full species counterpoint in many voices, as I originally hoped to create, may not necessarily be a faulty one, but it is clear that Scho enberg himself was not merely applying his rules wholesale. On the contrary, he was valuing some over others in different contexts, and the way that he taught this system of values was basically through rote attempts at solving compositional problems. Any computer based system for writing counterpoint that is based on constraints of Schoenberg's sort should take this view of those constraints, that that they are competing values rather than strict rules, if it is to be successful. Both Asclepius and Schoenb erg demonstrate this through their work with the exercises at the end of the chapter Schoenberg does so through his own completion of his exercises and his analysis thereof. Asclepius does so through its output when it completes the exercises and through its analysis of Schoenberg's examples. Schoenberg discusses the notion that this learning must be gained through practice and use, rather than the proper understanding of rules and theory, in his preface to the text. He states, "Counterpoint is considered mostly as a kind of science as a kind PAGE 46 ! '! of theory or aesthetics ; accordingly, one who studies it expects to learn undisputed laws of the musical art," and the theory of counterpoint will here be treated in quite a different way. It will not be considered a s a theory at all, but as a method of training, and the foremost purpose of this method will be to teach the pupil so that he becomes able to use his knowledge later when he c omposes ( 222 ) By setting up this duality between theory and training, Schoenber g implies both that one must train much in order to learn, and that theor etical rules should not be used so strictly at all times I will show using Schoenberg's work and that of my own software that Schoenberg indeed does not use his theoretical rules ver y strictly at all. Exercises Schoenberg has set up some counterpoint exercises at the end of chapter one. They consist of many cantus firmi in some choir clef of some length for which the student is to compose corresponding first species coun terp oint i n the adjacent clefs Schoenberg provides his own such counterpoints many per each cantus firmus in fact, alongside almost all of the cantus firmi. This is to say that he largely provides many more or less correct counterpoints to his exercise cantus firm i in this chapter, rather than leaving it completely to the student to form all such answers by him or herself. This is generally true for the exercise portions in the rest of the textbook as well. In the se particular exercises one is supposed to compose two voice first species counterpoin t using the rules that Schoenberg s et forth previously in that chapter Schoenberg starts with a short cantus firmus in the key of C major and many example counterpo int melodies in ad jacent voices. The keys vary, the can tus firmi grow longer PAGE 47 ! '$ and the given coun terpoint melodies vary in number as the chapter progresses. At the end, he gives many cantus firmi without any given counterpoint melodies for the student to work out. Schoenberg's Answers and Analysis Schoenberg p rovides his own counterpoint melodies to all cantus firmi presented in these exercises, excepting a group of very florid cantus firmi at the very end of the chapter, which are presumably intended to give the student more cantus firmi to work with if they c hoose though the student is doubtless expected in a fair and thorough reading of the text that they will be forced to compose many cantus firmi of their own. The counterpoint melodies provided by Schoenberg vastly outnumber the cantus firmi provided, with many of these counterpoints differing from one another by only a note or two such as counterpoints a and b or m and n of example 1 (see Appendix B) This is probably intended, as we may infer from what we know of Schoenberg's pedagogical predilection tow ard learning by practice and trying each option in turn, to instruct the studen t in going about actualizing those pedagogical values. In other words, Schoenberg is modeling for the student how to try each option in turn in these exercises. Schoenberg prov ides an analysis of his counterpoints as well, and gives a legend of error symbols at the beginning of his exercises. These symbols and the violations they r epresent correspond almost exactly to the constraints that have been implemented in Asclepius whic h is sensible given that they are based on the same set "rules and advice" offered in the rest of the preceding chapter. Schoenberg identifies 42 of these errors in his ex amples, and many melodies have more than one error This means that the average PAGE 48 ! '% numbe r of errors that Schoenberg identifies is less than 1 per melody. By looking over Schoenberg's examples, one sees that a great deal of the melodies contained therein themselves contain no error markings at all. From this we see that that Schoenberg did not intend to carry out an exhaustive analysis of these exa mples. Yet, Schoenberg states plainly the severe restrictions at this stage make it almost impossible to write many examples which do not violate one rule or another (14 ). However, his analysis lea ves ma ny of the examples unmarked. Schoenberg is obviously up to something else here. The analysis may have actually been intended to serve more as an example of what kind of errors to begin to look for. Schoenberg says of these exercises, "There is the po ssibility of discriminating between greater and l esser sins' ( 14 ), which would cohere with the notion that Schoenberg's identified errors serve to teach the student these kinds of values. Asclepius's Analysis of Schoenberg's Answers I have used my softw are Asclepius to analyze 62 of these exercises that have been completed by Schoenberg. Asclepius finds a total of 165 second tier constraint violations, or an average of about 2.6 violations per exercise melody. According to Asclepius, then, the overwhelmi ng majority of a ll cantus firmi and counterpoints all of them but 3 viol ate s ome constraint or another. As I mentioned, Schoenberg himself identifies many rule violat i ons, albeit a much smaller number of them, in his analysis of his own counterpoint melo dies. This all seems to strongly suggest that Schoenberg did not follow his own rules very strictly at all. A list of all constraints and their totals is included in appendix B to this document. Now, t here are some constraints that are not violated in any of the examples. Three of PAGE 49 ! '& these are the constraints are those that establish a very firm sense of key by ensuring that the tonic chordal area is adhered to by the first and last notes of the melodies and that the next to last notes adhere to the dominant chordal area, with some modifications depending on whether a given voice is on top or bottom. Schoenberg even sets these three constraints apart in a section of the chapter subtitled "Establishment of Tonality". The other constraint never violated is the o ne that ensures that a given melody does not move in the same direction for too long, which is a fairly easy constraint to keep from violating, especially since the melodies in the exercises are confined to a given ambitus. For the other constraints, thou gh, one see s a high number of other violations. These violations are fairly well spread out amongst the constraint list, as only 4 of the 18 constraints were unviolated. Four second tier constraints had fewer than ten violations while four had over twenty, leaving two between ten and twenty. Schoenberg does not identify any violations in his cantus firmi, yet Asclepius does. Sch oenberg makes the reason for these difference s clear er in his "comment on examples in fi rst species, exs. 1 9": The examples pres ented in this treatise are not made to convey beauty or perfection. On the contrary, procedures frequently appear which a student should avoid, so that their errors or shortcomings may be discussed. Problems are purposely introduced, and sometimes a satisf actory so lution to them is not possible. ( 14) PAGE 50 ! '' So then, Schoenberg has made it plain that he does not really intend for either the example exercises that he provides counterpoints for, or even the cantus firmi in them, to "convey beauty or perfection." He is pulling out particular issues that lay within a given example for the purpose of discussing that particular issue. Asclepius finds many more constraint violations than Schoenberg does I believe, largely due to this reason. Looking at counterpoint A o f example 1, we see that a tritone exists between the second and fifth notes. Asclepius identifies this as a compound tritone, though Schoenberg does not. Especially given the brevity of this example, the compound tritone here may not be such a large sin, but Asclepius is nonetheless programmed to disallow it. One could imagine Asclepius's code being changed to make the length a compound tritone might be into a particular fraction of the length of the whole example, but this would not be something that Scho enberg himself prescribes in his text. Schoenberg states that a compound tritone is a progression "where one or more tones are inserted between the 4th and 7th, or between the 7th and 4th tones of the scale" ( 6 ) This does not make it exactly clear how lon g of a compound tritone is too long. At the time of coding this constraint, I was looking a t the example Schoenberg gives in the text which consists simply of scalar passages from middle c up through the treble clef to the c an octave above, then back down Schoenberg points out that the 4th and 7th degrees in this scalar passage are a tritone apart. I interpreted this, rightly or wrongly, to mean that such a scalar passage would constitute a compound tritone and made the maximum length a compound tritone c ould be four notes long. However, even though the approach that I've taken through Asclepius is an attempt at a rendition of rules for counterpoint more PAGE 51 ! '( directly based on Schoenberg's writings, that approach is different in practice from Schoenberg's own. Schoenberg includes another apparent error in counterpoint B of example 3 by b eginning the melody with a four tone arpeggiation of the subdominant triad. He does not include any error marking here. This arpeggiation does appear in the lowest voice, but Sch oenberg makes no distinction in his explanation of this constraint between voices in different positions. It is also the case that, though the arpeggiation is one of a subdominant triad, the first and last tones of this arpeggio do not suggest a subdominan t harmony in context with the cantus firmus, but rather suggest a tonic harmonization. This may very often be the case with arpeggios in other exercises of this sort as well, namely that different portions of the arpeggio may be more readily harmonized wit h chordal areas different from the one the arpeggio suggests melodically. Counterpoint I in exercise 5 stays within the range of a fifth for all of its length of twelve whole notes. This is within the scope of the constraint on monotony that Schoenberg ex plains earlier in th e chapter, where he says that remaining too long within the ran ge of a fourth or a fifth constitutes monotony that one should avoid (8) Schoenberg uses his symbol for monotony from the legend he has included to show the reader that c ounterpoint G remains within the range of a fourth for its entirety, yet does not apply this marking to counterpoint I. It is clear, however, that, according to Schoenberg's own words, counterpoint I also qualifies as a monotonous melody. This is further d emonstration that Schoenberg was not attempting to compose or analyze these exercises with the consistency that a robot might, but rather in a more intuitive way that teaches by experience and example. PAGE 52 ! ') Asclepius's Answers: a Comparison I have used Ascle p ius to attempt to solve full first species counterpoints to all of the can tus firmi in Schoenberg's first chapter exercises. I have also used it to generate some cantus firmi of its own, and to solve full first speci es counterpoints to them These exercis e compositions of Asclepius's help to show two things. The first is that composition in strict accordance with Schoenberg's rules for f irst species counterpoint can produce strange results rather than more perfect results The second is that composition of this sort is sometimes insufficient for the composition of even one acceptable solution to a given cantus firmus. Because of this latter fact, the selective inactivation of particular rules can at times yield acceptable answers where there would otherwise be none. We can see in Asclepius's answers to the cantus firmus of example 1 which are contained in appendix B to the present document, both that strict rule adherence can yield strange results and that it can be altogether insufficient for the solution of these compositional problems. There are many peculiar aspects of Asclepius's s oprano clef solutions here. There are more changes of direction. One of Asclepius's solutions is simply parallel 6ths throughout. All of Schoenberg's answers end with motion from the leading to ne to the octave, while the whole of Asclepius's answers end on the mediant, and mostly approached by leap rather than step, and this only from the leading tone! This is quite unconventional and even strange, yet these answers embody Asc lepius's honest approach to complete constraint application. Schoenberg, by contrast, breaks many rules PAGE 53 ! '* when interpreted in strict terms but nonetheless produces answers which are much more conventional looking and sounding than those of Asclepius. Asclep ius was used to attempt to solve a counterpoint in the lower tenor clef to the cantus firmus in example 1, but was unable to solve such a counterpoint using a full and strict application of the constraints. Asclepius was able to reach the penultimate note, but could not place the final tonic there. I intuited that the reason might be Asclepius's constraint on what Schoenberg calls hidden parallel motion, which is motion to a perfect interval by parallel motion not only from the same interval but also from any interval. Schoenberg only makes allowance for this in three or more voi ces between "m iddle voices" ( 10 ), which I interpreted to mean that they were unacceptable in any form when composing only in two voices. The motion from the supertonic in the cantus firmus to the ultimate octave note, when combined with motion from the dominant degree to the lower tonic in the tenor below, would apparently yield such a hidden parallel, and was therefore being constrained out of Asclepius's composi tional possibilities So, I dove into Asclepius 's innards and deactivated this particular aspect of the noparallel8vesor5ths? constraint by hand. When I ran Asclepius again to generate a tenor clef counterpoint, it still could not do so successfully but got stuck in the same place. After thinking more I eventually realized that that tonic degree had already occurred twice in the counterpoint that Asclepius was trying to generate. So, I altered Asclepius by hand once again to not apply the nonoterepetition? constraint at all. W hen I ran Asclepius again, it worked! In this case, Asclepius was only able to generate this one solution for the clef below the cantus firmus instead of the many that it could with the clef above the cantus firmus, and it was only able to do so after I m odified or disabled two of the constraints. PAGE 54 ! '+ Of the twenty eight clefs with unique cantus firmi to compose against in these exercises, t here are five clefs for which Asclepius cannot find any solution at all, even when making those same two alterations in the constraint regime. There are nine other clefs in which at least one solution is possible only by making one or both of these alterations. These facts combined with the oddity many of Asclepius's answers, strongly suggest that Asclepius's strict applic ation of Schoenberg's rules is insufficient for composing acceptable counterpoint melodies to cantus firmi such as those that Schoenberg presents in his exercises. Asclepius's kind of application can often function successfully, but it cannot do so in ever y case. Many instances are such that a kind of fuzzy implementation of the constraints must be applied if one wants to even be able to come to one acceptable solution to a given compositional problem. Schoenberg's Pedagogical Theory: a Conclusion These a spects form the type of implementation of the rules that Schoenberg is trying to impart to the student. We can understand by way of Schoenberg's completed counterpoints to his cantus firmi that he was modeling how to begin to try each compositional option in turn. We can see from his abridged analysis of those counterpoints that Schoenberg was modeling a prioritization of certain kinds of errors over others in certain contexts, which implies a more fluid approach to rule implementation. We can see from Ascl epius's strict analysis of Schoenberg's exercise compositions by contrast with Schoenberg's analysis, that Schoenberg breaks his rules very often when he composes We can also see that Asclepius's composition of first species counterpoint according to a s trict implementation of Schoenberg's rules is PAGE 55 ! ', insufficient for the creation of even a single solution to some compositional problems implying that Schoenberg must necessarily have been compelled to a fuzzier implementational strategy for his rules, simply because a stricter one does not actually work as well! This kind of implementation also sometimes yields solutions that still seem strange in some way suggesting that Schoenberg was also implementing values that were not explicitly written in his rules a nd advice Asclepius, as a strict implementation of Schoenberg's rules for counterpoint, ultimately fails to consistently produce acceptable results in every reasonable case. This failure serves to make clearer many aspects of Schoenberg's overall pedago gical approach, as it is represented in his Preliminary Exercises Schoenberg offers us a very clear idea of the general pedagogical orientation that ties these aspects together when again, he states that the theory of counterpoint will here be treated i n quite a different way. It will not be considered as a theory at all, but as a method of training and the foremost purpose of this method will be to teach the pupil so that he becomes able to use his kno wledg e later when he composes ( 222 ) This is a fund amental difference between Asclepius and Schoenberg. Asclepius represents a view that sees the counterpoint exercise as a problem and tries to find an optimal solution to it within the bounds of the rules. Schoenberg's view is that the counterpoint exercis e is an opportunity to gain a direct knowledge of how the rules function in context as values and that one gains this through trying many different solutions and forming a sense of their various optimality. "The Teaching of M edicine": a Contradiction R esolved PAGE 56 ! (! This difference is made evident through the use of the techniques of strict counterpoint, namely rhythmic species and cantus firmus. Although Johannes Fux did not invent these techniques, as others had used both of them in some form before he wrot e his counterpoint text Gradus ad Parnassum these techniques are today very much a ssociated with Fux and his text ("Species Counterpoint" ) Fux venerated the tradition of Palestrina and his music in the textbook through various means, such as naming the a llegorical teacher in his textbook Aloysius, the latin name for Luigi, part of Palestrina's full name, Giovanni Pierluigi da Palestrina (Fux 18) Given this association, it is peculiar that Schoenberg devotes an entire preface to a discussion of the shortc omings of the music of Palestrina and the teaching of counterpoint that might be based on it. Through this critique of the association between the music of Palestrina and the teaching of counterpoint, one might come to think that Schoenberg was attacking t he Fuxian tradition itself and its embodiment of the association between Palestrina and counterpoint pedagogy. This would not be necessarily out of character for Schoenberg. However, the aforementioned peculiarity arises when one considers that Schoenberg has used those same aspects of strict counterpoint that are so associated with Fux's method. In technical terms, these techniques of strict counterpoint allow Schoenberg to cut down on the number of compositional options a beginning student would have wh en beginning. Schoenberg makes statements similar to this idea. He gives a summary of his view on the relationship between using progressively difficult compositional exercises and learning rules strictly then learning to relax that strictness when he say s PAGE 57 ! ($ There will be no doubt that the rules and laws of this art will not appear unchangeable any more to our mind. But where we use them we will have to realize that we do so under a different concept: ou r laws, restrictions, defences, warnings, and even sug gestions, will have the purpose to lead the pupil from the most simple forms, stepwise, to the most complicated; and this will be the reason why, on the one hand, we will make them, but, on the other hand, we will reduce their strictness, likewise stepwise as much until they correspond, if not to what the harmonic feeling of our time demands, at least to the harmonic feeling of, for instance, a Brahms or a Wagner. (222) Schoenberg found this ability to progressively increase the difficulty of the compositi onal problems that the student faced in the techniques of strict counterpo int from the Fuxian tradition. He did this i n spite of that tradition s associations with the music and legacy of Palestrina, and he made this distinction very clear in one of his pr efaces to his textbook. In conclusion, Schoenberg attempted through his counterpoint textbook to engender in the student through practice, a sense of how to judiciously apply different rules for composition a s competing and contextual valu es. Schoenberg 's examples and analysis show that his rules sometimes conflict with one another. Asclepius's analysis of Schoenberg's examples shows that Schoenberg broke his own rules much of the time. Also, Asclepius's compositions help to show that the rules are insuf ficient for the solution of many of these compositional problems that a more loose application can help but can still be ins ufficient at times, and that solutions created by a very strict interpretation of the rules can often still seem to be less than op timal to humans that PAGE 58 ! (% perceive them, implying that Schoenberg was implementing constraints that were not explicitly laid out in the preceding chapter. Schoenberg's pedagogical view on counterpoint is that the as the forms become freer, the rules become even looser. Because of this, Schoenberg requisitions the strict contrapuntal techniques of Fux so that the student may learn to grapple with this fuzzy implementation of the rule s with simpler materials so that he or she is not completely overwhelmed by the c omplexity of more advanced forms. Schoenberg is ultimately a pragmatist in this regard, and makes sure no reader mistakes his pragmatic decision to use Fuxian pedagogical techniques for the adoption of Fuxian musical tastes. PAGE 59 ! (& Appendix A In man y respects, Ascl epius's internal structure is problematical. Not only are the constraint groups largely copied and pasted, but so too are the procedures for well formed degree list generation and also the higher level procedure that implements the constrai nts and well formed degree procedures in order to generate our counterpoint as well. This is, in general, a bad sign. Whenever one finds oneself cutting and pasting large amounts of source code within a single program and also leaving the pasted duplicate code largely unchanged, this is usually a clue that some higher level procedure, some way of abstracting the two procedures as instances of a more general procedure, is probably to be had. This is exactly the case we have here. By way of some more mental h eavy lifting, all of these procedures that are duplicated for purposes of counterpoint generation may somehow be combined with the original procedures by forming more general abstractions that encapsulate the two (again, extremely similar) sets of procedur es into a single set. That being said, however, the current version of Asclepius, though probably flawed in this way, is functional and serves all of the basic ends it must, and so such code editing will be reserved for future efforts. Software Code #lang racket ;currently for circular list (require srfi/1) ;makes a list of sequential (+1) numbers from x to y, inclusive (define (series x y) (cond ((not (list? x)) (series (list x) y)) ((= (last x) y) x) (else (series (append x (list (+ ( last x) 1))) y)))) ;definitions of ambiti per clef (may have to alter when doublesharps/flats are introduced) (define treble ambitus (series 61 80)) (define soprano ambitus (series 58 77)) (define mezzosoprano ambitus (series 54 73)) (define alto ambit us (series 51 70)) (define tenor ambitus (series 48 67)) PAGE 60 ! (' (define baritone ambitus (series 44 63)) (define bass ambitus (series 41 59)) ;How 'bout some more for the members of the brass quintet? (define trumpet ambitus (series 60 84)) (define horn ambi tus (series 48 69)) (define trombone ambitus (series 36 64)) (define tuba ambitus (series 27 60)) ;;definitions for diatonic key system (just major keys for now) (define major key intervals (circular list cadr cadr car cadr cadr cadr car)) (define major key remainders (circular list cddr cddr cdr cddr cddr cddr cdr)) ;converts midinums to lilypond notenames, previous commented out bit of code may help to ; optimize, can be somehow compressed by series and pattern (define (midi to ly sharp or flat x) ( cond ((equal? sharp or flat 'flat) (cond ((= x 0) "c,,,,") ((= x 1) "des,,,,") ((= x 2) "d,,,,") ((= x 3) "ees,,,,") ((= x 4) "e,,,,") ((= x 5) "f,,,,") ((= x 6) "g es,,,,") ((= x 7) "g,,,,") ((= x 8) "aes,,,,") ((= x 9) "a,,,,") ((= x 10) "bes,,,,") ((= x 11) "b,,,,") ((= x 12) "c,,,") ((= x 13) "des,,,") ( (= x 14) "d,,,") ((= x 15) "ees,,,") ((= x 16) "e,,,")aa ((= x 17) "f,,,") ((= x 18) "ges,,,") ((= x 19) "g,,,") ((= x 20) "aes,,,") ((= x 21) "a,,,") ((= x 22) "bes,,,") ((= x 23) "b,,,") ((= x 24) "c,,") ((= x 25) "des,,") ((= x 26) "d,,") ((= x 27) "ees,,") ((= x 28) "e,,") ((= x 29) "f,,") ((= x 30) "ges,,") ((= x 31) "g,,") ((= x 32) "aes,,") ((= x 33) "a,,") ((= x 34) "bes,,") ((= x 35) "b,,") ((= x 36) "c,") ((= x 37) "des,") ((= x 38) "d,") ((= x 39) "ees,") ((= x 40) "e,") ((= x 41) "f,") ((= x 42) "ges,") ((= x 43) "g,") ((= x 44) "aes,") ((= x 45) "a,") ((= x 46) "bes,") ((= x 47) "b,") ((= x 48) "c") ((= x 49) "des") ((= x 50) "d") ((= x 51) "ees") ((= x 52) "e") ((= x 53) "f") PAGE 61 ! (( ((= x 54) "ges") ((= x 55) "g") ((= x 56) "aes") ((= x 57) "a") ((= x 58) "bes") ((= x 59) "b") ((= x 60) "c'") ((= x 61) "des'") ((= x 62) "d'") ((= x 63) "ees'") ((= x 64) "e'") ((= x 65) "f'") ((= x 66) "ges'") ((= x 67) "g'") ((= x 68) "aes'") ((= x 69) "a'") ((= x 70) "bes'") ((= x 71) "b' ") ((= x 72) "c''") ((= x 73) "des''") ((= x 74) "d''") ((= x 75) "ees''") ((= x 76) "e''") ((= x 77) "f''") ((= x 78) "ges''") ((= x 79) "g''") ((= x 80) "aes''") ((= x 81) "a''") ((= x 82) "bes''") ((= x 83) "b''") ((= x 84) "c'''") ((= x 85) "des'''") ((= x 86) "d'''") ((= x 87) "ees' ''") ((= x 88) "e'''") ((= x 89) "f'''") ((= x 90) "ges'''") ((= x 91) "g'''") ((= x 92) "aes'''") ((= x 93) "a'''") ((= x 94) "bes'''") ((= x 9 5) "b'''") ((= x 96) "c''''") ((= x 97) "des''''") ((= x 98) "d''''") ((= x 99) "ees''''") ((= x 100) "e''''") ((= x 101) "f''''") ((= x 102) "ges''''") ((= x 103) "g''''") ((= x 104) "aes''''") ((= x 105) "a''''") ((= x 106) "bes''''") ((= x 107) "b''''") ((= x 108) "c'''''") ((= x 109) "des'''''") ( (= x 110) "d'''''") ((= x 111) "ees'''''") ((= x 112) "e'''''") ((= x 113) "f'''''") ((= x 114) "ges'''''") ((= x 115) "g'''''") ((= x 116) "aes'''''") ((= x 117) "a'''''") ((= x 118) "bes'''''") ((= x 119) "b'''''") ((= x 120) "c''''''") ((= x 121) "des''''''") ((= x 122) "d''''''") ((= x 123) "ees''''''") ((= x 1 24) "e''''''") ((= x 125) "f''''''") ((= x 126) "ges''''''") PAGE 62 ! () ((= x 127) "g''''''"))) ((equal? sharp or flat 'sharp) (cond ((= x 0) "c,,,,") ((= x 1) "cis,,,,") ((= x 2) "d ,,,,") ((= x 3) "dis,,,,") ((= x 4) "e,,,,") ((= x 5) "f,,,,") ((= x 6) "fis,,,,") ((= x 7) "g,,,,") ((= x 8) "gis,,,,") ((= x 9) "a,,,,") ((= x 10) "ais,,,,") ((= x 11) "b,,,,") ((= x 12) "c,,,") ((= x 13) "cis,,,") ((= x 14) "d,,,") ((= x 15) "dis,,,") ((= x 16) "e,,,") ((= x 17) "f,,,") ((= x 18) "fis,,,") ((= x 19) "g,,,") ((= x 20) "gis,,,") ((= x 21) "a,,,") ((= x 22) "ais,,,") ((= x 23) "b,,,") ((= x 24) "c,,") ((= x 25) "cis,,") ((= x 26) "d,,") ((= x 27) "dis,,") ((= x 28) "e,,") ((= x 29) "f,,") ((= x 30) "fis,,") ((= x 31) "g,,") ((= x 32) "gis,,") ((= x 33) "a,,") ((= x 34) "ais,,") ((= x 35) "b,,") ((= x 36) "c,") ((= x 37) "cis,") ((= x 38) "d,") ((= x 39) "dis,") ((= x 40) "e,") ((= x 41) "f,") ( (= x 42) "fis,") ((= x 43) "g,") ((= x 44) "gis,") ((= x 45) "a,") ((= x 46) "ais,") ((= x 47) "b,") ((= x 48) "c") ((= x 49) "cis") ((= x 50) d") ((= x 51) "dis") ((= x 52) "e") ((= x 53) "f") ((= x 54) "fis") ((= x 55) "g") ((= x 56) "gis") ((= x 57) "a") ((= x 58) "ais") ((= x 59) "b") ((= x 60) "c'") ((= x 61) "cis'") ((= x 62) "d'") ((= x 63) "dis'") ((= x 64) "e'") ((= x 65) "f'") ((= x 66) "fis'") ((= x 67) "g'") ((= x 68) "gis'") ((= x 69) "a'") ((= x 70) "ais'") PAGE 63 ! (* ((= x 71) "b'") ((= x 72) "c''") ((= x 73) "cis''") ((= x 74) "d''") ((= x 75) "dis'' ") ((= x 76) "e''") ((= x 77) "f''") ((= x 78) "fis''") ((= x 79) "g''") ((= x 80) "gis''") ((= x 81) "a''") ((= x 82) "ais''") ((= x 83) "b''") ((= x 84) "c'''") ((= x 85) "cis'''") ((= x 86) "d'''") ((= x 87) "dis'''") ((= x 88) "e'''") ((= x 89) "f'''") ((= x 90) "fis'''") ((= x 91) g'''") ((= x 92) "gis'''") ((= x 93) "a'''") ((= x 94) "ais'''") ((= x 95) "b'''") ((= x 96) "c''''") ((= x 97) "cis''''") ((= x 98) "d''''") (( = x 99) "dis''''") ((= x 100) "e''''") ((= x 101) "f''''") ((= x 102) "fis''''") ((= x 103) "g''''") ((= x 104) "gis''''") ((= x 105) "a''''") ((= x 106) "ais ''''") ((= x 107) "b''''") ((= x 108) "c'''''") ((= x 109) "cis'''''") ((= x 110) "d'''''") ((= x 111) "dis'''''") ((= x 112) "e'''''") ((= x 113) "f'''''") ((= x 114) "fis'''''") ((= x 115) "g'''''") ((= x 116) "gis'''''") ((= x 117) "a'''''") ((= x 118) "ais'''''") ((= x 119) "b'''''") ((= x 120) "c''''''") ((= x 121) "cis''''''") ((= x 122) "d''''''") ((= x 123) "dis''''''") ((= x 124) "e''''''") ((= x 125) "f''''''") ((= x 126) "fis''''''") ((= x 127) "g''''''"))))) ;procedure that yields value of tonic from bottom of ambitus for a given clef and pitch ; class (define (tonic clef ambitus tonic class) (if (= (remainder ( (car clef ambitus) tonic class) 12) 0) (car clef ambitus) (tonic (cdr clef ambitus) tonic class))) ; the problem now is that this iterates by half step instead of using the proper ; intervals! (old comment) (define (make degrees initial degree initial midi number rest of ambitus list of degrees PAGE 64 ! (+ interval list remainder list step) (cond ((equal? initial degree 'stop) list of degrees) ((null? rest of ambitus) (make degrees 'stop rest of ambitus rest of ambitus (append list of degrees (list (cons initial degree initial midi numbe r))) interval list remainder list step)) ((null? list of degrees) (make degrees (+ 1 initial degree) ((list ref interval list step) rest of ambitus) ((list ref remainder list step) rest of ambitus) (list (cons initial degree initial midi number)) interval list remainder list (+ 1 step))) ((and (and (not (= (remainder step 7) 2)) (not (= (remainder step 7) 6)) (not (= step 2)) (not (= step 6))) (= (length rest of ambitus) 1)) (make degrees 'stop rest of ambitus rest of ambitus (append list of degrees (list (cons initial degree initial midi number))) interval list remainder list step)) (else (make degrees (+ 1 initial degree) ((list ref interval list step) rest of ambitus) ((list ref remainder list step) rest of ambitus) (append list of degrees (list (cons initial degree initial midi number))) in terval list remainder list (+ 1 step))))) ; procedure that finds bottom diatonic degree below tonic and initiates the process of ; assigning degree numbers in ambitus up from that (only major!) (defin e (find bottom degree iter clef ambitus tonic class degree current tonic) (cond ((= ( current tonic 10) (car clef ambitus)) (make degrees 5 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders 1)) ((= ( current tonic 8) (car clef ambitus)) (make degrees 4 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders PAGE 65 ! (, 2)) ((= ( current tonic 7) (car clef ambitus)) (make degrees 3 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders 3)) ((= ( current tonic 5) (car clef ambitus)) (make degrees 2 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders 4)) ((= ( current tonic 3) (car clef ambitus)) (make degrees 1 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders 5 ) ) ((= ( current tonic 1) (car clef ambitus)) (make degrees 0 (car clef ambitus) (cdr clef ambitus) '() majo r key intervals major key remainders 6)) ((= current tonic (car clef ambitus)) (make degrees 1 (car clef ambitus) (cdr clef ambitus) '() major key intervals major key remainders 0)) (else (find bottom degree i ter (cdr clef ambitus) tonic class degree current tonic)))) (define (assign key clef ambitus tonic class) (define current tonic (tonic clef ambitus tonic class)) (find bottom degree iter clef ambitus tonic class 5 current tonic)) ; checks for adjacent or compound tritones ;; could perhaps only check latest notes instead of recurring so much (define (tritoneless? checked notes) (cond ((= (length checked notes) 1) #t) ((= (length checked notes) 2) (cond ((or (and (= ( modulo (car (first checked notes)) 7) 4) (= (modulo (car (second checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) PAGE 66 ! )! (= (modulo (car (second ch ecked notes)) 7) 4))) #f) (else (tritoneless? (list tail checked notes 1))))) ((= (length checked notes) 3) (cond ((or (and (= (modulo (car (first checked notes)) 7) 4) ( = (modulo (car (second checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (second checked notes)) 7) 4)) (and (= (modulo (car (first check ed notes)) 7) 4) (= (modulo (car (third checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (third checked notes)) 7) 4))) #f) (else (tritoneless? (list tail checked notes 1))))) ((= (length checked notes) 4) (cond ((or (and (= (modulo (car (first checked notes)) 7) 4) (= (modulo (car (second checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (second checked notes)) 7) 4)) (and (= (modulo (car (first checked notes)) 7) 4) (= (modulo (car (third checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (third checked notes)) 7) 4)) (and (= (modulo ( car (first checked notes)) 7) 0) (= (modulo (car (fourth checked notes)) 7) 4))) #f) (else (tritoneless? (list tail checked notes 1))))) ((or (and (= (modulo (car (first checked notes )) 7) 4) (= (modulo (car (second checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (second checked notes)) 7) 4)) (and (= (modulo (car (first checked notes)) 7) 4) (= (modulo (car (third checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (third checked notes)) 7) 4)) PAGE 67 ! )$ (and (= (modulo (car (first ch ecked notes)) 7) 4) (= (modulo (car (fourth checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (fourth checked notes)) 7) 4)) (and (= (modulo (car (fi rst checked notes)) 7) 4) (= (modulo (car (fifth checked notes)) 7) 0)) (and (= (modulo (car (first checked notes)) 7) 0) (= (modulo (car (fifth checked notes)) 7) 4))) #f) (else (trit oneless? (list tail checked notes 1))))) ; No leaps of 7th, 9th, or 11th or greater (define (nobigbadleaps? checked notes) (cond ((= (length checked notes) 1) #t) ((= (length checked notes) 2) (cond ((= (abs ( (car (first checked notes )) (car (second checked notes)))) 6) #f) ((= (abs ( (car (first checked notes)) (car (second checked notes)))) 8) #f) ((>= (abs ( (car (first checked notes)) (car (second checked notes)))) 9) #f) (else (nobigbadleaps? (list tail checked notes 1))))) ((= (abs ( (car (first checked notes)) (car (second checked notes)))) 6) #f) ((= (abs ( (car (first checked notes)) (car (second checked notes)))) 8) #f) ((>= (abs ( (car (first checked notes)) (car (second checked notes)))) 9) #f) ((= (abs ( (car (first checked notes)) (car (third checked notes)))) 6) #f) ((= (abs ( (car (first checked notes)) (car (third checked not es)))) 8) #f) ((>= (abs ( (car (first checked notes)) (car (third checked notes)))) 9) #f) (else (nobigbadleaps? (list tail checked notes 1))))) ;checks if notes continue for more than 9 tones in 1 direction (define (samedirtoolong? checked notes) (define (samedir iter checked notes dir howlong) (cond ((= (length checked notes) 1) #f) ((= howlong 10) #t) ((= ( (car (first checked notes)) (car (second checked notes))) 0) (sam edir iter (list tail checked notes 1) dir (+ howlong 1))) ((and (> ( (car (first checked notes)) (car (second checked notes))) 1) (or (eq? dir 'down) (eq? dir 'neutral))) (samedir iter (list tail checke d notes 1) 'down (+ howlong 1))) ((and (> ( (car (first checked notes)) (car (second checked notes))) 1) (or (eq? dir 'up) (eq? dir 'neutral))) (samedir iter (l ist tail checked notes 1) 'down 1)) ((and (< ( (car (first checked notes)) (car (second checked notes))) 1) (or (eq? dir 'up) (eq? dir 'neutral))) (samedir iter (list tail checked notes 1) PAGE 68 ! )% 'up (+ howlong 1))) ((and (< ( (car (fir st checked notes)) (car (second checked notes))) 1) (or (eq? dir 'down) (eq? dir 'neutral))) (samedir iter (list tail checked notes 1) 'up 0)))) (samedir iter checked notes 'neutral 1)) ;checks if leaps are balanced b y motion in opposite direction (define (balancedleaps? checked notes) (cond ((= (length checked notes) 1) #t) ((= (length checked notes) 2) #t) ((= (length checked notes) 3) (cond ((and (> ( (car (first checked notes)) (car (second checked notes))) 2) (not (< ( (car (second checked notes)) (car (third checked notes))) 0))) #f) ((and (< ( (car (f irst checked notes)) (car (second checked notes))) 2) (not (> ( (car (second checked notes)) (car (third checked notes))) 0))) #f) (else #t))) ((or (and (= ( (car (first checked notes)) (car (third checked notes))) 5) (> (car (first checked notes)) (car (second checked notes))) (> (car (second checked notes)) (car (third checked notes))) (not (= ( (car (first checked notes)) (car (second checked notes))) 4))) (and (= ( (car (first checked notes)) (car (third checked notes))) 7) (> (car (first checked notes)) (car (second checked notes))) (> (car (second checked notes)) (car (third checked notes)))) (and (= ( (car (first checked notes)) ( car (third checked notes))) 5) (< (car (first checked notes)) (car (second checked notes))) (< (car (second checked notes)) (car (third checked notes))) (not (= ( (car (first checked notes)) (car (second checked notes))) 4))) (and (= ( (car (first checked no tes)) (car (third checked notes))) 7) (< (car (first checked notes)) (car (second checked notes))) (< (car (second checked notes)) (car (third checked notes))))) (balancedleaps? (list tail checked notes 1))) ((and (> ( (car (first checked notes)) (car (second checked notes))) 2) (not (< ( (car (second checked notes)) (car (third checked notes))) 0))) #f) ((and (< ( (car (first checked notes)) (car (second checked notes))) PAGE 69 ! )& 2) (not (> ( (car (second checked notes)) (car (third checked notes) )) 0))) #f) (else (balancedleaps? (list tail checked notes 1))))) ; checks for leaps of a sixth (define (nosixthleaps? checked notes) (cond ((= (length checked notes) 1) #t) ((= (abs ( (first (map car checked notes)) (second (map car checked notes)))) 5) #f) (else (nosixthleaps? (list tail checked notes 1))))) ; checks for leaps of an octave (define (nooctaveleaps? checked notes) (cond ((= (length checked notes) 1) #t) ((= (abs ( (first ( map car checked notes)) (second (map car checked notes)))) 7) #f) (else (nooctaveleaps? (list tail checked notes 1))))) ; checks for triads and seventh chords in any *four* adjacent tones (define (noadjtriadsor7thchords? checked not es) (let ((transposed chord (cond ((>= (length checked notes) 4) (map (delete duplicates (sort (map (lambda (x) (modulo x 7)) (list (car (first checked notes))(car (second checked notes)) (car (third checked notes)) (car (fourth checked notes)))) <)) ( make list 4 ( (first (delete duplicates (sort (map (lambda (x) (modulo x 7)) (l ist (car (first checked notes)) (car (second checked notes)) (car (third checked notes)) (car (fourth checked notes)))) <))) 1))))))) (cond ((<= (length checked notes) 3) # t) ((and (>= (length checked notes) 4) (or (equal? transposed chord '(1 3 5)) (equal? transposed chord '(1 3 6)) (equal? transposed ch ord '(1 4 6)) (equal? transposed chord '(0 1 3 5)))) #f) (else (noadjtriadsor7thc hords? (list tail checked notes 1)))))) ; checks to see if any note is repeated within the span of 9 notes (define (nonoterepetition? checked notes) (cond ((< (length checked notes) 3) #t) ((> (length checked notes) 8) (cond ((> (count (lambda (x) (equal? X (car (first checked notes)))) (take (map car checked notes) 8)) 2) #f) (else (nonoterepet ition? (list tail checked notes 1))))) ((> (count (lambda (x) (equal? x (car (first checked notes)))) (map car checked notes)) 2) #f) (else (nonoterepetition? (list tail checked notes 1))))) ; checks if range of notes is wide enough in given length (define (rangewideenough? checked notes) (cond ((< (length checked notes) 7) #t) ((< (length checked notes) 9) (cond ((< ( (apply max (take (map car checked notes) 7)) (apply min (ta ke (map car checked notes) 7))) 4) #f) (else (rangewideenough? (list tail checked notes 1))))) ((>= (length checked notes) 9) (cond ((o r (< ( (apply max (take (map car checked notes) PAGE 70 ! )' 9)) (apply min (take (map car checked notes) 9))) 5) (< ( (apply max (take (map car checked notes) 7)) (apply min (take (map car checked notes) 7))) 4)) #f) (else (rangewideenough? (list tail checked notes 1))))))) ; checks if there are any sequences (define (nosequences? checked notes) (define (noseq iter checked notes seq length) (con d ((<= (length checked notes) 3) #t) ((<= seq length 2) (noseq iter (list tail checked notes 1) (quotient ( (length checked notes) 1) 2))) ((equal? (map (take (map car chec ked notes) seq length) (make list seq length ( (first (map car checked notes)) 1))) (map (take (list tail (map car checked notes) seq length) seq length) (make list seq length ( (list ref (map car checked notes) seq length) 1)))) #f) (else (noseq iter checked notes ( seq length 1))))) (noseq iter checked notes (quotient (length checked notes) 2))) ;checks to see if the first tone is acceptable (define (first? checked notes voice list cn ambitus tonic class) (cond ((and (= (first voice list) (last (sort voice list <))) (= (modulo (car (first checked notes)) 7) 1)) #t) ((and (= (first voice list) (first (sort voice list <))) (ormap (lambda (x) (= x ( (caar (degrees to midinums '((1 1)) cn ambitus tonic class)) (first cn ambitus)))) (series 5 10)) (= (car (first checked notes)) 2)) #f) ((and (not (= (first voice list) (last (sort voice list <)))) (or (= (modulo (car (first checked notes)) 7) 1) (= (modulo (car (first checked notes)) 7) 3) (= (modulo (car (first checked notes)) 7) 5))) #t) (else #f))) ;checks to see if there are more than 2 leaps in a row (define (no3consecutiveleaps? checked notes) (cond ((< (length checked note s) 4) #t) ((and (> (abs ( (car (first checked notes)) (car (second checked notes)))) 1) (> (abs ( (car (second checked notes)) (car (third checked notes)))) 1) (> (abs ( (car (third checked notes)) (car (fourth checked notes)))) 1)) #f) (else (no3consecutiveleaps? (list tail checked notes 1))))) ; checks to see if th e penultimate tone is acceptable (define (penultimate? checked notes number of measures voice list) (cond ((< (length checked notes) ( number of measures 1)) #t) ((and (= (first voice list) (last (sort voice list <))) (or (= (modul o (list ref (map car checked notes) ( number of measures 2)) 7) 5) (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) PAGE 71 ! )( 0) (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) 2))) #t) ((and (not (= (first voice list) (last (sort voice list <)))) (or (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) 5) (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) 0) (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) 2) (= (modulo (list ref (map car checked notes) ( number of measures 2)) 7) 4))) #t) (else #f))) ; checks to see if the ultimate tone is acceptable (define (ultimate? checked notes number of measures voice list) (cond ((< ( length checked notes) number of measures) #t) ((and (= (first voice list) (last (sort voice list <))) (= (modulo (list ref (map car checked notes) ( number of measures 1)) 7) 1)) #t) ((and (not (= (first voice list) (last (sort voice list <)))) (or (= (modulo (list ref (map car checked notes) ( number of measures 1)) 7) 5) (= (modulo (list ref (map car checked notes) ( number of measures 1)) 7) 3) (= (modulo (list ref (map car checked notes) ( number of measures 1)) 7) 1))) #t) (else #f))) ;meta predicate including all cf predicates (define (allc fconstraints? checked notes number of measures voice list cn ambitus tonic class) (and (first? checked notes voice list cn ambitus tonic class ) (nobigbadleaps? checked notes) (tritoneless? checked notes) (not (samedirtoolong? checked notes)) (balancedleaps? checked notes) (nosixthleaps? checked notes) (nooctaveleaps? checked notes) (noadjtriadsor 7thchords? checked notes) (nonoterepetition? checked notes) (rangewideenough? checked notes) (nosequences? checked notes) (no3consecutiveleaps? checked notes) (penultimate? checked notes number of measures voice list) (ultimate? checked notes number of measures voice list))) (define (2ndtierconstraints? checked notes number of measures voice list PAGE 72 ! )) cn ambitus tonic class) (cond ((and (first? checked notes voice list cn ambitus tonic class) (nobigbadleaps? checked notes) (tritoneless? checked notes) (not (samedirtoolong? checked notes)) (balancedleaps? checked notes) (noadjtriadsor7thchords? checked notes) (nonoterepetition? checked notes) (rangewideenough? checked notes) (nosequences? checked notes) (no3consecutiveleaps? checked notes) (penultimate? checked notes number of measures voice list) (ultimate? checked notes number of measures voice list)) #t) (else #f))) ;makes list of all notes given a cf list that are well formed as next degree (define (wellformeddegrees cf viable notes cf l ist number of measures voice list cn ambitus tonic class) (define (wellformeddegrees iter cf viable notes wellformedlist) (cond ((null? cf viable notes) wellformedlist) ((allcfconstraints? (append cf list (list (cons (car (first cf viable notes)) 1))) number of measures voice list cn ambitus tonic class) (wellformeddegrees iter (list tail cf viable notes 1) (append wellformedlist (list (car (first cf viable notes)))))) (else (wellformeddegrees iter (list tail cf viable notes 1) wellformedlist)))) (wellformeddegrees iter cf viable notes '())) ;makes list of all notes given a cf list that are well formed as next degree, including ; "emergency", 2nd tier notes (define (2ndt ierdegrees cf viable notes cf list number of measures voice list cn ambitus tonic class) (define (2ndtierdegrees i ter cf viable notes wellformedlist) (cond ((null? cf viable notes) wellformedlist) ((2ndtierconstraints? (append cf list (list (cons (car (first cf viable notes)) 1))) number of measures voice list cn ambitus tonic class) (2ndtierdegrees ite r (list tail cf viable notes 1) (append we llformedlist (list (car (first cf viable notes)))))) (else (2ndtierdegrees iter (list tail cf viable notes 1) wellformedlist)))) (2ndtierdegrees iter cf viable notes '())) ;procedure that writes the cantus firmus (define (make cf clef ambitus tonic class number of measures voice list) (let ((cf viable notes (assign key clef ambitus tonic class))) (define (make cf iter duration cf list bad degrees) (cond ((and (= (length cf list) number of measures) (2ndtierconstraints? cf list number of measures PAGE 73 ! )* voice list clef ambitus tonic class)) cf list) ((> (length (remove (lambda (x) (member x (cond ((assoc (+ (length cf list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (wellformeddegrees cf viable notes cf list number of measures voice list clef ambitus tonic class))) 0) (display (+ 1 (length cf list))) (display bad degrees: ") (display bad degrees) (display cf list: ") (display cf list) (newline) (make cf iter 1 (append cf list (list (cons (list ref (remove (lambda (x) (member x (cond ((assoc (+ ( length cf list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (wellformeddegrees cf viable notes cf li st number of measures voice list clef ambitus tonic class)) (random (length (remove (lambda (x) (member x (cond ((assoc ( + (length cf list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (wellforme ddegrees cf viable notes cf list number of measures voice list clef ambitus to nic class))))) duration))) bad degrees)) ((> (length (remove (lambda (x) (member x (cond ((assoc (+ (length cf list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (2ndtierdegrees cf viable notes cf list number of measures voice list clef ambitus tonic class))) 0) (display (+ 1 (length cf l ist))) (display bad degrees: ") (display bad degrees) (display cf list: ") (display cf list) (newline) (make cf iter 1 (append cf list (list (cons (list ref (remove (lambda (x) (member x (cond ((assoc (+ (length cf list) 1) bad degrees) => (lambda (x) ( cdr x))) (else '())))) (2ndtierdegrees cf viable notes PAGE 74 ! )+ cf list number of measures voice list cle f ambitus tonic class)) (random (length (remove (lambda (x) (member x (cond ((assoc (+ (length cf list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (2ndtierdegrees cf viable notes cf list number o f measures voice list clef ambitus tonic class))))) duration))) bad degrees)) (else (display "sub...") (display cf list) (newline) (make cf iter 1 (drop right cf list 1) (remove (lambda (x) (> (first x) (length cf list)) ) (cond ((null? (filter (lambda (x) (= (first x) (length cf list))) bad degrees)) (append bad degrees (list (list (length cf list) (car (last cf list)))))) (else (append (remove (lambda (x) (= (first x) (length cf list))) bad degrees) (list (app end (assoc (length cf list) bad degrees) (list (car (last cf list))))))))))))) (make cf iter 1 '() '()))) ;checks to see if cp forms acceptable simultaneities with cf in terms of intervals, ; excluding first, penult, and ult, (define (goodsimu ltaneities? checked degrees cd ambitus degrees checked against dca ambitus root class number of measures) (let ((checked midinums (degrees to midinums checked degrees cd ambitus root class)) (midinums checked against (degrees to midinums degrees checked against dca ambitus root class))) (define (goodsimultaneities iter? checked midinums midinums checked against note number) (cond ((null? checked midinums) #t) ((or (and (or (= note number 1) (= note n umber number of measures)) (or (= (modulo (abs ( (car (first checked midinums)) (car (first midinums che cked against)))) 12) 0) (= (modulo (abs ( (car (first ch ecked midinums)) (car (first midinums checked against)))) 12) 3) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums ch ecked against)))) 12) 4) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 7))) (or (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 3) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12 ) 4) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 7) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 8) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 9))) PAGE 75 ! ), (goodsi multaneities iter? (list tail checked midinums 1) (list tail midinums checked against 1) (+ note number 1))) (else #f))) (goodsimultaneities iter? checked midin ums midinums checked against 1))) ;checks for open, hidden, or intermittent parallels, allowing for horn 5ths and 8ths (define (noparallel8vesor5ths? checked degrees cd ambitus degrees checked against dca ambitus root class) (let ((checked midinums (deg rees to midinums checked degrees cd ambitus root class)) (midinums checked against (degrees to midinums degrees checked against dca ambitus root class))) (define (noparallel8vesor5ths iter? checked midinums midinums checked against) (cond ((<= (length checked midinums) 1) #t) ((and (or (and (> (car (first checked midinums)) (car (first midinums checked against))) (= (abs ( (car (first checked midinums)) (car (second checked midinums)))) 1)) (and (> (car (first midinums checked against)) (car (first checked midinums))) (= (abs ( (car (first midinums chec ked against)) (car (second midinums checked against)))) 1))) (or (and (or (= (modulo (abs ( (car (first checked midinums)) (car (first midinums che cked against)))) 12) 3) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 4) (= (modulo (abs ( (c ar (first checked midinums)) (car (first midinums checked against)))) 12) 8) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 9) (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 0)) (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 7)) (and (= (modulo (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 12) 7) (or (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 3) (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 4) (= (modulo (abs ( (car (second checked midinum s)) (car (second midinums checked against)))) 12) 8) (= (modulo (abs ( (car (second checked midinums)) (car (second m idinums checked against)))) 12) 9) (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 0))))) (noparallel8vesor5ths iter? (list tail checked midinums 1) (list tail midinums checked against 1))) ((and (or (and (< (car (first checked midinums)) (car (second checked midinums))) (< (car (first midinums checked against)) (car (second midinums checked against)))) (and (> (car (first checked midinums)) (car (second checked midinums))) (> (car (first midinums checked against)) (car (second midinums checked against))))) (or (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 7) (= (modulo (abs ( (car (second checked midinums)) (car (second midinums checked against)))) 12) 0))) #f) PAGE 76 ! *! ((and (>= (length check ed midinums) 3) (or (and (= (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 0) (= (abs ( (car (third checked midinums (car (third midinums checked against)))) 0)) (and (= (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 7) (= (abs ( (car (third checked midinums)) (car (third midinums checked against)))) 7)) (and (= (abs ( (car (first checked midinums)) (car (first midinums checked agai nst)))) 12) (= (abs ( (car (third checked midinums)) (car (third midinums checked against)))) 12)) (and (= (abs ( (car (first checked midinums)) (car (first midinums checked against)))) 19) (= (abs ( (car (third checked midinums)) (car (third midinums checked against)))) 19)))) #f) (else (noparallel8ves or5ths iter? (list tail checked midinums 1) (list tail midinums checked against 1))))) (noparallel8vesor5ths iter? checked midinums midinums checked against))) ;makes sure both voices stays in place accor ding to the voice list (define (novoicecrossing? checked degrees cd ambitus degrees checked against dca ambitus root class cd voice list) (let ((checked midinums (degrees to midinums checked degrees cd ambitus root class)) (midinums checked agai nst (degrees to midinums degrees checked against dca ambitus root class))) (define (novoicecrossing inner? checked midinums midinums checked against) (cond ((null? checked midinums) #t) ((or (and (= (first cd voice list) (last (sort c d voice list <))) (< (car (first checked midinums)) (car (first midinums checked against)))) (and (= (first cd voice list) (first (sort cd voice list <))) (> (car (first checked midinums)) (car (first midinums checked against))))) (novoicecrossing inner? (list tail checked midinums 1) (list tail midinums checked against 1))) (else #f) )) (novoicecrossing inner? checked midinums midinums checked against))) ;checks that only contrary motion is used, to be placed only in first tier so that a ; strong preference exists for contrary motion (define (noparallelmotion? checked degrees cd am bitus degrees checked against dca ambitus root class) (let ((checked midinums (degrees to midinums checked degrees cd ambitus root class)) (midinums checked against (degrees to midinums degrees checked against dca ambitus root class))) (defin e (noparallelmotion inner? checked midinums midinums checked against) (cond ((<= (length checked midinums) 1) #t) ((and (> ( (car (first checked midinums)) (car (second checked midinums))) 0) (> ( (car (first midinums checked against)) (car (second midinums checked against))) 0)) #f) ((and (< ( (car (first checked midinums)) (car (second checked midinums))) 0) (< ( (car (first midinums checked against)) (car (second midinums checked against))) 0)) #f) (else (noparallelmotion inner? (list tail checked midinums 1) (list tail midinums chec ked against 1))))) (noparallelmotion inner? checked midinums midinums checked against))) ;this procedure writes the counterpoint to the cantus firmus (define (make cp clef ambitus tonic class number of measures voice list cf list cf ambitus) (let (( cp viable notes (assign key clef ambitus tonic class))) (define (make cp iter duration cp list bad degrees) (cond ((and (= (length cp list) number of measures) (2ndtiercpconstraints? cp list number of measures voice list clef am bitus cf list cf ambitus tonic class)) cp list) ((> (length (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => PAGE 77 ! *$ (lambda (x) (cdr x))) (else '())))) (wellformedcpdegrees cp viable notes cp list number of measures voice list clef ambitus cf list cf ambitus tonic class))) 0) (display (+ 1 (length cp list))) (display bad degrees: ") (display bad degrees) (display cp list: ") (display cp list) ( newline) (make cp iter 1 (append cp list (list (cons (list ref (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (wellformedcpdegrees cp viable notes cp list number of measures voice list clef ambitus cf li st cf ambitus tonic class)) (random (length (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => (lambda (x) ( cdr x))) (else '())))) (wellformedcpdegrees cp viable notes cp list number of measures voice list clef ambitus cf list cf ambitus tonic class))))) duration))) bad degrees)) ((> (length (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (2ndtiercpdegrees cp viable notes cp list number of measu res voice list clef ambitus cf list cf ambitus tonic class))) 0) (display (+ 1 (length cp list))) (display bad degrees: ") (display bad degrees) (display cp list: ") (display cp list) (newline) (make cp iter 1 (append cp list (list (cons (list ref (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (2ndtiercpdegrees cp viable notes cp list number of measures voice list PAGE 78 ! *% clef ambitus cf list cf ambitus tonic class)) (random (length (remove (lambda (x) (member x (cond ((assoc (+ (length cp list) 1) bad degrees) => (lambda (x) (cdr x))) (else '())))) (2ndtiercpdegrees cp viable notes cp list number of measures voice list clef ambitus cf list c f ambitus tonic class))))) duration))) bad degrees)) (else (display "sub...") (display cp list) (newline) (ma ke cp iter 1 (drop right cp list 1) (remove (lambda (x) (> (first x) (length cp list))) (cond ((null? (filter (lambda (x) (= (first x) (length cp list) )) bad degrees)) (append bad degrees (list (list (length cp list) (c ar (last cp list)))))) (else (append (remove (lambda (x) (= (first x) (length cp list))) bad degrees) (list (append (assoc (length cp list) bad degrees) (list (car (last cp list))))))))))))) (make cp iter 1 '() '()))) ;meta predicate including all cf predica tes (define (allcpconstraints? checked notes number of measures voice list cn ambitus notes checked against nca ambitus root class) (cond ((and (first? checked notes voice list cn ambitus root class) (nobigbadleaps? checked notes) (tritoneless? checked notes) (not (samedirtoolong? checked notes)) (balancedleaps? checked notes) (nosixthleaps? checked notes) (nooctaveleaps? checked notes) (noadjtriadsor7thchor ds? checked notes) (nonoterepetition? checked notes) (rangewideenough? checked notes) (nosequences? checked notes) (no3consecutiveleaps? checked notes) (penultimate? checked notes number of measures voice list) (ultimate? checked notes number of measures voice list) (goodsimultaneities? checked notes cn ambitus notes checked against nca ambitus root class number of measures) (noparallel8vesor5ths? checked notes cn ambitus notes checked against nca ambitus root class) (novoicecrossing? checked notes cn ambitus notes checked against nca ambitus root class voice list) (noparallelmotion? checked notes cn ambitus notes checke d against nca ambitus root class)) #t) (else #f))) (define (2ndtiercpconstraints? checked notes number of measures voice list cn ambitus notes checked against nca ambitus root class) (cond ((and (first? checked notes voice list cn ambitus root c lass) (nobigbadleaps? checked notes) (tritoneless? checked notes) PAGE 79 ! *& (not (samedirtoolong? checked notes)) (balancedleaps? checked notes) (noadjtriadsor7thchords? checked notes) (nonoterepetition? checked notes) (rangewideenough? checked notes) (nosequences? checked notes) (no3consecutiveleaps? checked notes) (penultimate? checked notes number of measures voice list) (ultimate? checked notes number of measures voice list) (goodsimultaneities? checked notes cn ambitus notes checked against nca ambitus root class number of measures) (noparallel8vesor5ths? checked notes cn ambitus not es checked against nca ambitus root class) (novoicecrossing? checked notes cn ambitus notes checked against nca ambitus root class voice list)) #t) (else #f))) ;makes list of all notes given a cf list that are well formed as next deg ree (define (wellformedcpdegrees cp viable notes cp list number of measures voice list cn ambitus notes checked against nca ambitus root class) (define (wellformedcpdegrees iter cp viable notes wellformedlist) (cond ((null? cp viable notes) wellforme dlist) ((allcpconstraints? (append cp list (list (cons (car (first cp viable notes)) 1))) number of measures voice list cn ambitus notes checked against nca ambitus root class) (wellformedcpdegrees iter (list tail cp viable notes 1) (append wellforme dlist (list (car (first cp viable notes)))))) (else (wellformedcpdegrees iter (list tail cp viable notes 1) wellformedlist)))) (wellformedcpdegrees iter cp viable notes '())) ;makes list of all notes given a cf list that are well formed as next degree, including ; "emergency", 2nd tier notes (define (2ndtiercpdegrees cp viable notes cp list number of measures voice list cn ambitus notes checked against nca ambitus root class) (define (2ndtiercpdegrees iter cp v iable notes wellformedlist) (cond ((null? cp viable notes) wellformedlist) ((2ndtiercpconstraints? (append cp list (list (cons (car (first cp viable notes)) 1))) number of measures voice list cn ambitus notes checked against nca ambitus root class) (2ndtiercpdegrees iter (list tail cp viable notes 1) (append wellformedlist (list (car (first cp viable notes)))))) (else (2ndtiercpdegrees iter (list tail cp viable notes 1) wellformedlist)))) (2ndtiercpdegrees iter cp viable notes '())) (define (degrees to midinums notelist ambitus root) (let ((midinums (assign key ambitus root))) (define (degrees to midinums iter notelist newlist mn index) (cond ((null? notelist) newlist) ((= (list ref (map car midinums) mn ind ex) (first (map car notelist))) (degrees to midinums iter (list tail notelist 1) (append newlist (list (cons (list ref (map cdr midinums) mn index) (first (map cdr notelist))))) 0)) (else (degrees to midinums iter notelist newlist (+ mn index 1))))) (degrees to midinums iter notelist '() 0))) ;This procedure converts the degree numbers in the notelist to midinums, then that list to a string of lynotenames with durations (define (degrees to ly notelist ambitus root) (let ((midinums (assign key ambitus root))) PAGE 80 ! *' (define (degrees to midinums iter notelist newlist mn index) (cond ((null? notelist) newlist) ((= (list ref (map car midinums) mn index) (first (map car notelist))) (degrees to midinums iter (list tail notelist 1) (append newlist (list (cons (list ref (map cdr midinums) mn index) (first (map cdr notelist))))) 0)) (else (degrees to midinums iter notelist newlist (+ mn index 1))))) (define (midinums to notenames iter notelist newstring) (cond ((null? notelist) ne wstring) (else (midinums to notenames iter (list tail notelist 1) (string append newstring (midi to ly 'sharp (first (map car notelist))) (number >string (first (map cdr notelist))) "))))) (midinums to notenames iter (degrees to midinums iter notelist '() 0) ""))) (define (write ly root length cf voicelist) (letrec ((cf (make cf treble ambitus 0 10 '(1 2))) (cp (make cp soprano ambitus 0 10 '(2 1) cf treble ambitus))) (define lystring (string append \ \ version \ "2.12.3 \ \ ntop = { \ n \ \ clef treble \ n \ \ key c \ \ major \ n \ \ time 4/4 \ n \ n (degrees to ly cf treble ambitus 0) \ n} \ n \ nbottom = { \ n \ \ clef soprano \ n \ \ key c \ \ major \ n \ \ time 4/4 \ n \ n (degrees to ly cp soprano ambitus 0) "} \ n \ \ score { \ n \ \ new StaffGroup << \ n \ \ new Staff \ \ top \ n \ \ new Staff \ \ bottom \ n >> \ n \ \ layout { } \ n \ \ midi { } \ n} \ n")) (define lyfile (open o utput file "2vv.ly")) (display lystring lyfile) (close output port lyfile))) (define (which constraints cf checked notes number of measures voice list cn ambitus root class) (define (which constraints iter constraints list index list of falsitie s) (cond ((= 14 constraints list index) list of falsities) ((and (= constraints list index 13) (not (ultimate? checked notes number of measures voice list))) (which constraints iter (+ 1 constraints list index) (ap pend '(penultimate?) list of falsities))) ((and (= constraints list index 13) (ultimate? checked notes number of measures voice list)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 12) (not (penultimate? checked notes number of measures voice list))) (which constraints iter (+ 1 constraints list index) (append '(penultimate?) list of falsities))) ((and (= constrain ts list index 12) (penultimate? checked notes number of measures voice list)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 11) (not (no3consec utiveleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(no3consecutiveleaps?) list of falsities))) ((and (= constraints list index 11) (no3consecutiveleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 10) (not (nosequences? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(noseque nces?) list of falsities))) ((and (= constraints list index 10) (nosequences? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 9) (not (rangewideenough? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(rangewideenough?) list of falsities))) ((and (= constraints list index 9) PAGE 81 ! *( (rangewideenough? checked notes )) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 8) (not (nonoterepetition? checked notes))) (which constraints iter (+ 1 constraints list index) ( append '(nonoterepetition?) list of falsities))) ((and (= constraints list index 8) (nonoterepetition? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constrai nts list index 7) (not (noadjtriadsor7thchords? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(noadjtriadsor7thchords?) list of falsities))) ((and (= constraints list index 7) (noadjtriadsor7thchords? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 6) (not (nooctaveleaps? checked notes))) (which constr aints iter (+ 1 constraints list index) (append '(nooctaveleaps?) list of falsities))) ((and (= constraints list index 6) (nooctaveleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of fal sities)) ((and (= constraints list index 5) (not (nosixthleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(nosixthleaps?) list of falsities))) ((and (= constraints list in dex 5) (nosixthleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 4) (not (balancedleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(balancedleaps?) list of falsities))) ((and (= constraints list index 4) (balancedleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 3) (samedirtoolong? checked notes)) (which constraints iter (+ 1 constraints list index) (append '(samedirtoolong?) list of falsities))) ((and (= constraints li st index 3) (not (samedirtoolong? checked notes))) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 2) (not (tritoneless? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(tritoneless?) list of falsities))) ((and (= constraints list index 2) (tritoneless? checked notes)) (which constraints iter (+ 1 constraints list inde x) list of falsities)) ((and (= constraints list index 1) (not (nobigbadleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(nobigbadleaps?) list of falsities))) ((and (= con straints list index 1) (nobigbadleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 0) (not (first? checked notes voice list cn ambitus root class))) (which constraints iter (+ 1 constraints list index) (append '(first?) list of falsities))) ((and (= constraints list index 0) (first? checked notes voice list cn ambitus root class)) (which constraints iter (+ 1 constraints list index) list of falsities)))) (which constraints iter 0 '())) (define (which constraints checked notes number of measures voice list cn ambitus notes checked against nca ambitus root class) (define (which constraints iter constraint s list index list of falsities) (cond ((= 18 constraints list index) list of falsities) ((and (= constraints list index 17) PAGE 82 ! *) (not (noparallelmotion? checked notes cn ambitus notes checked against nca ambitus root class))) (which constraints iter (+ 1 constraints list index) (append '(noparallelmotion?) list of falsities))) ((and (= constraints list index 17) (noparallelmotion? checked notes cn ambitus notes checked against nca ambitus root c lass)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 16) (not (novoicecrossing? checked notes cn ambitus notes checked against nca ambitus root class voice lis t))) (which constraints iter (+ 1 constraints list index) (append '(novoicecrossing?) list of falsities))) ((and (= constraints list index 16) (novoicecrossing? checked notes cn ambitus notes checked against nca ambitu s root class voice list)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 15) (not (noparallel8vesor5ths? checked notes cn ambitus notes checked against nca ambi tus root class))) (which constraints iter (+ 1 constraints list index) (append '(noparallel8vesor5ths?) list of falsities))) ((and (= constraints list index 15) (noparallel8vesor5ths? checked notes cn ambitus notes che cked against nca ambitus root class)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 14) (not (goodsimultaneities? checked notes cn ambitus notes checked agains t nca ambitus root class number of measures))) (which constraints iter (+ 1 constraints list index) (append '(goodsimultaneities?) list of falsities))) ((and (= constraints list index 14) (goodsimultaneities? checked n otes cn ambitus notes checked against nca ambitus root class number of measures)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 13) (not (ultimate? checked not es number of measures voice list))) (which constraints iter (+ 1 constraints list index) (append '(penultimate?) list of falsities))) ((and (= constraints list index 13) (ultimate? checked notes number of measures voic e list)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 12) (not (penultimate? checked notes number of measures voice list))) (which constraints ite r (+ 1 constraints list index) (append '(penultimate?) list of falsities))) ((and (= constraints list index 12) (penultimate? checked notes number of measures voice list)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 11) (not (no3consecutiveleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(no3consecutiveleaps?) list of falsities))) ((and (= constraints list index 11) (no3consecutiveleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 10) (not (nosequen ces? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(nosequences?) list of falsities))) ((and (= constraints list index 10) (nosequences? checked notes)) (which constraints i ter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 9) (not (rangewideenough? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(rangewideenough?) list of f alsities))) ((and (= constraints list index 9) (rangewideenough? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 8) (no t (nonoterepetition? checked notes))) PAGE 83 ! ** (which constraints iter (+ 1 constraints list index) (append '(nonoterepetition?) list of falsities))) ((and (= constraints list index 8) (nonoterepetition? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 7) (not (noadjtriadsor7thchords? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(noadjtriadsor7thchords?) list of falsities))) ((and (= constraints list index 7) (noadjtriadsor7thchords? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= c onstraints list index 6) (not (nooctaveleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(nooctaveleaps?) list of falsities))) ((and (= constraints list index 6) (noo ctaveleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 5) (not (nosixthleaps? checked notes))) (which constraints iter (+ 1 cons traints list index) (append '(nosixthleaps?) list of falsities))) ((and (= constraints list index 5) (nosixthleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((a nd (= constraints list index 4) (not (balancedleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(balancedleaps?) list of falsities))) ((and (= constraints list index 4) (balancedleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 3) (samedirtoolong? checked notes)) (which constraints iter (+ 1 c onstraints list index) (append '(samedirtoolong?) list of falsities))) ((and (= constraints list index 3) (not (samedirtoolong? checked notes))) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 2) (not (tritoneless? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(tritoneless?) list of falsities))) ((and (= constraints list index 2) (tritoneless? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsities)) ((and (= constraints list index 1) (not (nobigbadleaps? checked notes))) (which constraints iter (+ 1 constraints list index) (append '(nobigbadleaps?) list of falsities))) ((and (= constraints list index 1) (nobigbadleaps? checked notes)) (which constraints iter (+ 1 constraints list index) list of falsitie s)) ((and (= constraints list index 0) (not (first? checked notes voice list cn ambitus root class))) (which constraints iter (+ 1 constraints list index) (append '(first?) list of falsities))) ((and (= constraints list in dex 0) (first? checked notes voice list cn ambitus root class)) (which constraints iter (+ 1 constraints list index) list of falsities)))) (which constraints iter 0 '())) PAGE 84 ! *+ Appendix B: Graphs and Musical Examples -! $-! %-! &-! '-! (-! )-! ."/012! 03456"/177879:2! ;59<81"43152! <81"43152! 970"=1>853;02! 97?":?36853;02! 977@13#5853;02! 9705A<59@502! 9736B1/"3607/*1>@>7/602! ?3839@56853;02! /39:5C"65597<:>2! 97;3/38858+#507/(1>02! :7760"4<81395"1"502! 97&@7905@<1"#5853;02! 1/"179585002! 979715/5;51"1"792! 97#7"@5@/700"9:2! 97;3/38858471"792! !"#$%&'%()*+,-$&+.(/0&.,10$2/.0$&+, D@>759?5/:E0!F7901/3"91! G"7831"790! PAGE 85 ! *, Schoenberg's Exercises a nd Analysis PAGE 86 ! +! PAGE 87 ! +$ PAGE 88 ! +% PAGE 89 ! +& Asclepius's Exercises PAGE 90 ! +' PAGE 91 ! +( PAGE 92 ! +) PAGE 93 ! +* PAGE 94 ! ++ PAGE 95 ! +, Asclepius's own Soprano Cantus Firmi and Counterpoints PAGE 96 ! ,! Bibliography A., H. K. Rev. of Preliminary Exercises in Counterpoint Music & Letters 45.1 (1964): 78 79. JSTOR Web. 8 May 2012. Choms ky, Noam. Syntactic Structures Berlin: Mouton De Gruyter, 2002. Print. Cope, David, and Douglas R. Hofstadter. Virtual Music: Computer Synthesis of Musical Style Cambridge, MA: MIT, 2001. Print. Cope, David. "A Musical Learning Algorithm" Computer Music Journal v.28 n.3, p.12 27, September 2004 Costello, R. B., ed. 1991. Webster's College Dictionary New York: Random House. Durbin, Mridula A. "Transformational Models Applied to Musical Analysis: Theoretical Possibilities." Ethnomusicology 15.3 (1971): 35 3 62. Jstor.org Web. 8 May 2012. Farbood, M. and Schoner B. Analysis and Synthesis of Palestrina Style Counterpoint Using Markov Chains Proceedings International Computer Music Conference, Cuba, 2001. Fux, Johann Joseph, Alfred Mann, and John Edmunds The Study of Counterpoint from Johann Joseph Fux s Gradus Ad Parnassum. New York: W.W. Norton, 1965. Print. Harris, Randy Allen. The Linguistics Wars New York: Oxford UP, 1993. Print. Huang, C. Z. A., and Chew, E. "Palestrina Pal: a Grammar Checker for Music Compositions in the Style of Palestrina," Proc. of the 5 th Conference on Understanding and Creating Music, Caserta, 2005. Jeppesen, Knud, and Glen Haydon. Counterpoint, the Polyphonic Vocal Style of the Sixteenth Century, New York: Prentice Hall, 19 39. Print. Madsen, Sren Tjagvad. "Evolving Palestrinian Counterpoint with an EA." Evalife: Research on Complex Systems (2002): 109 13. Web. 8 May 2012. Mann, Alfred. The Study of Fugue. New Brunswick, NJ: Rutgers UP, 1958. Print. Morris, R. O. Contrapunta l Technique in the Sixteenth Century, Oxford: Clarendon, 1922. Print. Nierhaus, Gerhard. Algorithmic Composition: Paradigms of Automated Music Generation. Wien: Springer, 2009. Print. Ovans, R. D. An Object Oriented Constraint Satisfaction System Applied to Music Composition. Master's thesis, Simon Fraser University, Burnaby, British Columbia. 1991. Ovans, Russell, and Rod Davison. "An Interactive Constraint Based Expert Assistant for Music Composition" Ninth Canadian Congress on Artificial Intelligence P roc. of Ninth Canadian Congress on Artificial Intelligence. 1992. 76 81. Http://citeseerx.ist.psu.edu/ Web. 10 Mar. 2012. < http://cite seerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.1060 >. PAGE 97 ! ,$ Rubbra, Edmund. "Preliminary Exercises in Counterpoint by Arnold Schoenberg (Faber, 6 Gns.)." Tempo 3.66 67 (1963): 59. Print. Schoenberg, Arnold. Preliminary Exercises in Counterpoint. London: Faber and Faber, 1963. Print. Schoenberg, Arnold, and Leonard Stein. Style and Idea: Selected Writings of Arnold Schoenberg New York: St. Martins, 1975. Print. Stuckenschmidt, Hans Heinz. Schoenberg: His Life, World, and Work New York: Schirmer, 1978. Print. Stuckenschmidt, Hans Heinz. Arnold Schoenberg. London: J. Calder, 1959. Print. Torsten Anders, Eduardo R. Miranda Higher Order Constraint Applicator s for Music Constraint Programming In Proceedings of the 2008 International Computer Music Conference Belfast, UK. 2008. Towsey, Michael W. Brown, Andrew R. Wright, Susan K. & Diederich Joachim Towards melodic extension using genetic algorithms. Educational Technology & Society 4 (2), pp. 54 65. 2001. Tsubasa Tanaka, Takuya Nishimoto, Nobutaka Ono, and Shigeki Sagayama, Automatic Music Composition based on Counterpoint and Imitation using Stochastic Models, Proceedings of SMC 2010 vol. in CD ROM, no. PS2 3, pp.1 8, Jul. 2010. Species counterpoint Grove Music Online Oxford Music Online 8 May. 2012 < http://www.oxfordmusiconline.com/subscriber/article/grove/mu sic/26378 >. Whittall, Arnold counterpoint The Oxford Companion to Music Ed. Alison Latham Oxford Music Online 11 May. 2012 < http://www.oxfordmusiconline.com/subscriber/ article/opr/t114/e1670 >. |