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

[MU3 Backend] ENG-40 dynamics inference #8347

Merged

Conversation

iveshenry18
Copy link
Contributor

Resolves: ENG-40: Dynamics are sometimes rendered as plain text

A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.

  1. In the case that a whole direction is a dynamic, this converts
    that whole direction to the specified dynamic, including handling the
    velocity change.
  2. In the case that a direction contains a dynamic in addition to other
    text (i.e. mf cresc.), this converts the dynamic portion to the proper
    MuseScore dynamic symbol (with no velocity change).
    In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
    to dynamic.h, so it can be used as the list of symbols to match.
  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@Jojo-Schmitz
Copy link
Contributor

rebase needed

A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.
@iveshenry18
Copy link
Contributor Author

Rebased!

@vpereverzev vpereverzev merged commit f09a45c into musescore:3.6.2_backend Jun 29, 2021

// variant with ligatures, works for both emmentaler and bravura:

static Dyn dynList[] = {
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz Jun 30, 2021

Choose a reason for hiding this comment

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

This resulte in a ton (>120) of compiler warnings reg. a defined but unused variable:
warning: 'Ms::dynList' defined but not used [-Wunused-variable]

Variables should never ever get defined in header files IMHO...
But just declaring it won't work, as the size then is unkown?!?

Hmm, making that static const Dyn dynList[] = { fixes the compiler warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, fair point. I couldn't figure out a simple way to make this list available to the XML importer without declaring it in the header file, but I understand defining it there is a bit dirty. Perhaps a vector rather than array, to define it without having to know the size?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just adding the const appeases the compiler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a PR with that then—thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can add fixes for the other warnings, from your other PRs?

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jun 30, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 1, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 5, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 6, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 13, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 28, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 28, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 30, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 1, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 2, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
A common XML exporter error is to mistake dynamics for direction text.
This commit adds two functions for correcting these mistakes.
1. In the case that a whole direction is dynamic, this converts
that whole direction to the specified dynamic, including handling the
velocity change).
2. In the case that a direction contains a dynamic in addition to other
text (i.e. mf cresc.), this converts the dynamic portion to the proper
MuseScore dynamic symbol (with no velocity change).
In pursuit of this, the dynList of Dyn structs is moved from dynamic.cpp
to dynamic.h, so it can be used as the list of symbols to match.

Duplicate of musescore#8347, plus fixing a compiler warning (which shows some 120
times), duplicate of musescore#8478
@miiizen miiizen mentioned this pull request Apr 2, 2024
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 12, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 12, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 12, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 12, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 12, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 13, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 15, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier)
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier). An mtest fails on this,
but the next commit fixes that, so it seems that change just ended up in the
wrong commit.
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Apr 18, 2024
Backport of musescore#22143, commit 1, which in turn is a port of musescore#8347 and musescore#8478
(which at least partly had been ported to 3.x earlier). An mtest fails on this,
but the next commit fixes that, so it seems that change just ended up in the
wrong commit.
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.

None yet

4 participants