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 GH#24553: MusicXML: A title like "Jazz Piece No. 5" get interpreted as a subtitle #24555

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

Jojo-Schmitz
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz commented Sep 8, 2024

Resolves: #24553

Turned out to be a rather simple off-by-one error, @miiizen ?

Edit: Apparently not, but let's not try it infer anything from a title if it is just one line.

@Jojo-Schmitz Jojo-Schmitz force-pushed the xml-title branch 4 times, most recently from 8425569 to 77a7b54 Compare September 8, 2024 14:44
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 8, 2024
…ed as a subtitle

Backport of musescore#24555 and (a part of) musescore#22056, the latter having caused a bug fixed by the former
@cbjeukendrup
Copy link
Contributor

Note that the exact functionality is still different than before 0ea3638.

Before:
when one line is encountered that is likely credit/subtitle text, then that line and all lines below it are moved to credit/subtitle text.

After:
when one line is encountered that is likely credit/subtitle text, only that line is moved.

@Jojo-Schmitz
Copy link
Contributor Author

Question is whether that is better or not, isn't it?

@cbjeukendrup
Copy link
Contributor

That's up to @miiizen and @oktophonie.

@Jojo-Schmitz
Copy link
Contributor Author

of course it is ;-)

@Jojo-Schmitz
Copy link
Contributor Author

Jojo-Schmitz commented Sep 12, 2024

Can we have this reviewed please?

Ported to 4.4.3, see #24750

@miiizen
Copy link
Contributor

miiizen commented Sep 18, 2024

I can see the problem here, but I don't think this is the way we should fix it. I'd prefer to prevent this situation either:

  • by not inferring subtitles or credits when there is only one line of text
  • or, if after inference we end up with an empty title, promote the first line back to title

@Jojo-Schmitz
Copy link
Contributor Author

Isn't my change doing exactly not inferring subtitles or credits when there is only one line of text ? It just skips the loop if there's only one line

@miiizen
Copy link
Contributor

miiizen commented Sep 18, 2024

We'd still like to check if the first line of a title would be better suited to a subtitle when there is more than one line.

@Jojo-Schmitz
Copy link
Contributor Author

Which again would leave the score without a title

@miiizen
Copy link
Contributor

miiizen commented Sep 18, 2024

If I set the title to this:

<work>
  <work-title>Jazz Piece No. 5
  rest of title</work-title>
</work>

I get the following, which is what we'd prefer!
image

@Jojo-Schmitz
Copy link
Contributor Author

Jojo-Schmitz commented Sep 18, 2024

So something like this would pass muster?

    size_t nrOfTitleLines = titleLines.size();
    if (nrOfTitleLines == 1) {
        return;
    }
    for (size_t i = nrOfTitleLines; i > 0; --i) {
    ...

Copy link
Contributor

@miiizen miiizen left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 18, 2024
…ed as a subtitle

Backport of musescore#24555 and (a part of) musescore#22056, the latter having caused a bug fixed by the former
@Jojo-Schmitz
Copy link
Contributor Author

Rebased to fix merge conflicts.
Please consider a timely merge.

@miiizen miiizen merged commit f90a0a9 into musescore:master Oct 18, 2024
11 checks passed
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 18, 2024
…ed as a subtitle

Backport of musescore#24555 and (a part of) musescore#22056, the latter having caused a bug fixed by the former
@Jojo-Schmitz Jojo-Schmitz deleted the xml-title branch November 4, 2024 08:44
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.

MusicXML: A title like "Jazz Piece No. 5" get interpreted as a subtitle
3 participants