Training Music Sequence Recognizers with Linear Dynamic Programming Christopher Raphael craphael@indiana.edu School of Informatics, Indiana University, Bloomington, IN 47408 USA Eric Nichols epnichol@indiana.edu Center for Research on Concepts and Cognition, Indiana University, Bloomington, IN 47408 USA Keywords: machine learning, dynamic programming, harmonic analysis, trellis graph Abstract An obvious approach to the problem of har- monic analysis is to represent a musical score as a trellis graph, where layers in the graph correspond to musical slices of time, and each node corresponds to the harmonic anal- ysis of the slice. If the transitions between nodes and the analyses at each node are as- signed a score, the analysis problem reduces to finding the best-scoring path through the graph, which can be computed with stan- dard dynamic programming (DP). But how can we set the parameters of the necessary score function? We demonstrate a novel algo- rithm, Linear Dynamic Programming (LDP), to solve the problem of learning the coe- cients for a linear score function, based on a hand-labeled harmonic analysis. 1. Introduction Many music recognition problems seek to explain some aspect of music data as a sequence of labels that col- lectively represent a time-varying analysis. Familiar examples of this view come from problems that deal with both symbolic music representations (e.g. MIDI) as well as audio. For instance, harmonic analysis of symbolic music data produces a label including chord, key, or other harmonic attributes, for each measure or beat of the piece under consideration (Temperley, 2001). Other examples of symbolic music sequence analysis include pitch spelling, instrument fingering, prosodic labeling of melody for musical expression, and decomposition of polyphonic music into voices. In the audio domain, the problem of beat tracking can be ex- pressed as a labeling of each audio frame as either a “beat” or “non-beat.” Similar views are often taken of other audio music processing examples such as the signal-to-score problem, computing harmony from au- dio, chorus detection, score alignment, etc. In fact, the sequence analysis view extends to other music data, such as optical music recognition. The sequence estimation problem can be solved by ex- pressing each possible label sequence as a path through a state graph. Arc costs in the graph correspond to a priori path plausibility, while data scores for nodes in the graph give the agreement between a label and an observation. Given this model, it is simple to com- pute the best-scoring path using DP. However, an oft- ignored problem faced in applying this methodology is the specification of arc and data scores — the training problem. Hand setting of parameters through trial and error is usually only feasible in small problems. Our research has produced a novel method for the su- pervised training of a DP-based sequence estimator we call Linear Dynamic Programming. The method as- sumes that the arc and data scores are known linear functions of some unknown parameter vector. In this context we seek the parameter value leading to the best performance on our labeled training set. An ex- ample is presented for harmonic analysis, though we believe the technique may be broadly applicable. 2. Application to Harmonic Analysis The problem of functional harmonic analysis seeks to partition a piece of music into labeled sections, the la- bels giving the local harmonic state. The label usually consists of a key and a chord symbol such as I, ii, iii, IV, V, vi, vii. For instance, the label (A major, IV) corresponds to the triad (D,F,A) built on the fourth scale degree in the key of A major. Several eorts have addressed this problem of automatic harmonic analy- sis, including (Pardo & Birmingham, 2002), (Raphael