-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Improved collision management between beams, beamlets and rests #16410
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
Conversation
35b1934
to
edfd4ac
Compare
About vtests, please see https://github.com/musescore/MuseScore/wiki/Visual-Tests |
@igorkorsukov See also my comment at #16237 (comment); after updating the reference files, you can't see the diff visually anymore, right? And there is another thing that's regrettable about the new approach: when a new vtest is added, there are no reference files for this test, so you can't see the diff for it. With the old approach this was possible. |
from #16237
If there are a lot of problems and difficulties with the new approach, I will return the old one when two binaries are on CI, two data set is generated and compared. Let's try, get some experience and then decide whether to return it back or not. The new approach has its advantages, the main point of the changes was to make more efficient work with the test locally, during development. At the same time, to be able to check what has changed on thousands of files (where they will be taken is a separate topic). This is important because we plan to start making big changes to the engraving engine this year, in order not to break anything and keep it under control, we need to keep its current work (not the implementation, but the result of the work). |
fefd0e4
to
e36de69
Compare
Closing as included in the bigger work of #16719 |
Resolves: #15301
The general purpose of the PR is to improve the collision management between beams, beamlets and rests. This involves two separate jobs:
There is a basic underlying requirement to both taks, that is to improve the Shape of beams. At the moment, Beam::shape() returns the bare bounding box, which is a very rough approximation of the actual shape and isn't good enough for what we need to do. This requires to:
a. Promote BeamSegment to being an actual engraving item.
b. Implement BeamSegment::shape() to return a good approximation of the actual shape. If the beam is horizontal this is just a single rectangle. If not, it is broken into multiple rectangles.
c. Implement Beam::shape() as a collection of BeamSegment::shape().
Here's how the shapes were done before:


Here's how they are done now:
Having taken care of this prerequisite, moving rests vertically to clear beams is rather straightforward and happens in LayoutBeams::verticalAdjustBeamedRests.
The horizontal spacing is a trickier issue. It requires to
a. Let the Chord know when it has a beamlet.
b. Add the beamlet to the chord shape.
c. Add appropriate paddings.
BEFORE:

AFTER:

NOTE: this PR does not address all the requirements of multil-voice situations. That will be a separate job, also coming soon.