# Implementing algebraic methods in OpenMusic.

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 00000001 Implementing algebraic methods in OpenMusic. Moreno Andreatta, Carlos Agon Ircam, Centre George Pompidou, France email: {andreatta, agon}@ircam.fr Abstract In this paper we present the main ideas of the algebraic approach in the field of the representation of musical structures. In this perspective, well-known theories, as American Pitch-Class Set Theory, can be considered as a special case of the mathematical concept of group action. We show how the change of the group acting on a basic set enables to have different catalogues of musical structures, as well in the pitch as in the rhythmic domain. The OpenMusic implementation of these concepts offers to computational musicology the possibility to approach music analysis with a more firmly established theoretical background and at the same time it leads to new interesting compositional applications. 1 Introduction Since the Sixties, algebraic methods have been progressively integrated into musictheoretical research. Many composers, like Milton Babbitt, lannis Xenakis and Anatol Vieru explicitly employed group structures as an important feature of compositional processes. This is due, basically, to the abstract power of these concepts, which are suitable for application in the pitch- as well as in the rhythmic domain. It is not surprising, therefore, that all the composers mentioned before have been conscious of this double perspective offered by group theory. Some of the most advanced formalisation of the so-called PitchClass Set theory (PCS-Theory) take grouptheory as a common paradigm (Lewin, 1987; Morris, 1987). We firmly believe that an algebraic approach to music theory, analysis and composition could be able to present some well-known concepts, like Allen Forte's PCSTheory (Forte, 1973), in a very elegant form by showing, at the same time, new possible strategies for generalisation. This is the aim of the algebraic-oriented implementation that we realised in the visual programming language OpenMusic developed by the musical representations team at Ircam (Assayag et al., 1999). Our approach, which takes into account several families of groups, aims at giving the possibility to the music-theorist and composer to choose between different libraries, according the different meaning of the notion of 'musical equivalence'. In the case of the library Zn we used the algebraic properties of the cyclic group Z/nZ of order n and the action of this group on itself. This provides an algebraic formalisation of the musical concept of transposition. By considering transpositions and inversions, we obtain a new group, the dihedral group, whose action on Z/nZ leads to Allen Forte's 224 pitchclass sets. The possibility of applying such structures in analysis, as well in composition, is profoundly related to the group-theoretical paradigm that has been considered. This is crucial in a domain like computational musicology in which the computer-aided manipulation of musical structures, particularly in analysis, is always subjected to methodological procedures and epistemological discussions. The concept of group, and that of group action in particular, is far from being simply a technical tool. By quoting the French mathematician Henri Poincare, "the general concept of group preexists in our minds. [It] is imposed on us not as a form of our sensibility, but as a form of our understanding" (Poincare, 1905). In the following section we summarise some basic group-theoretical concepts. Section 3 describes transposition classes of chords in terms of group action. Section 4 shows how the same concept enables to formalise PCS-Theory simply by changing the group acting on a given set. The analogy between equivalent classes of chords and rhythmic orbits under some group action is discussed in section 5 by means of a special family of rhythmic canons, called "tiling canons". Some open problems arising from the rhythmic interpretation are discussed in the final section. 2 Some basic definitions This section introduces some basic grouptheoretical concepts. We will discuss the musical interpretation in the following section.

