Tree-structured representation of melodies for comparison and retrieval

The success of the Internet has filled the net with lots of symbolic representations of music works. Two kinds of problems arise to the user: the search for information from content and the identification of similar works. Both belong to the pattern recognition domain. In contrast to most of the existing approaches, we pose a non-linear representation of a melody, based on trees that express the metric and rhythm of music in a natural way. This representation provide a number of advantages: more musical significance, more compact representation and others. Here we have worked on the comparison of melodies and patterns, leading to motive extraction and its use for the identification of complete melodies. The success of the Internet has filled the net with lots of symbolic representations of music works. Two kinds of problems arise to the user: the search for information based on content and the identification of similar works. Both belong to the pattern recognition domain. The applications of variations on the two problems cope from the study and analysis tasks in musicology over musical works to the detection of plagiarism, useful to protect copyrights in the music record industry. Traditionally music has been represented by means of a set of tupla strings, where each tupla, in diverse ways, usually contains information on pitch, duration and onset time. Both the retrieval and the comparison have been tackled with structural pattern matching techniques in strings, from different points of view, either in the tupla content or in the algorithms [5] There are some other approaches, seldom applied, like the geometric one, which transforms the melody into a plot obtained tracing a line between the successive notes in the stave. This way, the melody comparison problem is converted into a geometric one [3]. In this paper, we use a nonlinear representation of melody: by means of trees that express the metric and rhythm of music in a natural way. The approach to tree construction is based on the fact that the different music notation figures are designed on a logarithmic scale: a whole note lasts twice a half note, whose length is the double of a quarter note, etc. This representation provides us with a richness of possibilities that the strings never will: more musical meaning and automatic emphasizing of relevant notes, for example. Moreover, the way in which a string representation is codified strongly conditions the outcome of the string processing algorithms [7], but with trees, this is achieved in a more and intuitive natural way. We have worked mainly in the comparison of patterns in melodies, which derives in the extraction of musical motives and its later use in the complete comparison for those melodies. The tree distance algorithm of Shasha and Zang [1] has been used. Although tree comparison algorithms have a higher complexity than the existing methods on strings, the results from the original representation (with no additional or special processing) significantly improve the ones in the same way using strings. This preliminary results open a promising new field for experimentation in a number of applications on the symbolic representation of music. In this article we will develop the tree construction, as much as a set of rules necessary to deal with the complexity above described and its later use in melody comparison by content. Firstly, the method for tree construction will be presented and how it deals with the notation problems that may appear. Secondly, a procedure for tree simplification is described. Then, the method for comparison and the results are presented, and finally conclusions are stated. 1 Tree Construction Method As described above, the tree construction is based on the logarithmic relation among duration of the different figures. A sub-tree is assigned to each measure, so the root of this sub-tree represents the length in time of all the measure. If just a whole note is found in the measure, the tree will consist of just the root, but if there were two half notes, this node would split into two children nodes. Thus, recursively, each node of the tree will split into two until representing the notes actually found in a measure (see Fig. 1).