Repository navigation
fix(importer): apply MusicXML dynamics per part and show them only where written - #2996
Merged
Merged
Conversation
Danielku15
force-pushed
the
feature/issue-2979
branch
from
October 29, 2026 18:18
7d92562 to
7006447
Compare
…ere written Dynamics were kept as one importer-wide state assigned to the next created beat, leaking across staves and parts. A marking is now shown on the next note of the staff (and voice) it is written for via the new Beat.showDynamics, and carried forward in time to all staves of its part for playback, like MuseScore and Dorico do by default. Fixes #2979
Danielku15
force-pushed
the
feature/issue-2979
branch
from
October 29, 2026 18:48
7006447 to
7c099a3
Compare
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
AI-authored disclosure (
alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Issues
Fixes #2979
Proposed changes
The MusicXML importer kept one importer-wide "current dynamic" and gave it to whichever beat it created next in document order.
<staff>was ignored, so a dynamic leaked onto other staves of a part (in43e-Multistaff-ClefDynamicsstaff 2 showed and playedpfrom beat 1, before it is even written) and into other parts.<direction>dynamic belongs to the next note of its staff (and voice, if given) and is shown there. This is expressed by the new optionalBeat.showDynamics; when unset (all other importers) rendering is unchanged.test-datause the identical encoding with opposite intent, and MuseScore 4 and Dorico apply dynamics to the whole instrument by default. Strictly per-staff playback would make the left hand of those Finale files play f under a written p. Of markings at the same position, the staff's own one wins, so per-hand dynamics written together still work.<notations><dynamics>are now shown too (they were always hidden). Repeats of these are not redrawn, because Guitar Pro writes one on every note.<offset>is not used for dynamics; a marking takes effect at its note.24 MusicXML references change. Dynamics that are not written disappear (the default f on the first beat, copies on other staves and parts), and written ones that were hidden now show (note-attached dynamics, restated p/pp after hairpins).
showDynamicscannot be expressed in alphaTex or Guitar Pro, so exporting such a score draws inherited dynamics where the value changes, as before.Checklist
AI authorship disclosure
(
alphatab-ai-authored-v1) is present at the top of this body, and I havepersonally reviewed every change and can explain each one
Further details