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

Remove hanging ties on XML import #22455

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Apr 17, 2024

This PR ports some of #8556, but doesn't replace hanging ties with l.v. articulations, opting instead to simply delete them pending a proper feature.

The PR also limits the length of ties. Ties ending in a different bar will only be connected if there are no intermediary notes or rests in a voice which avoids this case (the final A has a tie ending tag).
image

Dolet 6 doesn't export cross stave information which can lead to unterminated ties. We search for these cases, and if found create cross stave ties:
screenshot_2024-04-12_at_09 38 22_720

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 17, 2024
Backport of musescore#22455, which in turn is a port of musescore#8556 (which got ported to 3.7 earlier), but doesn't replace hanging ties with l.v. articulations, opting instead to simply delete them pending a proper feature.
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 17, 2024
Backport of musescore#22455, which in turn is a port of musescore#8556 (which got ported to 3.7 earlier), but doesn't replace hanging ties with l.v. articulations, opting instead to simply delete them pending a proper feature.
return;
}

auto chord = note->chord();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of "auto". I use it only for complicated types like iterators etc, but when the type is as simple as Chord*, better make it explicit

if (el && el->isChord()) {
Note* matchingNote = toChord(el)->findNote(unterminatedTieNote->pitch());
if (matchingNote && matchingNote->tpc1() == unterminatedTieNote->tpc1()
&& matchingNote->tpc2() == unterminatedTieNote->tpc2()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to check both tpc1 and tpc2. As far as I know, the first is the concert pitch version, the latter is the transposed version: if one is equal, the other must be equal too. Perhaps you can simply use note->tpc(), which will choose by itself

@mike-spa mike-spa merged commit 2e7f673 into musescore:master Apr 18, 2024
11 checks passed
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22455, which in turn is a port of musescore#8556 (which got ported to 3.7 earlier), but doesn't replace hanging ties with l.v. articulations, opting instead to simply delete them pending a proper feature.
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22455, which in turn is a port of musescore#8556 (which got ported to 3.7 earlier), but doesn't replace hanging ties with l.v. articulations, opting instead to simply delete them pending a proper feature.
@miiizen miiizen mentioned this pull request Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants