Skip to content
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 #280365: holding shift and entering notes with piano doesn't form chord #4473

Merged

Conversation

jthistle
Copy link
Contributor

@anatoly-os anatoly-os merged commit 6e365e2 into musescore:master Dec 23, 2018
@ericfont
Copy link
Contributor

just an FYI, this commit seems to cause problem described in https://musescore.org/en/node/280715#comment-881692

And also fyi, you should have tested for cr to be non-NULL before dereferencing it...it cased a separate crash, which I've fixed in a separate pending PR: #4508

Note* n = toChord(cr)->findNote(ev.pitch);
if (n) {
deleteItem(n->tieBack());
deleteItem(n);
Copy link
Contributor

Choose a reason for hiding this comment

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

this line deleteItem(n) is what causes problems with https://musescore.org/en/node/280715 as far as I can tell. Removing it fixes that problem, while still allowing me to hold shift and enter notes with piano to form chord. I'm trying to figure out the reason why you would delete the actual previous note...

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe you meant to delete something else here related to the note? But I can't seem to figure out a reason why delete the note. I'm submitting a PR to remove this line...

Copy link
Contributor

Choose a reason for hiding this comment

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

I see...I believe you wanted to prevent the situation of having multiple noteheads for identical pitches appear in the same chord. In that case, this deleteItem(n) should only happen if that n is in the same chordRest as being inputted currently (which happens when shift is held down, but is not the case when shift is not held down).

Copy link
Contributor

@ericfont ericfont Dec 28, 2018

Choose a reason for hiding this comment

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

I'm only going to delete that note if Shift is held. I think that is the intended behavior.

Hmm...not quite right....let me look closer....

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I figured it out...PR emminent.

Copy link
Contributor

Choose a reason for hiding this comment

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

and here is my PR: #4510

@jthistle might want to review:

ericfont pushed a commit to ericfont/MuseScore that referenced this pull request Dec 28, 2018
A prior PR musescore#4473 (holding shift and entering notes with piano doesn't form chord) broke the ability to input identical midi pitches sequentially.  That was because that PR did handling to ensure that identical pitches weren't inputted into the same chord by deleting the currently-existing note that had the same pitch.  That deleting makes sense if user is holding Shift while inputting in the virtual midi piano keyboard, but that deleting doesn't make sense if user wasn't holding Shift.

My commit only deletes the note if the Shift key is held.  There is also an addition step to check if there are any remaining notes in the last segment of the input state, because if that deleted note was the only note in the chord, then it's deletion would have meant there is no longer a chord.
ericfont pushed a commit to ericfont/MuseScore that referenced this pull request Dec 28, 2018
A prior PR musescore#4473 (holding shift and entering notes with piano doesn't form chord) broke the ability to input identical midi pitches sequentially. That was because that PR tried handling to ensure that identical pitches weren't inputted into the same chord by deleting the currently-existing note that had the same pitch.  That deleting was problematic for a few reasons discussed in chat...

This fix keeps the code simple by not worrying about deleting when input the same pitch via Shift + midi input.
ericfont pushed a commit to ericfont/MuseScore that referenced this pull request Dec 28, 2018
A prior PR musescore#4473 (holding shift and entering notes with piano doesn't form chord) broke the ability to input identical midi pitches sequentially. That was because that PR tried handling to ensure that identical pitches weren't inputted into the same chord by deleting the currently-existing note that had the same pitch.  That deleting was problematic for a few reasons discussed in chat...

This fix keeps the code simple by not worrying about deleting when input the same pitch via Shift + midi input.
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.

None yet

3 participants