@tonalis/music-dsl
    Preparing search index...

    Function parseMeasure

    • Parse a raw measure string into a MeasureModel.

      Algorithm (_setup_beats):

      1. Tokenize: replace every space with "% " then split on " ". Pop trailing empty strings.
      2. Count total beats: each token contributes 1 + count('%') beats.
      3. size = max(timeSignature.denominator, totalBeats)
      4. Fill: for each token, strip all '%' to get chordStr. If chordStr is empty (literal "%" token) → throw InvalidChordStringError. Otherwise parseChord(chordStr), write to slots = 1 + count('%') positions.
      5. Pad remaining positions with lastChord (null if no chords were parsed).

      Throws InvalidChordStringError on invalid chord strings or bare "%" tokens.

      Parameters

      Returns MeasureModel