Page 00000002 2.1 Definition of a group By definition a group is a set G of elements together with a binary operation " " such that the four following properties are satisfied: Closure: a b belongs to G for all a and b in G. Associativity: (a b) c = a (b c) for all a, b, c belonging to G. Identity: There exists a unique element e in G such that a e = e a = a for all a in G. Inverses: For each element a in G there exists a unique element a' in G such that a a'= a' a = a In particular we will concentrate on two groups that are interesting for music: the cyclic and the dihedral groups. 2.2 Cyclic groups A cyclic group of n elements (i.e. of order n) is a group (G, ) in which there exists an element g (usually more than one) such that each element of G is equal to g g... g, where the group law " " is applied a finite number of times. In other words, G is generated by g. In general a cyclic group of order n is generated by all integers d which are relatively primes with n (i.e. 1 is the only common divisor of n and d). Usually a cyclic group of order n is represented the set {0,1,...,n-1} of integers (modulo n) and it will be indicated as Z/nZ. Geometrically, a cyclic group can be represented by a circle. Integers 0,..., 11 are distributed uniformly, as in a clock. One may go from an integer to another simply by rotating the circle around his centre by an angle equal to a multiple of 30~ - for the 12 notes group. Musically speaking, rotations are equivalent to transpositions, as we will see in the next session. 2.3 Dihedral groups A dihedral group (Dn, ) of order 2n is a group generated by two elements a, b such that: 1. a a... a = a" = e where the group operation " " is applied n times and e is the identity. 2. bb=e In other words, the dihedral group Dn consists of all 2n products a' b' for i from 1 to n and j=1 or 2. The name dihedral (two-faced) stems from the fact that geometrically the dihedral group corresponds to the group of symmetries in the plane of a regular polygon of n sides. These symmetries are basically of two types: rotations and reflections (with respect to an axis). Musically speaking, reflections are inversions with respect to a given note that is taken as a fixed pole. 2.4 The action of a group on a set By definition a group (G, ) acts on a set X if it exists a map ACTION from GxX to X such that two conditions are satisfied: 1. ACTION (a b, x) = ACTION (a, ACTION (b x)) for every a, b in G and s in X. 2. ACTION (e, x) = x for every x in X, where e is the identity of G. The first property is a kind of compatibility condition between the action concept and the group law; the second property guarantees that the identity element of G will operate as an "identity action", by leaving invariant each element of the set. Two elements x, y in a set X are conjugated if they are the image one of the other under the action of G on X, in other words if there is an element a in G such that y = ACTION (a, x). Conjugation is an equivalence relation (it is reflexive, symmetric and transitive). Equivalence classes under an equivalence relation are also called orbits. Musically speaking, the actions of the cyclic group (on the set of pitches) defines transposition classes of chords. Orbits under the action of the dihedral group correspond to the so-called pitch-class sets. Before discussing the musical relevance of these two actions, we would like to introduce a new interesting operation on Z/nZ: the affine transformations. By definition an affine transformation from Z/nZ into itself is a function f which transforms a pitch-integer x into ax+b (modulo n) where a is an integer relatively prime with n and b belongs to Z/nZ. In the special case of n=12, the multiplicative factor a belongs to the set U={1,5,7,11}. Note that an affine transformation reduce to a simple transposition by taking a=1. On the other side, inversions are affine transformations with a=11. Therefore, the choice of a specific group acting on a set is not only a technical problem but has some interesting musicological consequences. Z/nZ, Dn and the group Affn of affine transformations enable different definitions of the concept of musical equivalence. Note that two structures that are equivalent under Z/nZ are naturally equivalent in Dn. The same holds for two equivalent structures in Dn. They will be equivalent in Affn. The following two sections describe the case of Z/nZ and Dn. The case of affine orbits is an open field of research (Mazzola, 2002). A comparative example of musical orbits under the three previous groups is given at the end of section 4. 3. Transposition classes of chords or the action of Zn on Zn

