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

Playback fixes for hairpins in combination with compound dynamics #24569

Merged

Conversation

cbjeukendrup
Copy link
Contributor

@cbjeukendrup cbjeukendrup commented Sep 9, 2024

Resolves: compound dynamics were not (correctly) considered when looking for end dynamic of hairpin
(related to https://musescore.org/en/node/367942)

Seems like that was a 4.3.2 -> 4.4.0 regression

See commit messages for details

Builds on: #24544

@cbjeukendrup cbjeukendrup added the regression MS4 Regression on a prior release label Sep 9, 2024
@zacjansheski
Copy link
Contributor

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved
Issue fixed

`nominalDynamicLevel` returns `Natural` when there is no dynamic exactly at the requested tick
- Refactor: replace dynamicLevelFromType with more specific functions for specific kinds of dynamics
- Make the list of single note dynamics more complete
- For hairpins that start with a compound dynamic that's built into the hairpin: use the 'to' dynamic of the compound dynamic as the 'from' dynamic of the hairpin
- For hairpins that end with a compound dynamic, same, but the other way around (instead of treating a compound end dynamic as "Natural")
- The `spannerTo -= Fraction::eps().ticks();` trick should happen not when the nominal hairpin end dynamic differs from the nominal dynamic after the hairpin, but when the *actual* end dynamic differs.
- When the hairpin's own nominal end dynamic is not used because it does not match the 'direction' of the hairpin, this end dynamic was always applied just after the hairpin. But this should not be done when there is already a dynamic at the end tick of the hairpin. That's not because it would override that existing dynamic, because in this case the 'shorten hairpin by 1 tick' trick has been applied to prevent such overriding; instead, it's because it would write this end dynamic 1 tick too early because of that trick, which means that it will apply to exactly one tick, because after that the existing dynamic applies. This is useless, so instead we will discard the end dynamic in this case.
@rgreen5
Copy link

rgreen5 commented Sep 21, 2024

OS: Linux Mint 20.1, Arch.: x86_64, MuseScore Studio version (64-bit): 4.4.0-242390800, revision: github-musescore-musescore-0fcd11b

Does this commit fix the hairpin playback problem in measures 202-205 in the attached file (beginning of variation 8)

hairpin_playback_issue.zip

If not I'll open a new issue.

@cbjeukendrup
Copy link
Contributor Author

@rgreen5 Unfortunately, this PR doesn't solve that issue. It looks like the weirdness in that score is caused by the invisible dynamic markings (rather than the hairpins themselves); the dynamic markings are in voice 2, while the hairpins are set to affect all voices. We'll need to think about what the exact logic in such a situation should be. So opening a new issue is indeed the right thing to do. Thanks!
(Also, it might be useful to know the history of that score; was it created in an earlier version, and then imported in 4.4? If yes, then the inconsistency in voice assignment might actually be MuseScore's own fault. Anyway, probably better if you answer in the new issue rather than here.)

@cbjeukendrup cbjeukendrup merged commit e4522b4 into musescore:master Sep 22, 2024
11 checks passed
@cbjeukendrup cbjeukendrup deleted the hairpins_compound_dynamics branch September 22, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression MS4 Regression on a prior release
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants