Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | W. Bas de Haas <bash@cs.uu.nl> |
Safe Haskell | Safe-Inferred |
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)
- data BillboardData = BillboardData {}
- data Meta
- data BBChord = BBChord {
- annotations :: [Annotation]
- weight :: BeatWeight
- chord :: Chord Root
- type Artist = String
- type Title = String
- noneBBChord :: BBChord
- getBBChords :: BillboardData -> [BBChord]
- getBBChordsNoSilence :: BillboardData -> [BBChord]
- addStart :: Label -> BBChord -> BBChord
- addEnd :: Label -> BBChord -> BBChord
- addLabel :: Label -> [BBChord] -> [BBChord]
- addStartEnd :: Label -> BBChord -> BBChord
- getDuration :: BBChord -> Int
- getStructAnn :: BBChord -> [Annotation]
- setChordIxsT :: [TimedData BBChord] -> [TimedData BBChord]
- isStructSegStart :: BBChord -> Bool
- isNoneBBChord :: BBChord -> Bool
- isChange :: BBChord -> Bool
- hasAnnotations :: BBChord -> Bool
- isEnd :: BBChord -> Bool
- reduceBBChords :: [BBChord] -> [BBChord]
- expandBBChords :: [BBChord] -> [BBChord]
- reduceTimedBBChords :: [TimedData BBChord] -> [TimedData BBChord]
- expandTimedBBChords :: [TimedData BBChord] -> [TimedData BBChord]
- showInMIREXFormat :: ([TimedData BBChord] -> [TimedData BBChord]) -> BillboardData -> String
- showFullChord :: ([TimedData BBChord] -> [TimedData BBChord]) -> BillboardData -> String
The BillBoard data representation
data BillboardData Source
The BillboardData
datatype stores all information that has been extracted
from a Billboard chord annotation
Represents other metadata of the piece, i.e. the time signature and key root
We wrap the Chord
datatype into a BBChord
type,
so that we can augment it with Annotation
s and BeatWeight
s.
BBChord | |
|
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
addLabel :: Label -> [BBChord] -> [BBChord]Source
Annotates a sequence of BBChord
s 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 BBChord
s. 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 Annotation
s,
given a BBChord
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 Annotations
s and False otherwise
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
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.
expandTimedBBChords :: [TimedData BBChord] -> [TimedData BBChord]Source
Similar to expandBBChords
the inverse of reduceTimedBBChords
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