Page  00000188 A COMPUTER-BASED IMPLEMENTATION OF BASSO CONTINUO RULES FOR FIGURED BASS REALIZATIONS Adam Wead Jacobs School of Music Indiana University awead@indiana.edu ABSTRACT This paper documents an expert system for visually displaying differing rule sets for producing figured bass parts from a given, unfigured continuo part. The system is based on a decision tree procedure that is built from rules that have been interpreted and broken down into a set of attributes, with output classifications resulting in harmonizations. Besides the visual and explanatory appeal, it can also be used to generate new harmonizations and has the potential to serve as a basis for a historically-accurate accompaniment system. 1. INTRODUCTION Creating harmonizations from partially-figured or unfigured continuo parts is an art form in itself, and is a necessary part of early music performance, as well as a standard topic in musicological research. One way performers learn these skills is through practical experience or directly from a teacher. However, those concerned with true historical accuracy in performance often turn to the original treatises that were published during the seventeenth and eighteenth centuries. Most of these are available in facsimile and have been translated, allowing the interested performer or scholar to directly study the historical examples. This is not, however, a task to be taken lightly. Each of these treatises must be studied individually, and it is up to the performer to distill the different rules and concepts from each treatise, to create a comprehensive understanding that he or she would employ in the realization of a particular continuo bass. Some scholars have attempted to simplify this process through their own interpretations. Current studies of basso continuo practice either adopt a theoretical view, or a performance practice view. Although the two are not mutually exclusive, the intended audience for such studies is either scholars in the fields of music theory or musicology, or a group of performers and teachers. The scholarly view tends to focus more on the role continuo played in the historic development of western music and its related theories, while the practical view examines how one may learn the methods of continuo realization and use them in the performance of works which require an extemporized harmonic realization of a basso continuo part. It Ian Knopke Music Informatics Indiana University iknopke @ indiana.edu would be extremely desirable (from the point of view of the performer) to explore other ways to compare the original source in an automated or partially-automated fashion. Of special interest is the places where the various treatises, often from entirely different geographical regions, differ as to performance instructions. To date, this has not been attempted in any technologically-assisted manner. The project documented here explores an alternate, computerbased method for answering these questions. We envisions several applications for it. First, it provides a way to visually compare multiple sets of historical rules for harmonizing bass lines, a task that is difficult to do from the original texts alone. Also, the rule sets and derived decision tree can be used to automatically generate new, historically-accurate figured bass parts for given bass passages, and has the potential to be used in a live situation as the basis for an accompaniment system. 2. RELATED WORK Basso continuo and its related performance aspects have been studied for decades by musicologists and music historians. Some studies focus on specific performance aspects [5], while others look at a large cross-section of music from the period [18]. Perhaps the most comprehensive body of work is that by F. T. Arnold [1]. Of all these studies, this is the only one that attempts to provide an over-arching view of basso continuo practice as a whole. However, it should be kept in mind that Arnold presents a composite picture that he has devised and does not always draw a clear distinction as to how individual treatises differ on certain practices. Methods for automatically generating harmonizations have also been actively studied. Some are more general studies [13, 17], but most are concerned with specific styles such as the music of J. S. Bach [9, 10, 6, 8] or jazz harmonizations [15]. Some excellent work has been done on real-time accompaniment systems [3, 4, 2]. A good introduction to the basic concepts is that provided by Robert Rowe [14]. 188

