Module

Data.Abc.Midi.RepeatSections

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

Handle any repeated sections when interpreting an ABC tune Repeats are optional and can take the form: |: ABC :| |: ABC :: DEF :| |: ABC |1 de :|2 fg | the very first repeat start marker is optional and often absent

#Section Source

newtype Section

a section of the tune (possibly repeated)

Constructors

Instances

#Sections Source

type Sections = List Section

a set of sections

#RepeatState Source

type RepeatState = { current :: Section, sections :: Sections }

the current repeat state

#initialRepeatState Source

initialRepeatState :: RepeatState

initial repeats i.e. no repeats yet

#indexBar Source

indexBar :: (Maybe Int) -> (Maybe Repeat) -> Int -> RepeatState -> RepeatState

index a bar by identifying any repeat markings and saving the marking against the bar number

#finalBar Source

finalBar :: (Maybe Int) -> (Maybe Repeat) -> Int -> RepeatState -> RepeatState

accumulate any residual current state from the final bar in the tune