Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #24702: Voice too long corruption #24948

Merged

Conversation

mathesoncalum
Copy link
Contributor

@mathesoncalum mathesoncalum commented Sep 27, 2024

Resolves: #24702

Introduced with #23911

The idea here is to scan backwards from the input position to find the previous ChordRest, check if the duration overlaps with the input position, shorten the previous ChordRest by the length of the overlap, and fill any remaining gaps with tied notes (if necessary).

This PR also addresses some janky input when switching voices in the middle of a tuplet (shown below) - for now we'll simply move the input cursor to the beginning of the tuplet. In future we may consider adding tuplets to the "new" voice in this case, but a few UX considerations will need to be resolved before we make this happen.

box-241001-1508-30.mp4

@cbjeukendrup
Copy link
Contributor

It works well when the new duration of the previous note can be represented as a single duration, but otherwise still causes corruptions:

Schermopname.2024-09-28.om.01.54.24.mov

So changeCrLen is unable to split a note into multiple tied notes when it cannot be represented as a single note. There must be some other method somewhere in the engraving module that is able to do this, but I wouldn't know where.

@mathesoncalum
Copy link
Contributor Author

@cbjeukendrup apparently it can actually split the note into multiple ties, but only if the target ChordRest is being lengthened instead of shortened... Looking into it.

@zacjansheski
Copy link
Contributor

zacjansheski commented Oct 1, 2024

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved
#24702 FIXED

@mathesoncalum mathesoncalum merged commit c77723a into musescore:master Oct 1, 2024
11 checks passed
@mathesoncalum mathesoncalum deleted the 24702-voice_length_corruption branch October 1, 2024 18:18
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.

Voice too long corruption
4 participants