Page  00000189 3. METHODOLOGY One of the goals of this project is to create a coherent, historically-accurate rule set for determining the proper figured bass for a given bass line. The rule set should adhere to the constraints of various treatises, and should be able to accommodate contradictions and differences in the recommended harmonizations that are recommended. The classic machine-learning approach to solving a problem of this sort is to train a classifier on a data set and "learn" the rules directly from the data [12]. This would require a large collection of bass lines with complete sets of figured bass already written in. We have not been able to locate such a data set. Unfortunately, most music collections from this time period are only partially figured, which would leave us with the difficult problem of filling in or "guessing" at how to complete all of the missing parts. Some collections are more complete, but do not exist in computer form. While these could be entered in a format such as Humdrum, creating a large enough data set is not trivial. Another problem is one of authority. In this case, the treatises are the "experts" that beginning lute players learn at least part of their craft from. Most machine learning classifiers are concerned with producing the correct classification based on the learned data set. Some pattern classifiers, such as neural nets, present major difficulties in understanding how a particular classification, or in this case harmonization was arrived at. In fact, we see this as a major difference between the fields of Music Information Retrieval and Music Theory. With MIR systems, the emphasis is primarily on getting the correct answers, while theorists and performers are often more concerned with the methodology that is used to produce the result. Additionally, we would like to be able to provide a compact representation of the rules, including comparisons between rules derived from different treatises, so a performer or theorist can more easily understand them and their place within the entire practice, and perhaps serve as a guide to understanding the entire set of rules. With these considerations, it seemed natural to instead consider an expert system derived primarily from the rules in the treatises themselves. However, this approach has its own complications. While the treatises certainly contain rules, these are not quite in a form that is ready to be used directly by a computer. For instance, consider the following quotation: And when the composition calls for a sixth, either directly or through resolution, together with the said major third, then the following note may have a fifth, and sometimes the fifth followed by a sixth. It may not be immediately clear to the reader that this procedure is intended to produce a root position chord above the bass. Also, treatise rules are not necessarily presented in logical orderings and may contain differences in language. Perhaps most importantly, some treatises do not contain complete sets of rules, but were instead intended to provide details for improving the playing of performers who, at the time, would have already had a basic understanding of accompaniment rules. The missing details need to be filled in. Two treatises were chosen to form the source for our initial data: a French treatise by Denis Delair published in 1724 [11], and an Italian treatise by Francesco Gasparini published in 1708 [7]. In addition to the close proximity of their publication dates, there were other reasons for choosing these two treatises. First, both contained fairly logical, straightforward rules expressed in a similar way. Secondly, both treatises contained simple instructions intended for beginners that could be used to construct a foundation of principles on which more complicated rules could be constructed later. Also, both treatises use the motion and direction of the bass line as one of the main factors for applying figures to bass notes that have no existing figures in them. We began with a single chapter from a treatise on accompaniment by Denis Delair that contained an introductory chapter on the basic application of figures to a bass line. After some experimentation, it was determined that each rule could be adequately explained using a set of approximately sixteen "questions" that could be asked of each bass note to determine the correct figure that should be applied. Each question can be represented by a single attribute in the form of a table. Some of the attributes in our table are: * Any figure already present with the bass note * The scale degree of the bass note * Any accidentals present * The function of the note, ie. part of a cadence, in a suspension * The intervallic direction of the bass line before and after the note in question * The direction and scale degrees of the notes before and after the note in question Each treatise rule was then carefully interpreted and expressed in terms of the above attributes, along with the proper harmonic outcome. Most rules produced a single outcome, but in some cases a single treatise example resulted in several different rules. We then used these rules as input to build a decision tree. The tree algorithm used here is a fairly standard ID3 model, with basic pruning of spurious results, similar to that described in the literature [12, 16]. Starting from the root node and assigning the correct value to each of the attributes is functionally equivalent to one of the treatise rules, and produces the proper figured bass symbol. At present, our tree contains approximately 150 nodes, with a maximum depth of eight. This indicates that not every attribute is needed in every situation to determine a proper 189

Page  00000190 harmony, and no single harmonization requires the complete set of attributes (although they are provided). While the entire tree is too large to be meaningfully reproduced here, an example of one branch is given in Figure 1. dicts itself. However, this has not happened yet. Certainly the different treatises differ as to how to resolve certain situations, but our rule set includes a treatise attribute that prevents completely opposing rules. The final decision tree is extremely useful for providing a visual way to interpret the result sets of each treatise. It also presents this information in a way that can be easily understood by others working in areas of music theory that may not be familiar with the intricacies of the technology involved. However, it can also be used to produce a new figured bass realization for an unfigured or partially-figured bass line. A worked-out example using the decision tree for a Corelli fragment is shown in Figure 2. The upper harmonization is Corelli's original, while the second line is a Gasparini/Delair composite, and the bottom harmonization uses only Delair's rules. It is intended that the procedure be automated, and eventually be used to produce historically-accurate harmonic realizations for an accompaniment system. Violin1 Violin 2 rPo _ I Violone Organo 7 C i:~iiii~i~ 54 6 2 Figure 1. Decision Tree Example It should be noted that our use of decision trees is somewhat unorthodox. Traditionally, each data instance used for training would result in one of a small, discrete number of classifications. By learning from a large number of instances, the tree algorithm is able to overcome errors in the data and other difficulties that arise in machine learning. In this case, data instances are replaced with rules, and most rules produce a unique harmonic result. This is equivalent to having a different classification category for each data instance, and has several non-standard effects. Our tree has a large number of leaf nodes, each expressing a different harmonic outcome, although the entropy algorithm tends to produce fairly compact trees in most situations. Another unusual effect is that the entire tree is remapped with the addition of new rules, and the order of nodes can change. This does not affect the decisionmaking capacity of the tree, but can be somewhat surprising in the choice of where to split nodes and the order in which they occur, especially with regards to the root node. Also, in a normal situation the tree algorithm is able to accommodate conflicts by going with the most common result in each situation. This doesn't work in the one-toone situation that occurs here frequently, and we will have difficulties if we ever come across a treatise that contra 5 ~54 6 5 6 7 5 4 5 3 Figure 2. Corelli Harmonization, and two new realizations 4. FUTURE WORK At present, approximately half of the rules from the two treatises have been incorporated into our rule set. While this forms a complete system and passably handles all possible harmonic situations, some of the choices can be somewhat bland. Many of the more advanced rules that we have not included provide more interesting musical choices. There are also several additional treatises that we are working to incorporate into our framework. We are working to incorporate as many of these as possible into our framework. 190

