Module

Data.Abc.Utils

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

A Ragbag of convenience functions, many of which get Metadata from ABC

#getTitle Source

getTitle :: AbcTune -> Maybe String

Get the first Title (if any) from the tune. For more flexibility, you should use the _Title optic.

#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

#chordDuration Source

chordDuration :: AbcChord -> NoteDuration

Get the duration of a chord. We consider notes in a chord to have the same duration (as the first such note) and must also cater for the overall chord duration.

#tupletDuration Source

tupletDuration :: AbcTuplet -> NoteDuration

Get the overall duration of a tuplet

#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)