-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added buttons for PianoKeyboard to switch between Notated Pitch (effective pitch) and Playback Pitch. #22991
Conversation
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.cpp
Outdated
Show resolved
Hide resolved
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.cpp
Outdated
Show resolved
Hide resolved
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.cpp
Outdated
Show resolved
Hide resolved
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.cpp
Outdated
Show resolved
Hide resolved
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.h
Outdated
Show resolved
Hide resolved
Co-authored-by: David Faia Nunes <[email protected]>
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.
That's looking much better already! I have a few more cleanup suggestions, but nothing fundamental!
src/notation/view/pianokeyboard/pianokeyboardpanelcontextmenumodel.cpp
Outdated
Show resolved
Hide resolved
UiAction action; | ||
action.title = title; | ||
action.code = SET_NOTATED_PITCH_CODE; | ||
action.checkable = Checkable::Yes; |
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.
Perhaps, instead of "checkable", we should use "selectable". That is not a property of UiAction but of MenuItem.
So: item->setSelectable(true)
to mark the item as selectable, and then bool selected = …; item->setSelected(selected)
to set the state.
Here I have selected C4 in the score and it is correctly highlighted as Bb3 in the piano keyboard. However, if I press Bb3 in the piano keyboard it gives me a Bb3 (actually A#3) in the score instead of C4. I would expect the "Use playback pitch" option to work for entering notes as well as for highlighting exisiting ones. |
Hello, |
It is unclear to me what remains to do with this pull request? Is it just the final code review item? |
@cbjeukendrup I am trying to revive this PR. I have rebased my branch of it (with effort) on the current master branch. It all seems to be working so far as it went, except for the problem noted in the comment above that when "Use playback pitch" is selected, it still enters the notated pitch into the score. It looks like EDIT: I figured it out. |
This pull request is now completed as #24784 |
@NathanPrazeres Thanks for your work; although it has not been merged directly, it has been included in a new PR that expands on it, and will be finished via that PR! |
Sorry for leaving this unfinished. I really haven't had time as of late. I'll glad it will be useful anyways. Thanks :) |
@NathanPrazeres, no worries! Thanks for your contribution! |
Resolves: #15594
Title describes well enough. We just added buttons in the PianoKeyboardPanelContextMenuModel class that communicate with the PianoKeyboardController class to change a boolean variable. The aim is to address a limitation in the current implementation of MuseScore's keyboard view, which struggles with differently-tuned instruments. When users click on a key, the corresponding note used to be placed on the score as notated pitch, while the equivalent standard pitch was highlighted on the keyboard UI, leading to potential confusion.