Page  340 ï~~SYSTHEMA - Analysis and Automatic Synthesis of Classical Themes Dominik Hornel Institut ftr Betriebs- und Dialogsysteme, Prof. Dr.-Ing. Werner Zorn Fakultl't fir Informatik, Universitlt Karlsruhe Email: Abstract SYSTHEMA is a system to analyze and automatically generate classical music themes. A theme to be analyzed is first reduced to its components (parameters) which are based on structures motivated by musical perception. These parameters have to be entirely described by natural language rules. General rules (i.e. rules of a more general validity) and theme specific rules that must be valid for one given theme only, are distinguished. The implementation of these rules enables the system to automatically generate new themes by omitting some of the specific rules. In this way SYSTHEMA offers a concrete facility to reconsider the developed descriptions of musical structures and to provide information about the effect musical parameters have and how they interact. 1. Structure and Function of SYSTHEMA This article is about classical themes. A theme is a musical construct, 8-16 measures long, which in general can easily be identified and demarcated. It consists of a melody voice (usually the treble voice) and a simple accompaniment. There is an important difference to the notion of melody that does not include the accompaniment which, however, shall be considered explicitly in the following. The term classical refers to the classical period (esp. works of the classical Viennese School) in which the technique of composing themes we are considering had been elaborated. In the following the theme from the first movement of W.A. Mozart's sonata KV 331 in A major, measures 1-8, will serve us as a model theme. The "basic structure" of the theme is explicitly given by so-called theme and rhythm 'ees. All other parameters (e.g. harmony sequence, motif sequence) are described by rules unambiguously. The theme is composed of a succession of smallest "semantic units", the motifs, which again are based on a small subset, the so-called kernel moifs. The form of the theme is determined by the arrangement of these kernel motifs into a motif seauence, the harmony is represented as an arrangement of harmonic Riemann functions, the harmony seue n. The slightly modified kernel motifs result in so-called melody motifs the structure of which is fixed except for pitch transposition. The latter is done by linking together all melody motifs to obtain the final form of the melody voice. Afterwards an appropriate accompaniment based on the harmony sequence is added. Finally the remaining parametrs (tempo, dynamics and tone colour) are defined. Figure 1 shows this "compositional process" (centre) with the corresponding structures of the model theme (margins). 2. The Representation of Musical Structures Our general approach will be to find appropriate representations of musical structures by gradual abstraction. The hierarchical form of classical themes is characterized by static "periodic", i.e. repeating elements (P: left subtree = right subtree) and dynamic elements (S: left subtree = P) which may occur at any level of the hierarchy and can be represented as attributes of a binary tree (see figure 1). It serves as a model to describe the "resting" and "progressing" formal properties of a theme. Humans recognize and remember musical structures by comparative listening. For instance, pitches are recognized by forming intervals to already heard notes (relative pitch). Unpractised listeners also seem to recognize harmonic relationships more easily than single harmonies (see [Bruhn87]). They are heard as processes of tension and relaxation. Turning away from the (current) tonal centre (tonic 1T) means tension, returning means relaxation. Shifting is a harmonic transition without a change of tension. Following a theory of E. Ansermet (see [Ansermet65]), we have developed a method to represent harmonies by their distance to the tonal centre (measured in ascending/descending fifths/fourths), thus describing processes of tension/relaxation. Figure 1 shows a circle diagram that illustrates distances between harmonic functions (primary functions, secondary functions and secondary dominants). Turn (+), Return (-) and Shift (=) may be regarded at different levels as harmony attributes of a binary tree as well (figure 1). The theme tree combines the formal and harmonic developments of a theme. The (kernel) motifs consist of a rhythm pattern and a "melody line". The rhythm in classical themes must satisfy the global metre of the piece. Because of different stresses in a measure rhythm patterns can be (recursively) divi 2P.01 340 ICMC Proceedings 1993

Page  341 ï~~I I 1 _ 4,1 I.p t.p I 0 O U a a i i DTI I AN "MIt - r1 I. I I --. - 1 I -., *ll 1,IT11 t Figure 1 Structure and Function of SYSTHEMA ICMC Proceedings 1993342PO 341 2P.01

Page  342 ï~~ded into subgroups. If we divide patterns into two groups, we may distinguish groupings with a shorter rhythm value in the left/right subgroup (iambic/trochaic rhythms, abbr. i/t) and groupings with the same duration in each subgroup (spondaic rhythms, short s). Figure 1 shows two simple rhythm trees gained from this rhythm classification. The "melody line" of a motif must fulfil several conditions, esp. matching the given harmony. Hence a so-called "harmonic" motif description has been chosen. It distinguishes motif notes that belong or do not belong to a given harmony (harmonizing/non-harmonizing notes). Non-harmonizing notes have to be resolved stepwise or chromatically into subsequent harmonizing notes. The distance between harmonizing notes is measured by the number of degrees between them that belong to the given harmony (see kernel motifs in figure 1). 3. The Automatic Synthesis of New Themes With the help of the structure descriptions above, we now can formulate in a simple manner rules for all parameters that describe a theme unambiguously and in a "musically sensible" way. Figure 2 shows a small excerpt from the rule description of the harmony sequence of the Mozart theme. The characterization of certain rules as general rules (G rules, e.g. HGR1) enables us to assign a larger degree of generality to certain properties of a parameter, e.g. if those properties are fulfilled for a set of themes. These rules are kept during the generation of new themes by SYSTHEMA, whereas all other theme specific rules (here: M[ozart] rules, e.g. HMR4) may be "cancelled" by the user (generalization). SYSTHEMA then selects from a given solution space new random values for the corresponding parameters. An omission of rule HMR4 for example allows the occurrence of new harmonic functions for the harmony sequence such as secondary functions and secondary dominants. From the quality of themes generated by this reduction of the rule set, new conclusions can be drawn about the quality of the description itself. Figure 3 shows a new theme with a more complex harmonization recovered from a generalization of the Mozart theme. HGRi: (Adeption rule for hermong sequence) The hermony sequence is edepted to the theme tree. HGR2: (Initial hermong rule) The beginning of the theme is hermonized with tonic. HGR3: (Finel harmony rule) The end of the theme is hermonized with tonic or dominent. HIIR4: Only primary functions or the tonic perellel occur in the harmony sequence. Figure 2 Excerpt from the rule set Figure 3 A new theme generated from the Mozart of the harmony sequence theme by SYSTHEMA 4. Conclusion With SYSTHEMA a system has been realized able to review the analysis by generating new "generalized" themes. The resulting themes make sense from a musical point of view because they are based upon abstracted structures motivated by musical perception. The description often required special care, though, esp. the description of the chord accompaniment (voice-leading rules). In general, we would like to have a situation allowing the parameters to be more independent from each other and regarding relationships among them more as interdependencies than as one-sided dependencies, thus approaching the real integrative compositional process. Our current work therefore concentrates on a stronger integration of the parameters. We investigate how particu. lar (sub)structures (such as trees), instead of being explicitly given or being dictated by rules, might be "learned" from examples, e.g. by neural networks. 5. References [Ansermet65] Ansermet, Ernest: Die Grundlagen der Musik im menschlichen Bewuftsein. Piper Verlag, 1965 [Bruhn87] Bruhn, Herbert: Harmonielehre als Grammatik der Musik. Dissertation, Universitlit Mtinchen, 1987 [FHrme192] H~rnel, Dominik: Analyse und automatische Erzeugung klassischer Themen. Diplomarbeit, Fakultait futr Informatik, Universitat Karlsruhe, 1992 2P.01 342 ICMC Proceedings 1993