Module

Data.Abc.Repeats.Variant

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

Variant Repeats

support for the ABC volta construction: ..|1 ..... :|2 ...:|3 ....
or ..|1,2,3.. :|4.... | etc

#activeVariants Source

activeVariants :: Section -> Array (Tuple Int BarNo)

the active variants returned as an array of tuples (variant no - bar no)

#secondVariantPosition Source

secondVariantPosition :: Section -> Maybe BarNo

the bar number of the second variant

#addVariants Source

addVariants :: List Int -> BarNo -> Section -> Section

add the list of variants having this bar number position to the existing variants

#findEndingPosition Source

findEndingPosition :: VariantPositions -> Int -> BarNo -> BarNo

When supplied with: the variant positions (map of index to BarNo) the index of the current variant the BarNo of the end of the entire section then find the BarNo of the end of the variant (This can either be the start of the next variant or the section end)

#normaliseVoltas Source

normaliseVoltas :: NonEmptyList Volta -> List Int

Normalise a list of Voltas to a simple list of volta repeat numbers

#variantPositionOf Source

variantPositionOf :: Int -> Section -> Maybe BarNo

the variant bar number of the specified variant number

#variantIndexMax Source

variantIndexMax :: Section -> Int

the maximum index we can use of the active variants

#variantCount Source

variantCount :: Section -> Int

the number of variants in the ending