Page 00000003 As pointed out somewhat emphatically by lannis Xenakis, it is a fact that "after the Twentyfive centuries of musical evolution, we have reached the universal formulation for what concerns pitch perception: the set of melodic intervals has a group structure with respect to the law of addition" (Xenakis, 1965). In other words, any division of the octave in a given number n of equal parts can be represented as a group, the cyclic group of integers modulo n, with respect to the addition modulo n. Figure 1 shows the usual 'clock' representation of the 12-tempered system as generated by the well-known circle of fourths. Ii ~ 1 Figure 1. Circle of fourths in the system. 12-tempered In the case of the 12-tempered system we can have three more circles in addition to the circle of fourths that we mentioned before. They are the circles of minor seconds, of fifths and of major sevenths, corresponding to the integers 1, 7 and 11 respectively, all numbers which are relatively primes with 12. As mentioned in the previous section, the cyclic group Z/nZ could also be considered as generated by operations, instead of by elements. Let Tk be the transposition of k minimal divisions of the octave (i.e. semitons in the case n=12). For any integer k relatively prime with n we have that Tk generates the whole cyclic group. By definition, given two transpositions Tk and Th we simply define the product of transpositions as follows: Tk Th = Tk+h where the addition k+h is computed modulo n. The axioms that guarantee the groupstructure (closure, associativity, identity and inverses) are easily verified. Moreover, this map has two main properties with respect to Z/nZ considered as a set: 1. (Tk Th ) (x) = Tk(Th (x)) for every transposition Tk, Th and for every x in Z/nZ. In other words, transposing a pitch-integer by h semitons and successively by k semitons will be the same as transposing the pitch-integer by h+k semitones (modulo n). 2. To (x) = Tn (x) = x for every x in Z/nZ, where To (or Tn ) is the identity transposition. This means that the identity transposition simply "acts" as identity operation for a given pitchinteger. By remembering the definitions introduced in section 2.4 we may conclude that musical transpositions define mathematical actions. Classifying transposition classes of chords is also equivalent to study orbits under the action of the group Z/nZ on itself. A first problem concerns the computation of all these orbits. A basic function of Zn library, card, enables to calculate the number of transposition classes of k-chords (i.e. chords with k elements) in a given n-tempered division of the octave. The patch shown in Figure 2 shows the situation for n=12 and n=24. There are, for example, 80 hexachords (k = 6) in the 12-tone temperament. They are much more (5620) in the division of the octave in 24 equal parts. 1 2 4 6 1 2 3 4 5 6 7 10 11 -- -12 13 14 15 16 17 18 i 2 21 22 23) 30667 54484 81752 1040 112720 S 6 G 4 3 19 6 1 1i04006 1722 54484 30667 14421 5620 1771 446 E5 12 1D Figure 2: Number of transposition chords for the twelve-tone and quarter-tone temperament. This gives an idea of the combinatorial complexity generated by large values of n. The problem is crucial when we apply the same concept of group action in order to formalise rhythm, because we do not have to impose perceptual-motivated limitation to the length of a rhythmic structure. We will show in the section 5 how the analogy between pitch- and rhythmic domain leads at looking for specific algebraic strategies helping to reduce structurally the combinatorial explosion. 4. Pitch-class sets or the action of Dn on Zn After Alien Forte main theoretical book (Forte, 1973), many implementation of PitchClass Set Theory have been proposed (See, for example, Castine, 1994). In the case of the Dn library we adapted for OpenMusic a lisp

Page 00000004 implementation of P05-Theory done by Janusz Podrazik by adding some more gene ral algebraic tools. In analogy to the transposition case, we are interested in a general catalogue of Pitch-Class Sets for any given n-tempered division of the octave. For this reason we use the concept of action of the dihedral group on Z/nZ considered as a set. This action determines equivalence classes of chords with respect to transposition and inversion. In the case of n=12, this reduces the previous catalogue of transposition classes in the 224 orbits traditionally known as pitch-class sets. Figure 3 shows how the C-major chord is transformed in the c-minor chord by applying an inversion (with respect to C) and followed by a transposition (of a fifth). ( l~ 12: ir /p chourd 3:acodudr 1h cino n Note that the group is not commutative, i.e. the change of order of the operations gives a different result (in fact a b = b a' where a' is the inverse of a). With the function Dn-card we can calculate for given n and k the number of 'generalised' pitch-class sets of cardinality k. The following patch (Figure 4) shows the new situation for the twelve-tone and for the quartertone system. 90 9~ 12', 1,, 1)", 1~ 41 '?40 19 4 4, Figure 4: Number of orbits under the action of Dn for the twelve-tone and quarter-tone temperament. Note the invariance property of the Dn-card function between orbits with k and n-k elements which suggest to restrict the classification to orbits having card inality k less or equal to n/2 without loss of generality. To come back to the classical PCS-Theory, we now shortly describe some basic functions of the Dn library. We will discuss in more details a concept that has been independently formalised by some American theorists and some European composers. It will be particularly useful to follow the metamo rph osis of all these pitchconstructions in the rhythmic domain. One of the most important concepts in PCSTheory is the concept of prime form that provides a particular order in the family of possible orbits. This order is obtained by choosing between all possible cyclic permutations of the pc-set (in integral mode) that one which minimalise the distance between the first and the last pitch classes (normal order) eventually followed by inversions. A final transposition would transform, if necessary, the first pc number to 0. This is Forte's prime form The following Open~lusic patch shows a random generated hexachord will reduce progressively to its prime form (Figure 5). 1 Note that several different algorithms for normal form and prime form have been proposed. For example see Rahn (1980) or Morris (1987) for two slightly different strategies.

Page 00000005 rand om -o rad hexachor The generic-function pcset (figure 6) takes a --l ------------------ ---------------- ý_ - --------------- pitch-class set coded in Forte's catalogue as two numerals separated by a dash (the number of elements of the set and its position in the list of prime- forms respectively) and transforms it into one of the three possible presentation (of types): The integer mode (the ordered collection of integers from 0 to 11) The vector mode (an ordered array counting the number of occurrences of intervals from is an original concept introduced by Anatol Vieru in the Fifties (See the catalogue of modes in Vieru, 1980). In this representation, not to be confused with the interval vector, a pc-set is represented by a series of intervals that always add up to 12. This number can be easily generalised thanks to the Zn-function n-structure which takes a generic integer n as an argument (Figure 6). (Figure 6).. I............... vs ~'*-' i H + ^iiiii:ii not di etermine n pc-set I pc-set pc-set iieir (3 3 3 3 2 1. ) c ci d#i e f.g) |ii|||||il 1 -- iiiii 5 L c2chord w c s ri Figure 6: The functions pc-set and n structure. It is well known that the interval vector does not determine uniquely a pc-set. In fact, there exist pc-sets that have the same interval vector without being related by transposition and/or inversions. They are the so-called Z-related sets. An example of a pc-set which is Z-related with the pc-set 6-z10 considered in figure 6 is shown in the Figure 7: pc-set xlI t o ntate noav the c leentar 1664\4411111 pc-set pc-set t||| t..... n-s ttr uc- t uru-e t p (( 1121k 4' )i Figure 7: a Z-related pc-set A set-theoretic operation in which we would like to concentrate now is the complementary relation. By definition, two sets are complementary when they form a disjoint union of the chromatic total. Because of the prime form concept, complementary relation may give rise to logical contradictions. Consider the following example (figure 8) taken by Forte's analysis of....................................................................................................................................

