-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix #17600 - Tuplets Skipped by Alt+left and Alt+right #18947
Fix #17600 - Tuplets Skipped by Alt+left and Alt+right #18947
Conversation
This doesn't seem to work correctly to me - tuplet brackets will be included (sometimes) as you step through with alt-left/right, but the sequence seems to get thrown and many items will be skipped. I've not managed to deduce what the pattern is yet. |
ChordRest* nextCR = nextChordRest(this); | ||
Tuplet* tuplet = nextCR ? nextCR->tuplet() : nullptr; | ||
if (tuplet) { | ||
return tuplet; |
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 is a good start, but it's in the wrong place. I can tell because with your build Alt+Right skips barlines and articulations/lyrics/fermatas on the current note and goes straight to a tuplet on the next note instead:
Alt+Right should visit everything on the current note before moving on to the next note, so my guess is this code probably needs to go at the end of this function, or perhaps in Segment::nextElement()
instead (because that function is called at the end of this function).
In fact, I think it should go in Segment::firstElementOfSegment()
, which is called from within Segment::nextElement()
.
Also, you should only visit the tuplet if nextCR
is the first (leftmost) ChordRest within the tuplet. If nextCR
is in the middle/end of the tuplet then you shouldn't visit the tuplet.
Tuplet* tuplet = prevCR ? prevCR->tuplet() : nullptr; | ||
if (tuplet) { | ||
return tuplet; |
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.
When going backwards, you shouldn't look for tuplets on the previous ChordRest (CR). Instead you would check current CR. You need to know:
- Does the current CR have a tuplet? And if so...
- Is the current CR the first (leftmost) CR inside the tuplet?
If the answer to both questions is "yes" then you visit the tuplet, otherwise go back to the previous CR.
|
||
EngravingItem* Tuplet::nextElement() | ||
{ | ||
return elements().front(); |
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.
Good!
|
||
EngravingItem* Tuplet::prevElement() | ||
{ | ||
return elements().back(); |
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.
The previous element will be something before the tuplet, not something inside the tuplet. Exceptionally, it might be an element in a different voice that occurs at the same time as the tuplet.
You probably need to call Segment::previousElement()
or something like that.
Thanks for the review, working on the changes |
fa1f8d3
to
525a11a
Compare
Rebase needed, but see also #23082, while this here looks pretty much orphaned? |
Closing due to a long period of inactivity. Also, see #23082 |
Make Tuplet select-able via alt+right, alt+left
Resolves: #17600
Clone of PR #18346