|
|
|
|
Modeling Music in PRISM
Download: PDF IntroductionMusic composers are bound to certain - mostly unwritten - rules, defining the musical genre of their work. In the paper [7] we have constructed a general model that captures such musical rules.Many formalisms have been proposed to express strict, logical rules. However, most musical genres are hard or impossible to describe as a set of strict rules. It seems to be inherent to music to be somewhat `random' and `organic'. Because of this inherent randomness, we have represented musical rules as probabilistic experiments with some unknown probability distribution. We used a variant of Hidden Markov Models [1], for which the probability distributions can be computed in an automated way from a set of examples.
PRISM.Probabilistic-logical programming is an extension of logic programming which allows programmers to express both statistical and relational knowledge in a natural way. PRISM [4,5] is a probabilistic-logical programming language based on Prolog. We will use this formalism to implement a general model for polyphonic music. Its probability parameters are automatically learned by running the built-in EM-algorithm of PRISM on training examples.
Modeling of music.Traditionally, two types of models for music are distinguished. Synthetic models are used to generate music (automatic composition). Analytic models are designed to analyze (e.g. to classify) music. Conklin [2] pointed out that a general model can be applied to both tasks: a statistical analytic model can be sampled to generate music. In [7], we show how our model can be used as a classifier for music that guesses the composer of unknown fragments of music, while it can also be used to automatically compose new music.
ImplementationMusic Representation.For simplicity, we will consider only three aspects of music: melody (note pitch and octave), rhythm (note duration) and polyphony (different voices sounding together). To represent a music score in a form which is suitable for both Prolog-like environments and Markov-like models, we use a simple representation called Interwoven Voices List (IVL). This representation consists of a sequence (list) of phases, which are triples of durations (integer numbers) and two lists: the second list contains the note pitch (encoded as a number) for every voice, the first list indicates for every voice whether or not the note is new. The notes in Figure 1 are encoded as:[ (16,[new,new],[55,r]), (16,[old,new],[55,36]),
Modeling IVL-music in PRISM.We use a nested Hidden Markov Model, based on the intuition of global and local music structure. The global structure of a piece of music is captured by transitions between various Song States (SS). Within every such song state, there is one HMM for each voice, which captures the local structure for that particular voice by transitions between various Voice States (VS). This principle is illustrate in Figure 2. The implementation of a nested HMM in PRISM is discussed in detail in [7].
Experimental results
Pollastri and Simoncelli [3]
have used HMMs for classification of melodies by composer.
In a similar way, we have used our model to classify fragments
of polyphonic music.
To keep things simple, we have considered only two composers:
Bach and Mozart.
|
|
[Trained with fragments of Bach]
[Trained with fragments of Mozart]
|
We have presented a simple, yet general model for music. It can handle any number of voices. The probability parameters can automatically be adjusted for any musical genre given sufficiently many training examples of the genre. Our classification method seems to be a promising given the outcome of the experiments. Experiments on a larger scale, involving more composers and larger datasets, have to be performed to get an accurate idea of the scope of its practical applicability. The main contribution of [7] lies in demonstrating the feasibility of using probabilistic-logical programming as an elegant tool for developing applications in the computer music domain.