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 :|'
  • '|: ABC :: DEF :|'
  • '|: ABC |1 de :|2 fg |'
  • '|: ABC |1,3 def :|2,4 efg |'

the very first repeat start marker is optional and often absent

#initialRepeatState Source

initialRepeatState :: RepeatState

initial repeats i.e. no repeats yet. intro is not used in MIDI production

#indexBar Source

indexBar :: forall melody. IndexedBar melody -> RepeatState -> RepeatState

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

#finalBar Source

finalBar :: forall melody. IndexedBar melody -> RepeatState -> RepeatState

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