Skip to content

Harp pedalling diagrams and UI #12597

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

Merged
merged 20 commits into from
May 12, 2023
Merged

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Jul 29, 2022

This pull request adds harp pedalling diagrams to MuseScore for GSoC 2022.

Pedal diagram demo

Known issues

  • Opening via shortcut
  • Stacking of diagrams around other elements
  • Placement of the popup on the score
  • The arrow at the top of the UI
  • Probably some spacing within the UI

  • 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 created the test (mtest, vtest, script test) to verify the changes I made

@miiizen miiizen force-pushed the harp-pedal-ui branch 4 times, most recently from 3ffc6d6 to e55ff70 Compare August 16, 2022 18:09
Copy link
Member

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

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

Some (probably last) minor comments about everything except the changes in the notation module! (those I will review later)

@cbjeukendrup
Copy link
Member

This PR needs a rebase too; this time all conflicts are just about the #includes.

@miiizen miiizen force-pushed the harp-pedal-ui branch 2 times, most recently from 84f7718 to ea6326d Compare September 9, 2022 17:47
@cbjeukendrup cbjeukendrup added the vtests This PR produces approved changes to vtest results label Sep 17, 2022
@bkunda bkunda added the needs review The issue needs review to set priority, fix version or change status etc. label Mar 14, 2023
@cbjeukendrup
Copy link
Member

Hi @miiizen! We have started working on MuseScore 4.1, and we would like to include this PR. It would be great if you could rebase it. I've also posted a few review comments that I had written earlier but apparently not yet published.

@miiizen
Copy link
Contributor Author

miiizen commented Mar 20, 2023

Hi @cbjeukendrup! That's great news thanks for letting me know. I'll have time to rebase and make these changes around the end of next week.

Copy link
Member

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

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

Another round of review comments! It's really very good now, so this is probably the last review round from me and then I'll ask a colleague to check it too.

@Tantacrul
Copy link
Contributor

Tantacrul commented Apr 28, 2023

Had a poke at the diagram to see how things are going with it. Found a few things and thought I'd share. Sorry if this is a bit premature and you were planning on asking us to test later.

Harp_Ped_01.mp4

@cbjeukendrup
Copy link
Member

@miiizen A rebase is needed again...

OBJECT_ALLOCATOR(engraving, HarpPedalDiagram)
DECLARE_CLASSOF(ElementType::HARP_DIAGRAM)

std::array<PedalPosition, 7> _pedalState;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest adding a named constant and using it instead of this magic number

#include "pitchspelling.h"

using namespace mu;
//using namespace mu::engraving;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this line

@RomanPudashkin
Copy link
Contributor

This PR looks great (and ready to be merged), thank you so much! The only issue that it has is the broken unit tests. If you can't fix them yourself (or don't have enough time), I suggest disabling them (I'll fix them later). Or you can try rebasing this PR one more time, maybe this will help

@miiizen
Copy link
Contributor Author

miiizen commented May 11, 2023

Thanks for the feedback!
Rebasing hasn't fixed them - afraid I won't have time to try to fix the tests til after Tuesday, feel free to have a look yourself.

@miiizen miiizen marked this pull request as ready for review May 11, 2023 20:12
@cbjeukendrup
Copy link
Member

cbjeukendrup commented May 11, 2023

Fortunately, I think the test failures are no mystery at all. The default z index of an element is defined as its ElementType casted to int multiplied by 100. Because the HARP_DIAGRAM type got inserted, the default z-index for images was incremented (because the IMAGE element type comes after HARP_DIAGRAM).

The reason that the z index is written to the file in those specific files where the tests fail, is that it is "customised" in those places. And the reason that it is customised and gets changed while reading/writing the score, is BSymbol::add (and Image is derived from BSymbol). What happens is that when reading the score, the z index of the inner image gets set to the z index of the outer image minus one, regardless of what's written in the file. The z index of the outer image was not customised, so will use the new default value. Therefore the z index of the inner image will be changed too.

So the fix would be to just update the contents of src/engraving/tests/parts_data/part-image.mscx and src/engraving/tests/parts_data/part-image-parts.mscx according to https://github.com/musescore/MuseScore/actions/runs/4952108865/jobs/8857989773?pr=12597#step:9:3323

(Of course, this behaviour of changing z index while reading is very questionable, but that's a separate problem.)

@RomanPudashkin RomanPudashkin merged commit dea7ce2 into musescore:master May 12, 2023
RomanPudashkin added a commit to RomanPudashkin/MuseScore that referenced this pull request May 12, 2023
RomanPudashkin added a commit to RomanPudashkin/MuseScore that referenced this pull request May 12, 2023
@RomanPudashkin RomanPudashkin mentioned this pull request May 12, 2023
@miiizen miiizen deleted the harp-pedal-ui branch January 9, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review The issue needs review to set priority, fix version or change status etc. vtests This PR produces approved changes to vtest results
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants