Skip to content

(AI Generated) makeTies: fall back to the measure when the voice id is missing - #2042

Open
rdebroiz wants to merge 1 commit into
cuthbertLab:masterfrom
rdebroiz:fix/make-ties-missing-voice-id
Open

rdebroiz wants to merge 1 commit into
cuthbertLab:masterfrom
rdebroiz:fix/make-ties-missing-voice-id

Conversation

@rdebroiz

@rdebroiz rdebroiz commented Sep 22, 2026 •

Copy link
Copy Markdown

Fixes #2024: makeTies raises KeyError when a rest crossing a barline belongs to a string-id voice missing from the next measure, which breaks MusicXML export.

The voice is now looked up with mNext.voices.getElementById(vId) for string and int ids alike, as suggested in the issue. None falls back to the measure, and unlike an or chain this doesn't skip a matching empty voice.

No test added on purpose. The one in the closed #2031 did not test makeTies directly: it went through makeRests, which calls makeTies.

AI-assisted (Claude)

Look the voice up with voices.getElementById for string and int ids
alike, so a string id absent from the next measure no longer raises
KeyError. Fixes cuthbertLab#2024.
@rdebroiz rdebroiz changed the title makeTies: fall back to the measure when the voice id is missing (AI Generated) makeTies: fall back to the measure when the voice id is missing Sep 22, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.35% (+0.001%) from 93.349% — rdebroiz:fix/make-ties-missing-voice-id into cuthbertLab:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

makeTies raises KeyError when bridging a string voice id absent from the next measure

2 participants