HarmTrace-Base- Parsing and unambiguously representing musical chords.

Maintainerbas@chordify.net, dreixel@chordify.net
Safe HaskellNone




Summary: Some general parsing utilities used for parsing textual chord representations.


Top level parser

parseChordSeq :: String -> (PieceLabel, [Error LineColPos])Source

Top level parser that parsers a string into a PieceLabel and a posibly empty list of errors

Parsing (elements of) chords

pChord :: Parser ChordLabelSource

Parses a ChordLabel in Harte et al. syntax including possible additions, and removal of chord additions. If a chord has no Shorthand, the Degree list (if any) is analysed and depending on the Triad (if any) a Maj, Min,Aug, or Dim Shorthand is stored. By default all the duration stored in every Chord is 1 (where the unit is application dependend, often these are beats, but they can also be eightnotes)

pShorthand :: Parser ShorthandSource

Parses a shorthand following Harte et al. syntax, but also the shorthands added to the Billboard dataset, e.g. maj, min, or 9.

pSongAbs :: Parser PieceLabelSource

Parser that parses a string of whitespace-separated Chords, e.g. C:maj Bb:9(s11);1 E:min7;1 Eb:min7;1 Ab:7;1 D:min7;1 G:7(13);1 C:maj6(9);1 The first Chord must be the key of the piece, and the after each chord the semicolumn and an Integer representing the duration of the chord must be presented

pRoot :: Parser RootSource

Parses a Root Note, e.g. A, Bb, or F#.

pAdditions :: Parser [Addition]Source

Parses a list of Chord Additions within parenthesis

pAddition :: Parser AdditionSource

Parses the a Chord Addition (or the removal of a chord addition, prefixed by a *)

pKey :: Parser KeySource

parses a musical key description, e.g. C:maj, or D:min