Searching for a Common Language of Ragas H. V. Sahasrabuddhe then at Department of Computer Science University of Poona PUNE, INDIA 411 007 (current email: hvs@it.iitb.ac.in) presented at Indian Music and Computers: Can 'Mindware' and Software meet? A seminar held on 16 August 1994 at the India International Centre, New Delhi 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, Sahasrabuddhe 92, Suryanarayana 91, Upadhye 91, Upadhye 92). From 1 December 1991 to 30 November 1993 I pursued this research full time under the National Fellowship of the UGC (Universities Grants Commission, Government of India). In my previous article (Sahasrabuddhe 92), I attempted to summarize the progress till then. Since then, we have made a first attempt towards examining the hypothesis that there is a common vocabulary of melodic phrases which is utilized by different ragas. This article describes that attempt and proposes further experiments. 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. Background 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. Figure 3.1 depicts the process outlined above. In Hindustani Classical music, the roles of composer, arranger and performer appear inextricably mixed with each other (see Sahasrabuddhe 92). For us, however, it is important to separate these roles before any of them can be modelled on a computer. --------------- --------------- non-musical | | embryonic | | ------------>| compose |--------------->| arrange | stimuli | | composition | | --------------- --------------- | | filled-out composition | | V --------------- --------------- non-musical | | sounds of | | <------------| listen |<---------------| perform | responses | | music | | --------------- --------------- Figure 3.1: Steps in the creation and enjoyment of music I had offered the following explanation for not taking into consideration alankaras and shrutis in (Sahasrabuddhe 92). The reasons as well as the decision are still in force. "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." Tools for composition HVSTOOLS is a set of programs designed to help in generating and using finite automaton models of Hindustani ragas. All programs except shplay are in Pascal and can run on any platform which supports the language and has adequate memory. The sound-producing program shplay is in C. It runs on IBM-PC-compatibles. It consists of three types of tools: a finite-automaton constructor, finite-automaton printing tools and automatic alap-generator. Finite-automaton constructor Program alpfa (alaps to finite automaton) constructs a finite automaton model from given examples of performance (e. g. alaps given in a textbook). The input uses SRGMPDN for shuddha notes and rgmdn for vikrit notes; comma and period are employed in the same manner as in Pt. Bhatkhande's textbooks (Bhatkhande). The output of alpfa can be accepted as input by the printing tools as well as by the first link in the alap generator chain. The first line of alpfa output should be removed or shifted to the end before using the output. Printing tools Two formatters are provided so that the finite automaton models can be printed for manual study and use. Both produce ascii files. Program pfcrh prints the finite automaton in tabular form suitable for use in manual composition experiments. Successors as well as predecessors of a state are shown, so that composition can proceed forward or backward. Program pfrel also prints the finite automaton. It positions successors according to the pitch interval between the second notes of the current state and the successor in question, so that harmonic relationships between state pairs can be studied. Composition tools Convincing alaps are generated by a two-step process involving programs gen94 and fsep93. Program gen94 generates a list of walks through the (linear graph representing the) finite automaton, such that each walk begins and ends in the middle Sa (tonic). The walks are output sorted according to the highest note reached (secondary keys are used). Program fsep93 converts the walks produced by gen94 into alaps by deciding timing (i. e. punctuation) using knowledge in the finite automaton, user- specified parameters and the state of progress of the alaps. Analysis of phrases We analyse all sequences of 3 to 5 notes occuring in the swar-vistars given in Pt. Bhatkhande's books (Bhatkhande). This range of lengths was selected intuitively. Results already obtained seem to support the choice. We decided, tentatively, that a phrase must include an inflection (reversal of the direction of pitch movement) in order to qualify as an object of study. Periodic re-examination of this decision is planned. Phrases involving the same movement are treated as one regardless of the starting swar. That is, SRS, rgr, RGR etc are considered the same phrase. We do, however, keep track of the starting swar and display it in the detailed output to be described below. phrase number of starting swars length 1 2 3 4 5 6 7 8 9 10 11 12 3 2 5 8 3 3 13 11 6 2 2 3 1 4 199 155 85 62 36 27 21 6 4 8 0 0 5 245 124 87 22 16 8 18 5 4 5 0 0 (a) phrase length vs number of starting swars phrase number of contexts length 1-5 5-10 11-15 16-20 21-25 26-30 31-35 36-40 41-50 more 3 8 6 4 8 6 7 7 5 2 7 4 395 88 46 31 21 6 7 6 3 0 5 420 64 25 7 8 8 2 0 0 0 (b) phrase length vs number of contexts Figure 5.1: Histograms of phrase usage Histograms We counted the number of distinct contexts in which a phrase occurs. By context we mean the raga and the starting swar. Thus, if SRS and MPM both occur in raga Foo, that is counted as two contexts in which the phrase SRS has occured. (Having decided to consider SRS and MPM as the same phrase, we use the form SRS as the canonical representation.) Swar-vistars of the following 38 ragas from (Bhatkhande) were used as data for the analyses discussed below: Adana Asavari Bageshri Bahar Basant Bhairava Bhairavi Bhimpalasi Bilawal Chhayanat Deskar Gaud-Malhar Gaud-Sarang Hindol Jaijaivanti Jaunpuri Kafi Kalingada Kamod Kedar Khamaj Lalit Malkauns Marwa Miyan-Malhar Multani Paraj Piloo Pooriya Poorva Pooriya-Dhanashri Ramakali Shankara Shree Shudha-Kalyan Sohni Vrindavani-Sarang Yaman Figure 5.1 shows the histograms of phrase occurences obtained through the analysis of the above data. Detailed analysis We are in the process of studying several more detailed analyses. All contexts in which a particular phrase occurs can be printed out. If this is done for all phrases, the output is enormous. Therefore, minimum thresholds are placed on the numbers of starting swars and of contexts. A perhaps more interesting study prints the list of contexts for a phrase of length 3, immediately followed by similar lists for all phrases of length 4 which have the first phrase as a substring (either prefix or suffix). An extract of this output appears in Figure 5.2(a). Each raga is represented by one bit in the bit vector printed against a starting swar. The key to raga identification appears in Figure 5.2(b). phrase class S-D+S roots :11 ragas : 62 S: 0017206040100 R: 0000100000002 g: 0000000200000 G: 0100011113650 M: 6005544040004 m: 0000000020000 P: 0002404005122 d: 0040000200000 D: 0000201102010 n: 4220000040000 N: 1100010015640 phrase class S-D+S-P roots : 5 ragas :15 S: 0006006000000 G: 0000000003000 P: 0002400000120 n: 4020000040000 N: 1000000010000 phrase class S-D+S-d roots : 2 ragas : 2 G: 0000000002000 N: 0000000004000 phrase class S-D+S-D roots : 9 ragas :43 S: 0007204000000 g: 0000000200000 G: 0100011113640 M: 4005004040004 m: 0000000020000 P: 0002404000120 D: 0000201102000 n: 4200000040000 N: 1100010011640 phrase class S-D+S-n roots : 2 ragas : 2 S: 0000000040000 R: 0000000000002 phrase class S-D+S-N roots : 4 ragas : 4 S: 0010000000000 M: 0000400000000 P: 0000000001000 n: 0000000040000 phrase class S-D+Sr roots : 3 ragas : 9 G: 0100011000000 m: 0000000020000 N: 0100010014400 phrase class S-D+SR roots :10 ragas :32 S: 0003006000100 R: 0000000000002 g: 0000000200000 G: 0000001112410 M: 6000140000004 P: 0002000004102 d: 0040000200000 D: 0000201100010 n: 4020000000000 N: 1000000001000 phrase class S-D+Sg roots : 3 ragas : 6 R: 0000100000000 G: 0100000001000 D: 0000201100000 phrase class S-D+SG roots : 3 ragas : 6 S: 0003200000100 P: 0000000000020 d: 0000000200000 phrase class S-D+SM roots : 2 ragas : 4 S: 0001000000000 P: 0002000000120 phrase class S-D+Sm roots : 1 ragas : 1 S: 0000200000000 phrase class S-PGP roots : 1 ragas : 5 S: 0002404000120 phrase class S-dMd roots : 2 ragas : 2 G: 0000200000000 N: 0000000000020 phrase class S-DmD roots : 1 ragas : 1 S: 0000200000000 phrase class S-nPn roots :10 ragas :30 S: 0020000040000 r: 0000000001440 R: 0017006000100 G: 0000000000002 M: 0000000200000 m: 0000001103440 P: 0000100000004 D: 0002000000120 n: 0000000200000 N: 0000201100010 phrase class S-NdN roots : 4 ragas :13 S: 1100010014240 M: 0100011010000 P: 0000000020000 d: 0000000004000 phrase class Sr-n+r roots : 2 ragas : 2 G: 0000400000000 N: 0000000040000 phrase class SR-N+R roots : 2 ragas : 2 S: 0000100000000 d: 4000000000000 phrase class SgSg roots : 9 ragas :31 S: 0000000200000 r: 0000011101400 R: 6000044040000 g: 0000000020000 G: 0002404001120 m: 0000201000000 P: 4220000040000 d: 1000010004400 D: 0002204000000 phrase class SGrG roots : 2 ragas : 8 S: 0100001013210 M: 0000001000000 phrase class SMRM roots : 5 ragas :14 S: 4005404040000 R: 0000000000120 G: 0000000002000 m: 0000000001000 P: 0005002000100 phrase class Smgm roots : 1 ragas : 1 S: 0000000020000 Figure 5.2(a): Extract of detailed phrase analysis digit 1 bit 4 Adana digit 1 bit 2 Asavari digit 1 bit 1 Basant digit 2 bit 4 Bageshri digit 2 bit 2 Bahar digit 2 bit 1 Bhairava digit 3 bit 4 Bhairavi digit 3 bit 2 Bheempalasi digit 3 bit 1 Bilawal digit 4 bit 4 Chhayanat digit 4 bit 2 Deshkar digit 4 bit 1 GaudMalhar digit 5 bit 4 GaudSarang digit 5 bit 2 Hindol digit 5 bit 1 Jaijaivanti digit 6 bit 4 Jaunpuri digit 6 bit 2 Kafi digit 6 bit 1 Kalingada digit 7 bit 4 Kamod digit 7 bit 2 Kedara digit 7 bit 1 Lalit digit 8 bit 4 Khamaj digit 8 bit 2 Malkauns digit 8 bit 1 Marwa digit 9 bit 4 MiyanMalhar digit 9 bit 2 Multani digit 9 bit 1 Paraj digit 10 bit 4 Pilu digit 10 bit 2 Pooriya digit 10 bit 1 PooriyaDhanashree digit 11 bit 4 Poorvi digit 11 bit 2 Ramkali digit 11 bit 1 ShuddhaKalyan digit 12 bit 4 Shree digit 12 bit 2 Shankara digit 12 bit 1 Sohni digit 13 bit 4 VrindavaniSarang digit 13 bit 2 Yaman Figure 5.2(b): Identity of raga bits in (a) Acknowledgements We acknowledge the help of the Department of Computer Science, University of Poona for making its infrastructure available and Universities Grants Commission (UGC) for the National Fellowship. References Bhatkhande V N Bhatkhande, "Kramik Pustak Mala", vols 2-6, Hathras (UP): Sangeet Samiti. Bhattacharya 92 S Bhattacharya, H V Sahasrabuddhe "Computer Musicology - Searching for Symbols" 79th Indian Science Congress, Vadodara, Jan 1992. Oka 92 V Y Oka, "Studies on Computer-Generated Hindusthani Shastreeya Sangeet" M Sc dissertation, University of Poona, 1992. Sahasrabuddhe 91 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 Sahasrabuddhe 92 H V Sahasrabuddhe "Analysis and Synthesis of Hindustani Classical Music" Department of Computer Science, University of Poona, November 1992