The editor’s file format now has chords: several pitches sounding together for the same beats. The import already turns them into Chord nodes, but nobody decided what a chord means for each operation, so its accept does nothing. Arrangers have started writing divided passages for the altos as chords.
A part with chords reports a shorter playing time than it has, and a chord with a note nobody can sing passes the range check.
Reproduce
score[chord c1 [64 86] (2)] with the alto range 55–79 should report beats: 2 and flag c1. Today it reports beats: 0 and flags nothing.
Acceptance criteria
- A chord adds its beats to the playing time once, and twice inside a repeated section.
- A chord is flagged by its id, once, when any of its pitches is outside the range.
- Notes, rests and repeats behave as before, and a kind of node the check has never seen is still checked.
- Each operation decides what a chord means for it in that operation’s own code.
Notes
- Each case prints “beats: N | flagged: ids” (or “(none)”): the playing time from totalBeats (Go: TotalBeats; Rust: total_beats), then the range check. A chord is written as its id, its pitches in brackets, and its beats in parentheses.
- Keep the names and signatures of Note, Rest, Section, Chord, PlayingTime, RangeCheck, totalBeats and outOfRange (Go: TotalBeats, OutOfRange; Rust: total_beats, out_of_range). You may change the Visitor contract.