Skip to content

Conversation

@Nick-Mazuk
Copy link
Contributor

Resolves: #8970

Accidentals have a quarter space padding around them. This creates an unnecessarily large gap between accidentals and arpeggios. This PR decreases that gap by a quarter space, making the gap the same size as if the accidentals weren't there.

Before:

Screen Shot 2021-09-09 at 4 00 08 PM

After:

Screen Shot 2021-09-09 at 3 55 52 PM

Currently, the decrease of a quarter space is hardcoded in. Alternatively, we can use the same value that defines the spaces between accidentals. I have not yet found where this is defined, though.

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
@Nick-Mazuk
Copy link
Contributor Author

I could go either way. I tried both and went with 0.25 spaces because then the gap size is identical with and without accidentals.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Sep 10, 2021

Fair enough. To me in the images from original issue's score the distance between barline and arpeggio is still too small with 0.25. But that's nothing this PR here touches on, not directly at least. And in your example that's not an issue either.

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 11, 2021
@Nick-Mazuk
Copy link
Contributor Author

Just added a commit that does a few things:

  1. Shrinks gap to just 0.25 spaces
  2. Removes the hard coded magic number for the accidental padding
  3. Added a style setting for the gap size. It's currently not exposed to the user, but it can be in the future if we wish

Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 13, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 14, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 14, 2021
@Nick-Mazuk
Copy link
Contributor Author

This is a complete rewrite of the feature, but I believe it's finalized.

  1. Increases gap back to 0.5 spaces
  2. Decreases the gap for ♯ by the cutout to make it visually consistent with ♭
  3. The gap follows the contour of the arpeggio and accidentals (i.e., if an accidental can fit closer to the arpeggio than it's bounding box, it will be closer)

For instance, take a look at this image. The sharp now fits inside of the bracket because there's space!

image

All test cases:

accidental-test

Here's the test file I used to validate the changes.

accidental-test.mscz.zip

@Nick-Mazuk
Copy link
Contributor Author

; missing

Fixed

@Nick-Mazuk
Copy link
Contributor Author

Assuming this looks good with everyone, I'm done working on it and it can be merged.

@Jojo-Schmitz
Copy link
Contributor

You may want to squash commits. Those last 3 commits should really be just one

@Nick-Mazuk
Copy link
Contributor Author

Fixed typo and squashed the commits

@Nick-Mazuk
Copy link
Contributor Author

@Jojo-Schmitz, resolved your comments about the unreachable breaks and qreals.

fix code style issues

add semicolon to fix build error

fix typo

fix Jojo's comments

fix code style
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 16, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 17, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 17, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 17, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 20, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 21, 2021
@Nick-Mazuk
Copy link
Contributor Author

These last few updates take care of every last edge case I can think of, including checking the output in multiple fonts. There are also a few minor tweaks as requested by Simon.

There's also some code refactoring to make sure it's easier to read.

Here's what the original test cases look like now:

accidental-test

And with Petaluma, a font with completely different metrics:

accidental-test

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 22, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 24, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
#include "arpeggio.h"

#include <cmath>
#include <QVector>
Copy link
Member

Choose a reason for hiding this comment

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

At the moment we're trying to reduce dependencies from Qt in engraving module. Make sure that you're using STL containers here and in the further PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will do. If I notice that there's an unneeded, existing Qt dependency, I assume I should convert it to a STL container?

Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz Sep 27, 2021

Choose a reason for hiding this comment

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

In my backport of this PR to 3.x that include was not needed (Neither was the cmath) and 3.x's all.h doesn't either.

You're actually using a QVector in chord.cpp too but not the include. And in arpeggio.cpp QVector was used even before your PR. So that include seems not needed at all.

@vpereverzev vpereverzev merged commit c3f719f into musescore:master Sep 27, 2021
@Jojo-Schmitz Jojo-Schmitz mentioned this pull request Sep 27, 2021
@Nick-Mazuk Nick-Mazuk deleted the arpeggio-accidentals branch September 28, 2021 02:07
@vshalkevich vshalkevich self-assigned this Sep 28, 2021
@DmitryArefiev
Copy link
Contributor

Assigning to @vshalkevich

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
@DmitryArefiev DmitryArefiev removed their assignment Oct 1, 2021
@vshalkevich
Copy link

Checked on Linux Ubunty, Windows 10, MacOS
Works fine

@vshalkevich vshalkevich removed their assignment Oct 2, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 3, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 7, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
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.

[MU4 Issue] Accidentals create too much space for arpeggio lines

6 participants