Fix cmdDeleteTuplet: use first element tick instead of (corrupt) tuplet tick#33366
Open
manolo wants to merge 2 commits into
Open
Fix cmdDeleteTuplet: use first element tick instead of (corrupt) tuplet tick#33366manolo wants to merge 2 commits into
manolo wants to merge 2 commits into
Conversation
…et tick Tuplet::tick() can be wrong on MIDI-imported scores because the MIDI importer does not call setTick() on Tuplet objects, leaving Tuplet::m_tick at its default value of 0. When cmdDeleteTuplet calls setRest(tuplet->tick(), ...) it places the replacement rest at tick 0 instead of the actual tuplet position, silently corrupting the score. Fix: save the tick from the first element BEFORE removing elements and use that instead of tuplet->tick(). Falls back to tuplet->tick() if the elements list is empty (unchanged behaviour). Fixes musescore#33360
mathesoncalum
requested changes
May 13, 2026
Contributor
mathesoncalum
left a comment
There was a problem hiding this comment.
I think we should address this in our importers and prevent the corrupted tick from happening in the first place. It shouldn't matter how a tuplet was created, the deletion implementation should be the same.
Contributor
|
I believe you should rebase it to main (rather than master), if alone for it to show in the issue as fixing it |
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.
Resolves: #33360
Tuplet::tick()can return 0 on imported scores because several importers do not callsetTick()onTupletobjects, leavingTuplet::m_tickat its default value. WhencmdDeleteTupletcallssetRest(tuplet->tick(), ...)it places the replacement rest at tick 0 instead of the actual tuplet position, silently corrupting the score (notes at measure 1 beat 1 are overwritten).Confirmed with MIDI import. Likely also affects OVE, GuitarPro and TableEdit imports, which also skip
setTick()on tuplets.Fix: save the tick from the first element BEFORE removing elements and use that instead of
tuplet->tick().