Page 00000006 The Rite of Spring of I. Stravinsky (Forte, 1978).2 The pc-set A is included in the pc-set B, for each element of A belongs to B. The complement of A is given by C which can be transformed into B by using only transpositions and inversions. Therefore, A is contained in its complement, which is at least a problematic conclusion! _ A C B I0e 5 6,.8 9) I 1(S 3 4 5 6 8 9) |||||||||||| Pm12p 12 {,p,, * i tr nIIo 12 12 Figure 8: A pc-set included in its complement. Before interpreting the different orbits catalogues in the rhythmic domain, we would like to compare the two previous paradigms (cyclic and dihedral) by considering a more general action on the set of pitch-integers. This action is provided by the so-called affine transformations that we introduced in section 2.4. In the following examples, we show how the different actions modify the nature of a given chord. The first example shows the action of Z/nZ on a C-major chord. This chord is simply transformed into another major chord: The last example shows how the chord is transformed by means of an affine map. si dodo lar - re Aff sol# J mi so fa f d o la#.// sol"0 " (047) ~2 5 = r(811) @12 0=(081) One may ask for musically-motivated reasons for including affine orbits in a catalogue of musical structures. This concept, which seems to be problematic in the pitch domain, appears as extremely natural in the rhythmic domain. Augmentations, which are classical tools in the construction of musical canons, are, mathematically speaking, affine transformations. We will now discuss some of these properties in the rhythmic domain. 5. The rhythmic analogy: the case of "tiling canons" The algebraic model of rhythm, as it has been proposed by Dan Tudor Vuza, is strictly related to the Zn paradigm (Vuza, 1988). In this general framework, rhythms are translation classes of chords under the action of the additive group Q of rational numbers. We already discussed some new results that were obtained by the implementation of this model in OpenMusic (Andreatta et al., 1999). This section aims at generalising some questions concerning rhythmic tiling canons inside of the Dn paradigm. By definition, a rhythmic canon is given by a rhythmic pattern which is translate in the time axis a given number of times (which is equal of the number of voices). The rhythmic pattern is represented as an intervallic structure where 1 is the temporal distance between two successive possible onset-times. Figure 9 shows a particular rhythmic canon in 4 voices obtained by the time translation of the pattern R=(2 8 2) according with the interval content of the pattern S=(5 1 5 1) which corresponds to the onset-time 0, 5,6, 11. (047) 123 = (3710S In the case of the Dn-action, chords can be transposed and/or inverted. In this special case, the C major chord has been transformed into the G# minor chord. Therefore, major and minor chords are equivalent in this paradigm: (04-7) (12 11 = (085 ) 3 = (3 11 8) 2 This example is also discussed in (1987). Chemillier

Page 00000007 HIM 2 51 theoretical literature as inversional combinatorial hexachord. This means that its complement cannot be obtained by simple transposition, as it is clear from Figure 11. An inversion is necessary, so that we are naturally inside of the Dn paradigm. Figure 9: a tiling rhythmic canon. Note that the canon tiles completely the time axis by producing a regular pulsation (when all voices play) in which no holes occur and no voices overlap. A rhythmic canon of this type is called a regular complementary canon. Algebraically, the problem of construction of a regular complementary canon is equivalent to the factorisation of a cyclic group Z/nZ in a direct sum of two subsets, as it is shown by the Figure 10. Figure 10: factorisation of Z12Z in two subsets. This problem becomes very difficult once a particular condition is imposed on the structure of the two subsets. For example, by avoiding Messiaen's limited transposition property in both subsets, one may show that no canon of this type exists for n less than 72 (Andreatta et al. 1999). The following example enables to understand why we payed so much attention to the concept of group action and to the possibility to switch from the Zn to the Dn paradigm. We take a hexachord which is known in the music--- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -..... hexachord. In the rhythmic interpretation, as shown in Figure 12, it leads to the construction of rhythmic canons in which different voices could be translation or inversions of a given rhythmic pattern. The property of tiling completely the time axis, without intersection nor holes between the voices enables to speak of regular complementary canons by inversion. S::: Figure 12. The rhythmic realisation of an inversional combinatorial hexachord. 5. Conclusion Algebraic methods provide an elegant way to formalise musical structures, as well in the pitch as in the rhythmic domain. It enables a better structural understanding of well know musical systems, like Pitch-Class Set Theory, by describing it as a special case of a more general classification process. The rhythmic interpretation of pitch orbits under some classical actions confirms the usefulness of looking for general properties in n-tempered systems. The implementation of all these theoretical concepts, as we have done in OpenMusic, offers a very user-friendly approach to theoretical questions that may be applied in music analysis or may eventually lead to interesting compositional processes. One example is given by the construction of what we called "tiling rhythmic canons". Their

Page 00000008 implementation represents a long-time project motivated by the same group-action paradigm. Canons obtained by transposition or inversions are but special cases of a more general transformation process that can be described by means a new group: the affine group. This leads to the concept of "generalised augmentation" i.e. the action of the affine group Affn on Z/nZ and opens the problem of implementation and classification of what we call " augmented tiling canons"(Andreatta et al., 2001). Acknowledgments We would like to express our thanks to Janusz Podrazik for his lisp implementation of Forte's POS theory. References Andreatta, M., C. Agon and M. Chemillier 1999. "OpenMusic et le probl~me de Ia construction de canons musicaux rhythmiques." Actes des sixi~mes Journ~es d'lnformatique M~usicale, pp. 179-185. Andreatta, M., T. Noll, C. Agon and G. Assayag 2001. The geometrical groove: rhythmic canons between theory, implementation and musical experiments. Actes JIM, Bourges, pp. 93-98. Assayag G., C. Rueda, M. Laurson, A. Agon, 0. Delerue. 1999: "Computer Assisted Composition at Ircam: PatchWork & OpenMusic". Computer M~usic Journal 23(3). Castine, P. 1994. Set Theory Objects. Frankfurt: Lang Press. Chemillier, M. 1997. "Mono'ide libre et musique premi~re partie: les musiciens ont-ils besoin des math~matiques?" Inform atique th~orique et Applications, 21(3), 341-371. Forte, A. 1973. The Structure of Atonal M~usic. New Heaven: Yale University Press. Forte, A. 1978. The Harmonic Organization of The Rite of Spring. New Haven and London: Yale University Press. Lewin, D. 1987. Generalized M~usical Intervals and Transformations. New Heaven: Yale University Press. Mazzola, G. The Topos of Music, Birkh~user Verlag, 2002. Morris, R. 1987. Composition with Pitch-Classes. New Heaven and London: Yale University Press. Poincar~, H. 1952. (Orig. French Edition, 1903). Science and Hypothesis. Dover. Rahn, J. Basic Atonal Theory. New York: Schirmer Books. Vieru, A. 1993. The book of modes. Bucharest: Editura Muzicala. Vuza, D. T. 1988. "Some mathematical aspects of David Lewin's Book Generalized Mlusical Intervals and Transformations", Perspectives of New M~usic, 26(1), 258-287. Xenakis, 1.1965 "La voie de Ia recherche et de Ia question", Preuves, 177.