22
Towards a Computational Model of Melody Identification in Polyphonic Music Sren Tjagvad Madsen 1 , Gerhard Widmer 2 Austrian Research Institute for Artificial Intelligence, Vienna 1 ,Department of Computational Perception Johannes Kepler University, Linz 2 IJCAI (International Joint Conference on Artificial Intelligence) Ronildo Oliveira da Silva 9 de janeiro de 2017

Towards a Computational Model of Melody Identification in Polyphonic Music

Embed Size (px)

Citation preview

Towards a Computational Model of MelodyIdentification in Polyphonic Music

Søren Tjagvad Madsen1, Gerhard Widmer2

Austrian Research Institute for Artificial Intelligence, Vienna1,Department ofComputational Perception Johannes Kepler University, Linz2

IJCAI (International Joint Conference on Artificial Intelligence)Ronildo Oliveira da Silva

9 de janeiro de 2017

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Contents

1 Introduction

2 Complexity and Melody Perception

3 A Computational Model

4 Experiments

5 Discussion

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 2 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Introduction

1 Melody is a central dimension in almost all music.2 It is not easy define the concept of ‘melody’.3 In a way, which notes constitute the melody is defined by wherethe listeners perceive the most interesting things to be going onin the music.

4 This paper presents first steps towards a simple, robustcomputational model of automatic melody note identification.Based on results from musicology and music psychology.

5 We will introduce a simple, straightforward measure of melodiccomplexity based on entropy, present an algorithm for predictingthe most likely melody note at any point in a piece.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 3 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Complexity and Melody Perception

The basic motivation for our model of melody identification is theobservation, that there seems to be a connection between thecomplexity of a musical line, and the amount of attention that willbe devoted to it on the part of a listener.Show that the complexity or information content of a sequence of notesmay be directly related to the degree to which the note sequence isperceived as being part of the melody.

measure of complexity based only on note-level entropies;measures based on pattern compression and top-down heuristicsderived from music theory.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 4 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

A Computational Model

The basic idea of the model consists in calculating a series ofcomplexity values locally. Based on these series of local complexityestimates, the melody is then reconstructed note by note by asimple algorithm. The information measures will be calculated from thestructural core of music alone: a digital representation of the printedmusic score like a MIDI (Musical Instrument Digital Interface).

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 5 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Sliding Window

The algorithm operates by in turn examining a small subset of the notesin the score. A fixed length window is slid from left to right over thescore.

1 offset of first ending note in current window2 onset of next note after current window

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 6 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Sliding Window

From the notes belonging to the same voice (instrument) in the window,we calculate a complexity value. We do that for each voice present in thewindow.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 7 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Entropy Measures in Musical Dimensions

Shannon’s entropy [Shannon, 1948] is a measure of randomness oruncertainty in a signal. If the predictability is high, the entropy is low,and vice versa.

uniformity, low predictionno uniformity, high prediction

Let X = {x1, x2, ..., xn}

p(x) = Pr(X = x)

X could for example be the set of MIDI pitch numbers and p(x) wouldthen be the probability (estimated by the frequency) of a certain pitch.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 8 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Entropy Measures in Musical Dimensions

Let X = {x1, x2, ..., xn} and p(x) = Pr(X = x) then the entropy H(x) isdefined as:

H(X ) = −∑x∈X

p(x)log2p(x)

p(x) would then be the probability (estimated by the frequency) of acertain pitch.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 9 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Entropy Measures in Musical Dimensions

We are going to calculate entropy of ’features‘ extracted from the notesin monophonic lines. We will use features related to pitch and durationof the notes.

1 Pitch class (C): count the occurrences of different pitch classespresent (the term pitch class is used to refer the ‘name’ of a note);

2 MIDI Interval (I): count the occurrences of each melodic intervalpresent (e.g., minor second up, major third down, . . . );

3 Note duration (D): count the number of note duration classespresent, where note classes are derived by discretisation (a durationis given its own class if it is not within 10% of an existing class).

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 10 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Entropy Measures in Musical Dimensions

With each measure we extract events from a given sequence of notes, andcalculate entropy from the frequencies of these events (HC , HI ,HD ).So far rhythm and pitch are treated separately. We have also included ameasure HCID weighting the above three measures:

HCID = 14 (HC + HI) + 1

2HD .

Entropy is also defined for a pair of random variables with jointdistribution:

H(X ,Y ) = −∑x∈X

∑y∈Y

p(x , y)log2[p(x , y)]

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 11 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

An Alternative: Complexity via Compression

The entropy function is a purely statistical measure related to thefrequency of events. No relationships between events is measured – e.g.the events abcabcabc and abcbcacab will result in the same entropyvalue.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 12 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Predicting Melody Notes

The prediction period. The prediction period pi is thus the intervalbetween the beginning of window wi and the beginning of wi+1.The average complexity value for each voice present in thewindows in o(pi) is calculated.Rank the voices according to their average complexity over o(pi).Every note in wi gets its melody attribute set to true if it is part ofthe winning voice, and to false otherwise.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 13 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Predicting Melody Notes

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 14 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusThe Musical Test Corpus

1 Haydn, F.J.: String quartet No 58 op. 54, No. 2, in C major, 1stmovement

2 Mozart, W.A.: Symphony No 40 in G minor (KV 550), 1stmovement

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 15 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusAnnotating Melody Notes

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 16 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusEvaluation Method

We can now measure how well the predicted notes correspond to theannotated melody in the score. We express this in terms of recall (R) andprecision (P) values.

Recall is the number of correctly predicted notes (true positives,TP) divided by the total number of notes in the melody.Precision is TP divided by the total number of notes predicted(TP + FP (false positives)).

F (R,P) = 1− 2RPR + P

A high rate of correctly predicted notes will result in high values of recall,precision and F −measure (close to 1.0).

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 17 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusResults

We performed prediction experiments with four different window sizes(1-4 seconds) and with the six different entropy measures.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 18 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusResults

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 19 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

The Musical Test CorpusResults

We can conclude that there is indeed a correlation between melody andcomplexity in both pieces. The precision value of 0.60 in the bestsymphony experiment with a resulting F- measure of 0.51 (window size 3seconds) tells us that 60% of the predicted notes in the symphony aretruly melody notes.In the string quartet, the second violin is alternating between a singlenote and notes from a descending scale, making the voice very attractive(lots of different notes and intervals) while the ‘real melody’

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 20 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Discussion

In our opinion, the current results, though based on a rather limited testcorpus, indicate that it makes sense to consider musical complexity as animportant factor in computational models of melody perception.(MADSEN, 2015)

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 21 / 22

Introduction Complexity and Melody Perception A Computational Model Experiments Discussion

Referêcias I

MADSEN, G. W. S. T. Towards a Computational Model of MelodyIdentification in Polyphonic Music. 1st. ed. [S.l.]: IJCAI, 2015.

Soøren Gerhard Towards a Computational Model of Melody Identification in Polyphonic Music 22 / 22