HarmTrace-2.2.0: Harmony Analysis and Retrieval of Music

Portabilitynon-portable
Stabilityexperimental
Maintainerbash@cs.uu.nl, jpm@cs.ox.ac.uk
Safe HaskellNone

HarmTrace.Audio.Evaluation

Contents

Description

Summary: A module for evaluating chord and key annotations

Synopsis

Evaluation functions

relCorrectOverlap :: (a -> a -> Bool) -> [TimedData a] -> [TimedData a] -> DoubleSource

Calculates the relative correct overlap, which is the recall of matching frames, and defined as the nr of matching frames (sampled at an 10 milisecond interval) divided by all frames.

achievScore :: [TimedData ChordLabel] -> [TimedData [ChordLabel]] -> DoubleSource

calculates the maximal achievable score given a ground truth annotation and a chord candidate list.

avgDistToOne :: [Double] -> DoubleSource

The chordChangeRatio is optimal if it is one, but it can be larger or smaller than 1. Therefore, calculating the average blurs the actual result. avgDistToOne takes the absolute difference to 1.0 and averages these for a list of Doubles.

Chord and key equality functions

chordTriadEq :: ChordLabel -> ChordLabel -> BoolSource

Returns True if both ChordLabels are equal at the triad level: they are either moth major or both minor. None Chords match only with other None Chords and with nothing else

chordClassEq :: ChordLabel -> ChordLabel -> BoolSource

Returns True if both ChordLabels are equal at the chord class level: A chord is classified as being major, minor, dominant seventh, or dimished seventh. chordClassEq only returns True if the class of compared chords is the same. None Chords match only with other None Chords and with nothing else

majMinEq :: ChordLabel -> ChordLabel -> BoolSource

Returns True if the Roots of the Chords are equal, but the one chord is Major and the other chord is Minor.

Displaying evaluations

printChordRCO :: (AudioFeat -> ChordAnnotation) -> [TimedData Key] -> AudioFeat -> [TimedData ChordLabel] -> IO DoubleSource

does the same thing as relCorrectOverlap, but it also prints the chords and uses a lower sample rate. N.B. the number output by printRelCorrectOverlap might differ from the output of relCorrectOverlap, because a different sample rate might be used (see Constants).

printRCO :: (a -> a -> IO Bool) -> [TimedData a] -> [TimedData a] -> IO DoubleSource

Calculates the relative correct overlap, which is the recall of matching frames, and defined as the nr of matching frames (sampled at an interval set in Constants divided by all frames. This functions difers from relCorrectOverlap in that it uses an equality function that is in IO.

Sampling

sample :: [TimedData a] -> [a]Source

Given a chord annotation sample the chord label at every 10 ms