Tokenize: replace every space with "% " then split on " ".
Pop trailing empty strings.
Count total beats: each token contributes 1 + count('%') beats.
size = max(timeSignature.denominator, totalBeats)
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.
Pad remaining positions with lastChord (null if no chords were parsed).
Throws InvalidChordStringError on invalid chord strings or bare "%" tokens.
Parse a raw measure string into a MeasureModel.
Algorithm (_setup_beats):
slots = 1 + count('%')positions.Throws InvalidChordStringError on invalid chord strings or bare "%" tokens.