billboard-parser-1.0.0.1: A parser for the Billboard chord dataset

Portabilitynon-portable
Stabilityexperimental
MaintainerW. Bas de Haas <bash@cs.uu.nl>
Safe HaskellSafe-Inferred

Billboard.BillboardData

Contents

Description

Summary: A set of datatypes for representing Billboard chord sequence data See: John Ashley Burgoyne, Jonathan Wild, Ichiro Fujinaga, An Expert Ground-Truth Set for Audio Chord Recognition and Music Analysis, In: Proceedings of International Conference on Music Information Retrieval, 2011. (http://ismir2011.ismir.net/papers/OS8-1.pdf)

Synopsis

The BillBoard data representation

data BillboardData Source

The BillboardData datatype stores all information that has been extracted from a Billboard chord annotation

Instances

data Meta Source

Represents other metadata of the piece, i.e. the time signature and key root

Constructors

Metre TimeSig 
KeyRoot Root 

Instances

data BBChord Source

We wrap the Chord datatype into a BBChord type, so that we can augment it with Annotations and BeatWeights.

Constructors

BBChord 

type Artist = StringSource

Represents the artists of the piece

type Title = StringSource

Represents the title of the piece

noneBBChord :: BBChordSource

A chord label with no root, shorthand or other information to represent a none harmonic sections

Billboard data utilities

Data access

getBBChords :: BillboardData -> [BBChord]Source

Strips the time stamps from BillBoardData and concatenates all BBChords

getBBChordsNoSilence :: BillboardData -> [BBChord]Source

Strips the time stamps from BillBoardData and concatenates all BBChords and removes the silence at the beginning and end of the song.

addStart :: Label -> BBChord -> BBChordSource

Adds a starting point of an Annotation Label to a BBChord

addEnd :: Label -> BBChord -> BBChordSource

Adds an end point of an Annotation Label to a BBChord

addLabel :: Label -> [BBChord] -> [BBChord]Source

Annotates a sequence of BBChords by adding a Start Label Annotation at the first chord and an End Label Annotation at the last chord. The remainder of the list remains untouched

addStartEnd :: Label -> BBChord -> BBChordSource

Adds both a start and an end Annotation Label to a BBChord

getDuration :: BBChord -> IntSource

Returns the duration of the chord (the unit of the duration can be application dependent, but will generally be measured in eighth notes) If the data comes directly from the parser the duration will be 1 for all BBChords. However, if it has been reduced with reduceBBChords the duration will be the number of consecutive tatum units.

getStructAnn :: BBChord -> [Annotation]Source

Returns the structural segmentation Annotations, given a BBChord

setChordIxsT :: [TimedData BBChord] -> [TimedData BBChord]Source

Sets the indexes of a list of TimedData BBChords (starting at 0)

Tests

isStructSegStart :: BBChord -> BoolSource

Returns True if the BBChord represents a starting point of a structural segment

isNoneBBChord :: BBChord -> BoolSource

Returns True if the BBChord is a noneBBChord, i.e. has not root note and no shorthand

isChange :: BBChord -> BoolSource

Returns True if the BBChord represents a chord Change (must be set beforehand, only the BeatWeight stored in the BBChord is examined)

hasAnnotations :: BBChord -> BoolSource

Returns True if the BBChord has any Annotationss and False otherwise

isEnd :: BBChord -> BoolSource

Returns True if this BBChord is the last (N) chord of the song

Chord reduction

reduceBBChords :: [BBChord] -> [BBChord]Source

The inverse function of expandChordDur: given a list of BBChords that all have a duration of 1 beat, all subsequent x BBChords with the same label are grouped into one BBChord with durations x. N.B.

>>> expandBBChords (reduceBBChords cs) = cs

also,

>>> (expandBBChords cs) = cs

and,

>>> reduceBBChords (reduceBBChords cs) = (reduceBBChords cs)

hold. This has been tested on the first tranch of 649 Billboard songs

expandBBChords :: [BBChord] -> [BBChord]Source

Given a list of BBChords that have a certain duration (i.e. the number of beats that the chord should sound), every BBChord is replaced by x BBChords with the same properties, but whit a duration of 1 beat, where x is the duration of the original BBChord

reduceTimedBBChords :: [TimedData BBChord] -> [TimedData BBChord]Source

Returns the reduced chord sequences, where repeated chords are merged into one BBChord, similar to reduceBBChords, but then wrapped in a TimedData type.

Showing

showInMIREXFormat :: ([TimedData BBChord] -> [TimedData BBChord]) -> BillboardData -> StringSource

Shows the BillboardData in MIREX format, using only :maj, :min, :aug, :dim, sus2, sus4, and ignoring all chord additions

showFullChord :: ([TimedData BBChord] -> [TimedData BBChord]) -> BillboardData -> StringSource

Shows the chord sequence in the BillboardData