# Aspects of Stochastic Music

Skip other details (including permanent urls, DOI, citation information)This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License. Please contact mpub-help@umich.edu to use this work in a way not covered by the license. :

For more information, read Michigan Publishing's access and usage policy.

Page 00000208 Aspects of stochastic mtisic conrad berhorster conni@c-lab.de 30th July 1999 Abstract Preceding from the problem of analysing music and controlling stochastic musical processes, it will be shown, that engagement with mathematical music theory can be very helpful to develop new views. By modelling music as a stochastic process, the crucial points are the time-discrete and time-independent processes,which are known as markov chains. For this, it is necessary to introduced the characteristics of stochastic matrices and markov set chain theory. To test those theories a tool called SIMMARKOV was developed, which makes it feasible to investigate music from MIDI notes and, reverse, to synthesis the results directly. This intuitive and easy to use software, which is build in (platform independent) JAVA shall be a tool for composers and scientists to lead their interests in stochastic processes. 1 Introduction Since the arise of computer, people have used them to produce music. With the years some different methods of soundsynthesis and synthesis of notations were developed. As a counterpoint to the serialism and paradoxically as a product, too, some composers started to investigate methods of composing with random and statistics. This was motivated by the need to build non-deterministic algorithmical compositions. These methods first occured in the 18th century by Mozart and Kirnberger, who tried to educate composers through a system of measuretables and 2 dices (ars combinatoria). Although such a kind of composing process is not an achievement of the current century, the popularity of those methods nowadays is enormous. Stockhausen und Cage used aleatoric techniques to delegate parts of the compositional process to the performer. For instance, in Stockhausens Klavierstu"ck XI, the artist must select the pieces, he is about to play, randomly. Only the material is given by the composer. In this way no performance can be given twice. With the upcoming of algorithmic composition, the aleatoric technique are supported by the computer. If one considers the theoretical expertise of these field, often mathematics give the notion, but the concepts are still hiden. The methods of empirical investigations, build on those concepts, were totally ignored by composers and wide range of musicologists1. To communicate about music, it is necessary to build a precise terminology. Especially the aleatoric can be used to give new inputs to composers if they engage into this field (6]. 2 Related Work With the upcoming of kybernetics and statistics, there is also an upcoming of mathematical music theory. One of the measures that can be used to describe a piece of music is the distribution of parameters of music. Hiller [4] begun investigating music with statistics in 1957. He build his ILLIAC Suite with data of Mozarts Stringquartetts. At the same time Fuchs [2] tried to find musical invariants through statistics. He investigated the obvious musical parameters and used them to classify the results for the benefit of musical synthesis. First of all he tried to do this with the mean value and variance, but he became sucessful at the variance of fourth order. At this so called Kurtosis, he found significant differences of musical styles, but his studies showed an increase of variance from style to style. His results were limited through restricted set of data. He used less than 50 symphonies for his empirical studies. The new technologies made it easy to start statistical research in a wider range, especially to capture the style of composers. One way to describe (musical) processes in a mathematical way is through markov chains. 'Many composers use science terminology, but for instance the so called stochastic music has nothing todo with a mathematical (or algorithmical) composing process. of Xenakis (9] or Stockhausen -208 - ICMC Proceedings 1999

