Chant Forge turns public-domain Gregorian chant, written in the GABC notation, into MIDI choir lines with Latin lyrics. Its first converter had only run on small inputs written for its own tests. Re-reading the format turned up four misreads that real files from GregoBase would hit.
- Windows line endings. The comment stripper split on
\nand removed%to the end of the line. With CRLF files the stray\rstopped the match, so a comment's text was sung as a lyric. The fix splits on\r?\n. - Special-character tags.
<sp>R/</sp>and<sp>V/</sp>are the response and versicle signs; the old code stripped every tag and left the syllable empty. They, and<sp>'ae</sp>, now keep their characters. - Text that is not sung.
<v>holds raw TeX and<alt>text printed above the staff. Centre braces,*and the cross are also dropped from lyrics. - Clef changes inside a group.
(::c3)and(z c3)put a clef change after a bar or line break in the same group as other signs. The reader only noticed a clef when it was the whole group, so every later pitch came out in the wrong place.
Six new tests cover these, on made-up strings shaped like real files. A batch run over real GregoBase files is still to do, and NABC alternations are still cut at the first |.
The code is MIT in ventures/chant-forge.