UNSUPERVISED CHORD-SEQUENCE GENERATION FROM AN AUDIO EXAMPLE Katerina Kosta 1,2 , Marco Marchini 2 , Hendrik Purwins 2,3 1 Centre for Digital Music, Queen Mary, University of London, Mile End Road, London E1 4NS, UK 2 Music Technology Group, Universitat Pompeu Fabra, 08018 Barcelona, Spain 3 Neurotechnology Group, Berlin Institute of Technology, 10587 Berlin, Germany marco.marchini@upf.edu, katkost@gmail.com, hpurwins@gmail.com ABSTRACT A system is presented that generates a sound sequence from an original audio chord sequence, having the following characteristics: The generation can be arbitrarily long, pre- serves certain musical characteristics of the original and has a reasonable degree of interestingness. The proce- dure comprises the following steps: 1) chord segmentation by onset detection, 2) representation as Constant Q Pro- files, 3) multi-level clustering, 4) cluster level selection, 5) metrical analysis, 6) building of a suffix tree, 7) gen- eration heuristics. The system can be seen as a computa- tional model of the cognition of harmony consisting of an unsupervised formation of harmonic categories (via multi- level clustering) and a sequence learning module (via suf- fix trees) which in turn controls the harmonic categoriza- tion in a top-down manner (via a measure of regularity). In the final synthesis, the system recombines the audio ma- terial derived from the sample itself and it is able to learn various harmonic styles. The system is applied to various musical styles and is then evaluated subjectively by mu- sicians and non-musicians, showing that it is capable of producing sequences that maintain certain musical charac- teristics of the original. 1. INTRODUCTION To what extent can a mathematical structure tell an emo- tional story? Can a system based on a probabilistic con- cept serve the purpose of composition? Iannis Xenakis dis- cussed the role of causality in music in his book “Formal- ized Music, Thought and Mathematics in Composition”, where it is mentioned that a fertile transformation based on the emergence of statistical theories in physics played a crucial role in music construction and composition [20]. Statistical musical sequence generation dates back to Mozart’s “Musikalisches W¨ urfelspiel” (1787) [8], and more recently to “The Continuator” by F. Pachet [14], D. Con- klin’s work [3], the “Audio oracle” by S. Dubnov et al. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. c 2012 International Society for Music Information Retrieval. [6] and the “Rhythm Continuator” by M. Marchini and H. Purwins (2010) [13]. The latter system [13] learns the structure of an audio recording of a rhythmical percussion fragment in an unsupervised manner and synthesizes mu- sical variations from it. In the current paper this method is applied to chord sequences. It is related to work such as a harmonisation system described in [1] which, using Hidden Markov Models, it composes new harmonisations learned from a set of Bach chorals. The results help to understand harmony as an emergent cognitive process and our system can be seen as a music cognition model of harmony. Expectation plays an im- portant role in various aspects of music cognition” [18]. In particular, this holds true for harmony. 2. CHORD GROUPING Harmony is a unique feature distinguishing Western music from most other predominantly monophonic music tradi- tions. Different theories account for the phenomenon of harmony, mapping chords e.g. to three main harmonic functions, seven scale degrees, or even finer subdivisions of chord groups, such as separating triads from seventh or ninth chords. The aim of this paper is to suggest an unsu- pervised model that lets such harmonic categories emerge from samples of a particular music style and model their statistical dependencies. As Piston remarks in [15] (p. 31), “each scale degree has its part in the scheme of tonality, its tonal function”. Function theory by Riemann concerns the meanings of the chords which progressions link. The term “function” can be used in a stronger sense as well, for specifying a chord progression [10]. A problem arises from the fact that scale degrees cannot be mapped to the tonal functions in a unique way [4] [16] (p. 51-55). In our framework, the function of a chord emerges from its cluster and its statistical depen- dency on the other chord clusters. It is considered that the tonic (I), dominant (V) and subdominant (IV) triads constitute the tonal degrees since “they are the mainstay of the tonality” and that the last two give an impression of “balanced support of the tonic” [15]. This hierarchy of harmonic stability has been supported by psychological studies as well. One approach involves col- lecting ratings of how one chord follows from another. As it is mentioned in [11], Krumhansl, Bharucha, and Kessler 13th International Society for Music Information Retrieval Conference (ISMIR 2012) 481