Page  00000191 We would like to use the basic decision making capacity of the system as the basis for a more complete accompaniment system that could automatically generate historically-accurate accompaniments for a solo instrument, based on a partial or even a completely unfigured bass line. The primary difficulty here is that figured bass gives a good explanation of the harmonic elements that must be sounded at a given point, but provides less guidance with regards to actual voice leading between harmonic entities. A basic voice leading system of some sort will need to be implemented to take this from the generation of symbols to actual sound. We are currently experimenting with methods to do this, and initial attempts involving simple rules such as carrying over common tones and avoiding parallels look promising. One of the initial goals of this project was to be able to display complete rule sets in a compact form that can be easily interpreted, as well as allowing comparisons between treatises. Our decision-tree based approach accomplishes this. However, these trees have a tendency to grow in such a manner as to be difficult to visualize with normal paper sizes, and reductions in size make it too difficult to read. It seems natural at this point to instead use a computer-based representation such as a web page, where the virtual boundaries can be expanded infinitely, perhaps onto multiple hyperlinked pages. This also has the possibility to include additional information that is difficult to fit into a single graph. The final product will probably include the possibility of clicking on a particular leaf node to bring up a popup box containing various pieces of metadata, including the original rule quotation that led to a particular leaf. 5. ACKNOWLEDGEMENTS The authors would like to thank professor Eric Isaacson of the Jacobs School of Music, Indiana University, and Frauke Jergensen of the University of California, Davis, for their assistance with this project. 6. REFERENCES [1] Franck Thomas Arnold. The art of accompaniment from a thorough-bass, as practised in the XVIIth & XVIIIth centuries. American Musicological Society-Music Library Association reprint series. Dover Publications, New York, NY, USA, 1965. [2] B. Baird. The artificially intelligent computer performer and parallel processing. In Proceedings of the International Computer Music Conference, pages 340-3, 1991. [3] R. Dannenberg. An on-line algorithm for real-time accompaniment. In Proceedings of the International Computer Music Conference, pages 193-8, 1985. [4] R. Dannenberg and H. Mukaino. New techniques for enhanced quality of computer accompaniment. In Proceedings of the International Computer Music Conference, pages 243-9, 1988. [5] Laurence Dreyfus. Bach's continuo group: players and practices in his vocal works, volume 3 of Studies in the history of music. Harvard University Press, Cambridge, MA, USA, 1987. [6] K. Ebcioglu. An expert system for harmonizing chorales in the style of j. s. bach. Understanding Music with AI: Perspectives on Music Cognition, pages 294-334, 1992. [7] Francesco Gasparini. The Practical Harmonist at the Harpsichord. Yale University Press, New Haven, CT, USA, 1968. [8] H. Hild, J. Feulner, and W. Menzel. HARMONET: A neural net for harmonizing chorales in the style of J. S. Bach. Advances in Neural Information Processing, 1991(4):267-74, 1991. [9] D. Hirnel. A multi-scale neural network model for learning and reproducing chorale variations. Computing in Musicology, (12):141-57, 1998. [10] D. Hjrnel and T. Ragg. Learning musical structure and style by recognition, prediction and evolution. In Proceedings of the International Computer Music Conference, pages 59-62, 1996. [11] Charlotte Mattax. Accompaniment on Theorbo and Harpsichord: Denis Delair's Treatise of 1690. Indiana University Press, Bloomington, IN, USA, 1991. [12] T. M. Mitchell. Machine Learning. McGraw-Hill, New York, 1997. [13] M. C. Mozer. Neural network music composition by prediction. Connection Science, 3(6):247-80, 1994. [14] R. Rowe. Interactive Music Systems. MIT Press, Cambridge, 1993. [15] P. Toiviainen. Modeling the target-note technique of bebop-style jazz. Music Perception, 12(4):399-413, 1995. [16] I. H. Witten and E. Frank. Data Mining: Practical Machine Learning Tools and Techniques. Morgan Kaufmann, San Francisco, second edition, 2005. [17] I. H. Witten, L. C. Manzara, and D. Conklin. Comparing human and computational models of music prediction. Computer Music Journal, 18(1):70-80, 1994. [18] Robert Zappulla. Figured bass accompaniment in France, volume 6 of Speculum musicae. Brepols, Turnhout, Belgium, 2000. 191