Analysis and Synthesis of Hindustani Classical Music H. V. Sahasrabuddhe UGC National Fellow Department of Computer Science University of Poona PUNE, INDIA 411 007 ( email: hvs@cs.unipune.ernet.in ) November 1992 ABSTRACT For the past few years, we have tried to build concrete computational models of performance in Hindustani (North Indian) Classical Music. In this article, I summarize the progress and outline future aims. In Hindustani Classical music, the roles of composer, arranger and performer appear inextricably mixed with each other. For us, however, it is important to separate these roles before any of them can be modelled on a computer. A finite automaton model built from given examples of performance can produce reasonable performance in a raga. Automatic as well as computer-assisted composition is possible with the above model. A small collection of phrases of varying length probably constitutes the vocabulary of a raga. Elements of that vocabulary are probably the atomic units of meaning/beauty. We are exploring several techniques to identify the vocabulary. We hope that in the long run this work will lead to deeper understanding of music and make music education better. A number of immediate applications are possible based on the present state of art. INTRODUCTION For the past few years, sometimes alone, sometimes with the help of students and/or co-workers, I have tried to build concrete computational models of performance in Hindustani (North Indian) Classical Music (see Bhattacharya 92, Oka 92, Suryanarayana 91, Upadhye 91, Upadhye 92). We call the subject of our research "Computational Musicology". To the best of our knowledge, ours is the first attempt to automatically compose melody in this kind of music. Automatic composition experiments have been reported in other kinds of music (e. g. IEEE 91). Beginning 1 December 1991, I am pursuing this research full time under a grant from the UGC (Universities Grants Commission, Government of India). In this article, I have attempted to summarize the progress so far and outline future aims. In my report to the VII Convention of the Computer Engineering Division of the Institution of Engineers, India, I had made a summary of the work till then (see Sahasrabuddhe, 91b). Use of some technical terms from Indian music is unavoidable. Homemade translations are provided for quick reading. Readers are warned against putting absolute faith in my translations. SCOPE Music is born in the moment when a _composer_ commits to a permanent medium an encoding of the system of sounds which listeners are to hear eventually, and which will be known as his work. Depending on the type of music this permanent medium can be the composer's memory, score on paper in some system of notation, or in some other form. The composer's product is usually abstract and in need of further elaboration. In some kinds of music the person who concretizes the work till every detail is spelled out is called an _arranger_. We shall use that term to denote this role regardless of the kind of music being considered. While the composer can expect his composition to be used many times over, the arranger must often do his work afresh for every performance. So far, the "music" that has been created exists only in the minds of people, or as marks on paper etc. The _performer_ translates this abstract object into actual sounds which the listener can hear and feel. In Hindustani Classical music, the roles of composer, arranger and performer appear inextricably mixed with each other (see Sahasrabuddhe, 91a). For us, however, it is important to separate these roles before any of them can be modelled on a computer. Musicians and musicologists lay great stress on the importance of _alankaras_ (ornamentation), especially _meend_ and _gamak_. Exact tonal relations (shruti) are likewise held as vital. We have decided to leave both out of our models at the beginning. In the case of alankaras this is simply to keep the model to its bare bones. In the case of tonal relations there is a greater danger - that of being misled by incorrect hypotheses. In both cases, we feel that these fine points can be better integrated with the models once the foundation has been well laid. Modelling the Raga form The notion of raga, defined by some as an engaging tonal context (ranjako swara sandarbhah), is central to our music. Many a textbook consists of chapters named after ragas. An early sign of interest having taken root in the mind of a listener is his ability to recognize ragas. Our work started with an attempt to model raga. After some trial-and-error, we have found that a finite automaton model built from given examples of performance (e. g. alaps given in a textbook) which remembers the last two notes can produce reasonable performance in a majority of ragas. We have further found that preserving information about elongation, grace notes, and/or successor selection frequencies often enhances the quality of performance. Figure 3.1 shows a brief example of two pseudo-alaps which use only three dummy notes - a, b and c, and the corresponding finite automaton. --------------------------------------------------------------------------- ababc,bc,bca. abc,bcaba. (a) the (pseudo-) alaps. state latest successor no. notes state(s) ----- ------ --------- 1 ab ba,bc 2 ba ab 3 bc ca,cb 4 ca ab 5 cb bc (b) a finite automaton model Fig. 3.1: Finite automaton model of a raga --------------------------------------------------------------------------- It should be noted that the finite automaton is not unique. Further, we do not claim that the entire raga is captured in it. It is merely one way to generate sounds which human listeners can (usually) identify as belonging to the modelled raga. COMPOSITION Automatic as well as computer-assisted composition is possible with the above model. Unaccompanied (mukta) alaps Convincing alaps are generated by a program which works in the following three stages: Generate a list of walks through the (linear graph representing the) finite automaton, such that each walk begins and ends in the middle Sa (tonic). Sort the list of walks according to the highest note reached (secondary keys may prove useful) Decide timing (i. e. punctuation) using knowledge in the finite automaton and/or the state of progress so far. We are experimenting with various alternate strategies for generation as well as punctuation. Bandishes Bandishes are fixed song compositions meant as bases for improvisation. Each bandish consists of a 'sthayi' (refrain) and one (usually) or more (less often) 'antaras' (stanzas). A good bandish contains many lines which can be repeated. A characteristic part is the 'mukhada', the piece to which one invariably returns after improvisation. Bandishes can be composed by analogy using the melodic pattern of one bandish as a guide to build another. Alternately ab initio design can be tried based on specifications. See (Sahasrabuddhe 87) for a discussion of bandish design. (Jairazbhoy 71, page 30) gives an example of a popular rhythmic template. Composer's assistant A notation editor which responds to commands at the musical phrase level or higher (e. g. "fill in a piece of this shape between these two points", "expand this piece to fit from here to there" etc.) is being built by one of us. While doing so, the editor is to observe raga and other fundamental rules. Such packages already exist for western music. We are trying to build one which has a knowledge of our music. AN OPEN PROBLEM The finite automaton model being used now is arbitrary in its adoption of a two-note memory across the board. All clues point to the hypothesis that a small collection of phrases of varying length constitutes the vocabulary of a raga. An extension to that hypothesis is that the elements of that vocabulary are the atomic units of meaning/beauty - rough analogs of words in natural language. Having said that, it is not at all clear how we can look for the vocabulary of a raga. We are exploring several techniques in parallel: Statistics Phrases of the vocabulary probably exhibit statistical behaviour distinct from non-phrases formed by concatenating a suffix of one phrase and a prefix of another. To be sure, phrases are expected to occur more often as a group. We need some more criteria like that to separate phrases and non-phrases with a satisfactory level of confidence; say to the point where psychological experimentation can take over. Mathematical programming Working under the assumption that the vocabulary is the smallest set of strings with the given distribution of length (and hoping that other clues exist to lead us to the pattern of lengths) we can construct a 0-1 integer programming problem on the (alap etc.) data whose solution defines the vocabulary of the raga. The class of 0-1 integer programming problems in general is computationally infeasible. Two rays of hope exist: A quick way to find a sub-optimal solution may yield an accurate enough solution. This type of problem may be special enough so that exploiting its special qualities an optimal solution can be found in reasonable time. We are looking at both these possibilities. Symmetry Melodic patterns are often found to have parallels half an octave away (a fourth or fifth apart) in any given raga. We are examining if there is a system to this phenomenon which applies across ragas. If it does exist, such a system may contain hints about semantic significance of phrases. Readers who have a greater understanding of music may see other possible ways to discover the semantically significant phrases in the vocabulary of a raga. We would welcome suggestions. CONCLUSION It is our fond hope that in the long run this work will lead to a deeper understanding of our music, and make music education faster and better. In the meanwhile, a number of immediate applications can be attempted based on the current or foreseeable state of art. Such applications span computer- aided instruction, software for composers, automatic composition of background music for computer animated video, non-repeating hold music for telephone switchboards and so on. Techniques developed in this research may also find uses outside computational musicology. As an example, the vocabulary of prosody is probably analogous to the vocabulary of a raga. Here, too, feelings are communicated through variation of pitch. Do we not refer to oriental languages as "sing-song"? Our investigation into Computational Musicology is not one which can be completed and closed after a few man-years of effort. However, the results so far are encouraging. We believe that significant progress will take place during the next one year. ACKNOWLEDGEMENTS We acknowledge the help of the Department of Computer Science, University of Poona for making its infrastructure available; Centre for Development of Advanced Computing (C-DAC) and Universities Grants Commission (UGC) for research grants; Rhythm House Pvt Ltd and Living Media India Ltd for supplying prerecorded cassettes at a concessional rate; and Magnasound Ltd for donating prerecorded cassettes. REFERENCES Bhattacharya 92: S Bhattacharya, H V Sahasrabuddhe "Computer Musicology - Searching for Symbols" 79th Indian Science Congress, Vadodara, Jan 1992. IEEE 91: Computer, vol. 24, no. 7, July 1991 - special issue on Computer-Generated Music. Jairazbhoy 71: N A Jairazbhoy "The Rags of North Indian Music" (book) Weslean University Press, 1971. Kumarji 90: Kumar Gandharva "Workshop on Music" (workshop) Vashi, New Bombay, Nov 1990. Recording available at ABGMV Mandal, Miraj. Oka 92: V Y Oka, "Studies on Computer-Generated Hindusthani Shastreeya Sangeet" M Sc dissertation, University of Poona, 1991. Sahasrabuddhe 87: Veena Sahasrabuddhe "Taranya Vishayi Kahi Sangeetik Vichar" (in Marathi) D Mus Thesis, ABGMV Mandal, 1987. Sahasrabuddhe 91a: Veena Sahasrabuddhe "Yashaswi Maifalicha Akrutibandh" (in Marathi) Ganavardhan, Pune, Jun 1991. Sahasrabuddhe 91b: H V Sahasrabuddhe "Computational Musicology" Proc VII National Convention of the Computer Engineering Division, Institution of Engineers, Pune, Apr 1991. Suryanarayana 91: P V Suryanarayana and H V Sahasrabuddhe "Musical Cryptography" Proc CSI National Seminar on Data Security, Goa, Apr 1991. Upadhye 91: R Upadhye, H V Sahasrabuddhe "Role of Consonances in Indian Classical Music" International Workshop on Speech, Music and Allied Signal Processing, New Delhi, Dec 1991. Upadhye 92: R Upadhye, H V Sahasrabuddhe "On the Computational Model of Raag Music of India" Workshop on AI and Music, 10th European Conference on AI, Vienna, 1992