Page 00000209 3 Markov Chains A homogeneous Markov Chain is a stochastical process, where the probabilities did not depend on time. Hence only the current state (and no date back state) is important to make statements of the future states. Further we deal with discrete state parameters (in a state space I), because of the nature of musical notation. In mathematical terminology it sounds like Definition:A (discrete) Markov Chain is a sequence of discrete random variables zx, n > 0 possesing the following property: for any n > 2, and any (il,..., in) E I we have Prob(xn(w) = inlZo(u) = io,...,rn-(w) = in-i) = Prob(xn(w) = inza-1(w) = i,-t) (1) with Prob(z,(w) = in) > 0 for all n. One can consider a tune, where the pitches of the notes are for example cdefgdedgg. (2) While statistics consider the values itself, markov statistics calculated the transition between two notes. This are at time tk zu tk+l for all 0 < tl <... < t,. The so called transition probabilities are recognized by the transitions from one state to another. The key notion of the theory of finite Markov chains is of a one-step transition matrix, where one row stands for one note. Definition: A matrix A = (aij) is called stochastic if a3j > 0 for i,j = 1,...,n and j. aj = 1 for i = 1,...,n. To simulte a new instance of a sequence, the instanciate state, which is a vector vi, and the matrix anj will be need. The matrix has no zero value rows and to get a transition matrix, the transitions must be count and normalized. A shows this for the sequence (2). c d e f g c d e f g c [0 1 0 00c c 00 1 0 0 0 d 0 0 3 0 1 d 0 0.75 0.25 e 0 1 0 1 0 e 0.5 0.5 0 (3) f 0 0 0 0 1 / 0 0 0 0 1 g 0 1 0 0 1 g 0.5 0 0.5 How [5] figured out, a random walk (brownian motion) is easy to build with a matrix B, where zero are on the main diagonal and only the sidebands are filled with numbers a E (0, 1). Also Arpeggiatos can be build easily with the matrix C. c d# e g b h 0 1-a 0 0 0 1 c 0.5.5 0 0 0 a 0 1-a 0 0 d# 0 0 0 1 0 0 B= 0 a 0 1-a 0, C= e 0 0 0 1 0 0 (4) 0 0 a 0 1-a g 0 0 0 0 1 0 0 0 0 a 0 b 0 0 0 0 0 1 h 10 0 0 0 0 To make predictions of simulating a sequence of length n, it only needs to multiplicate the matrices v * A * A"-2. From this reason, much of Markov Chain Theory concerns limits of power of stochastic matrices. To give a short view into the powerful investigations of markov chain theorie, it will need some classifications. We say i leads to j and write i -+ j if there exists a positive m such that p) > 0. Every state leads to some state. We say that i and ] communicate (i *+ j), if i -+ j and j -+ i. The relation -+ is not reflexive nor symmteric, but it is transitive since (m+n) (m) (n) Pik >Pij Pjk ' The relation ++ is thus symmetric and transitive, it is reflexive over the set of states which communicate with other states, thus dividing them into disjoint subsets called classes. Thus a class is either a set of two or more mutually communicating states or consistes of a single state. The class containing the state i is denoted C(i). A property defined for all states of a class is called a class property. Clearly the negation of a class property is also a class property. In the following there were be some class propertes listed. befinition: If there exists a n with pj) > 0, it called essential.state, otherwise it will be called inessential state. ICMC Proceedings 1999 -209 -

Page 00000210 Set f/, = Prob (Xn(w) = J for some n > OIXo(w) = i). A state i is called recurence or non-recurrent according as fi = 1 or < 1. Now some statements can be made. Theorem: 1.) An essential state cannot lead to an inessential state. 2.) The property of having a period equal to d is a class property. 3.) To every j E C(i) there corresponds a unique class rj mod d such that p 7) > 0 implies n ri(mod di). 4.) A transition matrix A has at least one essential state. A Markov chain is called essential, if all states are connected. Otherwise it can be classified into the following canonical form (5). Pi 0... 0 0 o P2 0 0 0 o0 o. o0 (5) o... o P, 0 R Q Pi are matrices of essential states. If a Markov Chain came into Pi, it never can leave it. Q are the set of all inessential states. because of the class property. What will happen with a Markov Chain in the long run is part of the convergence2. Theorem: Let A be a stochastic matrix with some inessential vertices, and written in canonical form. Let Q denote the bottom right submatrix of A assosiated with the inessential vertices. Then, as k -+ 00, Qk -. 0. The critical point are the transition between the essential into the inessential states. To got deeper into this will leave the focus of this paper and must be looked up in [8] [1]. More insight into the theorie can be get through eigenvalues, which can be used to classify Markov Chains easily. Definition: If A is a n x n matriz, than we call the vector 0 f v eigenvalue, if Av = Av. And the following Theorem: If A is a stochastic matrix then 1 is one of its eigenvalues. If in addition, A is regular then 1) the eigenvalue 1 is simple. 2) all eigenvalues other than than 1 are smaller, in modulus, than 1. 3) A has a stochastic eigenvector, say y, belonging to the eigenvalue 1, and limk+oo Ak = ey. The canonical form show, that the exchange of columns and rows has no effect of calculating the eigenvalues. Figure 1: A SimMarkov Picture 2Convergence is questionable in the field of musical applications, but it brought up interesting results. - 210 - ICMC Proceedings 1999

Page 00000211 4 The Software To visualise these theories practically in a musical way and approve those musical facts, a application SIMMARKOV was build. These software can be started with java SimMarkov filename if a existing MIDI shall be analysed or with java SimMarkov paramList, where paramList is a list of parameters consisting the first parameter is a (H,V,A,S), the second Parameter is a notename (c,c#,d,d#,...,b,h) and the third one is number between 1 and 9. An example can be java SimMarkov Hc4 Hd#4 Se3 Vg7, as shown in Figure 1. The second figure shows a Markov statistic of above matrix to analyse MIDI file like citefucks have done this without computational help. 0.090.0O9.0.0.09C.0Q.090.9.5 D.0A 3303M333Es Mm -9 -8 -7 -6 -5 -4 -3- -2 2 3 4 5..a 8 9 Figure 2: A SimMarkov Statistic Picture With the options of this application, the classification is easy. The tranformed matrix can be saved in the MAPLE data format to evaluate the eigenvalues. With those results, it is easy to classify the matrix and calculate the behaviour of the matrix. 5 Conclusion The presented investigations had shown, that stochastic processes can be steered and used as a creative tool to open the door to mathematics for composers and musicologists. To give a short overview, the advantages are an intuitive usage, an easy access to mathematics and a method to improvise in different styles. The problems while composing with Markov Chains are the non-existence of additional parameters and the loss of possibility to consider time, because of the implicit model. As an outview, it is possible to search for invariants of stochastic music and investigate these in different styles. While try out those limits of application, it had been shown for the synthesis of music notation a rule of thumb can be: The less the set of states, the better the copy of style. The JAVA based free software can be ordered via e-mail. References [1] Chung, K. L., Markov Chains with stationary Transition Probabilities. Springer, New York 2nd edition, 1967. [2] Fucks, W. Exaktwissenschaftliche Musikanalyse. Westdeutscher Verlag,, Kiln und Opladen, 1965. [31 Hartfield, D.J. Markov Set-Chains. Lecture Notes in Mathematics 1695, Springer, 1998. [41 Hiller, L., Isaacson, L.,Experimental Music Compositon with an electronic Computer. Greenwood Press Publishers, 1959 [5] Jones, K., Compositional Applications of Stochastic Processes. Computer Music Journal, Vol.5, No.2, 1981 [6) Marom, Y., Improving Jazz With Markov Chains. Dissertation, 1998. [7] Moore, F. R., Elements of Computer Music. Prentice Hill, 1990. [8) Senata, E., Non negative Matrices and Markov Chains. Springer Verlag New York, 1973 [9] Xenakis, I., Formalized Music. Indiana University Press, Bloomington, Ind, 1971. ICMC Proceedings 1999 - 211 -