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
New dynamics properties for voicing and stave positioning #22662
base: master
Are you sure you want to change the base?
Conversation
@mike-spa First off, this is sooooo satisfying! Bravo. Testing it a bit just now and found a few small things:
dynamics-positioning-bottom.mov |
e48de7c
to
974f5fb
Compare
|
@mike-spa I created a PR to your repo to implement the design for the "All" button: mike-spa#1 |
a1c4776
to
ca42264
Compare
For @cbjeukendrup: Also, would it be possible to make this button a reusable component i.e. one that shows up in "UI Gallery" for future use? :) For @mike-spa, cc @bkunda: If it's set to "All voices on the instrument", then I copy a dynamic set to voice 3 and paste it somewhere else, it gets set to "All voices" and the "Position" and "Center between staves" get reset to "Auto", even if I had manually chosen other options. I think dynamics should retain their properties when copied and pasted instead, regardless of what you've chosen in preferences. |
Done!
It is already reusable; it basically consists of three components: the FlatButton, the menu indicator triangle that is also seen in the note input bar, and the menu. But I've added the combination of the three to the DevTools page, because why not.
Unfortunately, that is difficult. Making the menu open on press (instead of release) is doable, but the problem is that you can't receive release events in the menu items if the initial press event was sent to anything other than the menu item (namely to the button). Also, when we implement this, we should implement it for all menu buttons throughout the app in one go. Feel free to open a new feature request for that. |
@avvvvve Done! ✅ |
43d21b4
to
245aa9e
Compare
@mike-spa Looking good! The addition of the voice preference is great. I'd suggest a small change to the label: A couple other style dialog things:
And one engraving thing: |
47e560a
to
538cb3c
Compare
@avvvvve all done! |
Re: #1 above, the reset button only becomes active if you change the position setting. It should become active if you uncheck either of the other two options too. The rest below we can address in follow-ups to this PR after merging! I noticed some slightly strange behavior with the actual placement of centered dynamics. Check the video below. I added a ridiculously tall spacer to the staff to illustrate that the dynamic moves around when a note's boundaries extend beyond one of the staves even if it's still very far away from the dynamic. Dynamics on the very first note of the system appear slightly misaligned with the rest. mp generally feels vertically misaligned with mf. Personally, I'd expect their baselines to be the same. I don't think other in-score elements are causing this offset. dynamics-centering-issues.mov |
2331b19
to
28e0a2c
Compare
The behaviour shown in the video is as intended for now - pending a lot more testing in real-world situations; more nuance and possibly config options will be required. We centre dynamics in the available vertical space (not between the staves only), and also do not align the baselines since p, mp etc (dynamics with descenders but no ascenders) then appear too low in isolation. When dynamics are adjacent or close together then yes, the baselines should probably align (in most situations), but that matter is to be addressed in Phase II. |
f30d202
to
67df2c7
Compare
67df2c7
to
0d998bb
Compare
|
||
void EngravingItem::setInitialTrackAndVoiceApplication(track_idx_t track) | ||
{ | ||
if (track == muse::nidx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be IF_ASSERT_FAILED instead?
if (track == muse::nidx) { | ||
track = m_track; | ||
} | ||
if (MScore::dynamicsApplyToAllVoices) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of these global flags... Can we add it to the engraving configuration instead?
setProperty(Pid::APPLY_TO_VOICE, VoiceApplication::ALL_VOICE_IN_INSTRUMENT); | ||
} else { | ||
setTrack(track); | ||
setProperty(Pid::APPLY_TO_VOICE, static_cast<VoiceApplication>(track2voice(track))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit odd... As if a dynamic can be added to one voice, but affect another. Maybe VoiceApplication should only have 3 values:
ALL_VOICE_IN_INSTRUMENT
ALL_VOICE_IN_STAFF
CURRENT_VOICE_ONLY
What do you think?
|
||
const Staff* thisStaff = element->staff(); | ||
const std::vector<Staff*>& partStaves = part->staves(); | ||
if (thisStaff == partStaves.front() && element->placeAbove() || thisStaff == partStaves.back() && element->placeBelow()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to check if partStaves is empty
} | ||
|
||
staff_idx_t thisIdx = thisStaff->idx(); | ||
staff_idx_t nextIdx = element->placeAbove() ? thisIdx - 1 : thisIdx + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thisIdx - 1
It is better to check that thisIdx > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for centerElementBetweenStaves
staff_idx_t nextIdx = element->placeAbove() ? thisIdx - 1 : thisIdx + 1; | ||
|
||
const SysStaff* thisSystemStaff = system->staff(thisIdx); | ||
const SysStaff* nextSystemStaff = system->staff(nextIdx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These pointers should also be checked for null
Resolves: #22175
The way that the "All voices" option is presented in the properties is just a placeholder. It functions correctly, but it looks different from the design. Given that implementing the required button+dropdown will take some more work, @cbjeukendrup and I have decided to do it later. Meanwhile, @avvvvve and @oktophonie please have fun with this, looking forward to your feedback 😄