Module

Data.Abc.Metadata

Package
purescript-abc-parser
Repository
newlandsvalley/purescript-abc-parser

A Ragbag of convenience functions for getting Metadata from ABC headers

#HeaderMap Source

type HeaderMap = Map Char Header

A representation of the ABC headers as a Map, taking the first definition of any header if multiple definitions are present in the ABC.

#getKeySet Source

getKeySet :: AbcTune -> KeySet

Get the set of key accidentals from the (possibly modified) key (if there is one in the tune).

#getHeader Source

getHeader :: Char -> AbcTune -> Maybe Header

Get the header from the header code

#getKeySig Source

getKeySig :: AbcTune -> Maybe ModifiedKeySignature

Get the key signature (if any) from the tune.

#getMeter Source

getMeter :: AbcTune -> Maybe MeterSignature

Get the meter

#getTempoSig Source

#getTitle Source

getTitle :: AbcTune -> Maybe String

Get the first Title (if any) from the tune.

#getUnitNoteLength Source

getUnitNoteLength :: AbcTune -> Maybe NoteDuration

Get the unit note length

#dotFactor Source

dotFactor :: Int -> Rational

The amount by which you increase or decrease the duration of a (possibly multiply) dotted note. For example A > B increases the duration of A and proportionally reduces that of B. A << B decreases the duration of A and increases that of B by an even greater amount. This function calculates the increase or decrease. The new duration will be given by:

duration * (1 +/- dotfactor i)

i is the number of 'dot' indicators (< or >)

#normaliseChord Source

normaliseChord :: AbcChord -> AbcChord

Normalise an ABC chord by placing the correct duration against each note and setting the overall Chord length to Unit

#isEmptyStave Source

isEmptyStave :: List Bar -> Boolean

check if a new stave's contents is effectively empty (the list of bars is introduced by the Score BodyPart)

#thumbnail Source

thumbnail :: AbcTune -> AbcTune

reduce an ABC tune to a 'thumbnail' of the first two full bars

#removeRepeatMarkers Source

removeRepeatMarkers :: AbcTune -> AbcTune

remove repeat markers (used for thumbnails where we need to ignore them)