Skip to content

Conversation

@Ash-86
Copy link
Contributor

@Ash-86 Ash-86 commented Nov 19, 2025

Resolves: #27905

Allows T to work on list selections outside note entry. Works only on single chord selections as shown below.
(Would be cool to add multiple staves support later on)

Recording.2025-11-18.221523.mp4

Another option would be to add a tied note to the next chord without overwriting.

Third option would be to only allow cases where next chordRest is rest only. (see discussion in #27905)

@Ash-86 Ash-86 force-pushed the Allow-T-to-work-on-list-selection-outside-note-entry branch 2 times, most recently from 89a5b2a to be62a67 Compare November 19, 2025 01:38
Comment on lines 2185 to 2188
if (!tieNote && selection().isList() && sameChord) {
Tie* tie = nullptr;

if (sameChord) {
Copy link
Member

Choose a reason for hiding this comment

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

Checking sameChord twice

And tie seems an unnecessary variable

It would be nice to move this outside for (size_t i = 0;… loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@Ash-86 Ash-86 force-pushed the Allow-T-to-work-on-list-selection-outside-note-entry branch from be62a67 to 03a3056 Compare November 19, 2025 19:35
@Ash-86 Ash-86 force-pushed the Allow-T-to-work-on-list-selection-outside-note-entry branch from b7d3101 to cd5a17a Compare November 19, 2025 19:46
std::vector<Note*> tieNoteList(notes);
const bool shouldTieListSelection = notes >= 2;
Note* tieNote = nullptr;
Note* n = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

n is only used for getting the Chord. So instead of extending the scope of n, let's add a Chord* chord variable, that's initialised as noteList[0]->chord(); then you can reuse that variable in the std::all_of predicate.

}
}

if (!tieNote && selection().isList() && sameChord) {
Copy link
Member

Choose a reason for hiding this comment

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

Now the logic has become the following:
if for the last selected note no tieable note was found, then cmdAddTie.

But I suppose the intention was:
if for any selected note [...].

I must say the meaning of the condition is not immediately clear in the way it's written right now. Is it supposed to be "If all selected notes are in the same chord, and for any one of them there is no existing note to tie to, then add new tied notes"? It might help to add a comment or introduce a descriptively named variable.

Copy link
Contributor Author

@Ash-86 Ash-86 Nov 20, 2025

Choose a reason for hiding this comment

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

You're absolutely right! I shouId've made it clearer, but I intentionally left the condition a bit loose so we could discuss and agree on the ideal behavior before finalizing it. Once we settle on what makes the most sense, I can go ahead and refine the logic and add clarity through comments or better variable naming.

edit: The original behavior sent (i.e with the block inside the iteration loop) was: "If all selected notes are in the same chord, and for any one of them there is no existing note to tie to, then add new tied notes overwriting the next Chord"

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.

pressing T to add tied note [outside note-input mode]

2 participants