-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
#17012: Add option to disable "Play notes when editing" if input comes from MIDI keyboard #24352
#17012: Add option to disable "Play notes when editing" if input comes from MIDI keyboard #24352
Conversation
b54300d
to
cd29427
Compare
I think we shouldn't nest this under "Play notes when editing" because that checkbox is the parent of the others below it: if you turn it off, they all turn off. You might not want to hear notes while editing but continue to hear them while entering MIDI. Also, you can hear MIDI input without actually entering notes if you have something in a staff selected, so it doesn't really fit under the category "...when editing". ![]() I'd still like @bkunda's to sign off on when he's back in next week, but here's what I would suggest:
So now, if you uncheck "Play notes when editing", only the indented settings become disabled. "Default duration" stays enabled since the MIDI setting is still on. Turning off only the MIDI checkbox affects nothing else: Turning off both disables "Default duration": Vertical spacing notes:
|
@avvvvve , If I do implement this new feature, should I update this PR or create a new one, and should I wait for @bkunda to sign off on this change? |
It seems like the two orthogonal options are The latter applies even when not "editing" as such. |
Right @wizofaus - the latter "Play notes entered via MIDI" accounts for when you're not in note input mode and just want to hear playback from your MIDI device without actually editing anything in the score. My thought was that if you have "Play notes when editing" OFF and "Play MIDI input" ON,
I know this is a step beyond the original feature request so thanks for bearing with the changes @JohnodonCode! No need to make a new PR, you can update this one. |
But what do you expect to happen if "play notes while editing" is ON and "play midi input" if OFf and you use the midi keyboard in note input mode? Based on the initial request I'm assuming MuseScore shouldn't play the notes. I'm not sure if that's what's been implemented here... |
Yes, that was the request and that's what was implemented. The design I showed above would not change the behavior implemented for this scenario. It would just allow the opposite too (hear MIDI input, but don't hear anything when clicking on notes or changing their pitch). |
But you would hear something if MIDI output was configured and connected to a device that played back the sounds?
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Ben Averill ***@***.***>
Sent: Thursday, September 5, 2024 5:51:21 AM
To: musescore/MuseScore ***@***.***>
Cc: wizofaus ***@***.***>; Mention ***@***.***>
Subject: Re: [musescore/MuseScore] #17012: Add option to disable "Play notes when editing" if input comes from MIDI keyboard (PR #24352)
But what do you expect to happen if "play notes while editing" is ON and "play midi input" if OFf and you use the midi keyboard in note input mode? Based on the initial request I'm assuming MuseScore shouldn't play the notes. I'm not sure if that's what's been implemented here...
Yes, that was the request and that's what was implemented. The design I showed above would not change the behavior implemented for this scenario. It would just allow the opposite too (hear MIDI input, but don't hear anything when clicking on notes or changing their pitch).
—
Reply to this email directly, view it on GitHub<#24352 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABI5UAJPWOIZ56TWAYA4FYLZU5QDTAVCNFSM6AAAAABNONNIIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRZHA2TEMJVGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
||
playbackController()->playElements(notesItems); | ||
if (playbackConfiguration()->playNotesOnMidiInput()) { | ||
playbackController()->playElements(notesItems); |
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.
unfortunately that function (PlaybackController::playElements) then always looks at the other preference (play notes while editing) so if you have that off, MIDI input will never play back.
Also, I double checked the code - the way it's written currently if "play notes while editing" is OFF then playback on MIDI input is effectively disabled too, regardless of whether you're in "edit"/note entry mode or not. That's an existing behaviour, you can verify with a current 4.4 build. It even affects the onscreen keyboard. |
I didn't mean the code implementation does not need to be changed, just that the "Edit On, MIDI Off" scenario currently works as expected. I'm suggesting we un-nest the MIDI preference which would require a code change. Good point that the MIDI preference should also affect whether you hear the piano keyboard, so we could change the copy to reflect that. (maybe "Play MIDI/piano keyboard panel input" though that's a mouthful...will think on it) Feel free to log the note-dragging issue as a bug... though that might be by design (I don't know the history on that). |
Changes:Note: For demonstration purposes, non-MIDI note entry will be using a mouse. If you do not see the mouse input a note, it was done via MIDI keyboard. Note Preview preferences work as suggested:2024-09-04.20-03-20.mp4Both "Play notes when editing" and "Play MIDI input" enabled:2024-09-04.20-05-14.mp4Only "Play notes when editing" enabled:2024-09-04.20-14-34.mp4Only "Play MIDI Input" enabled:2024-09-04.20-15-23.mp4Nothing will play if both are disabled. Please review @RomanPudashkin , @avvvvve , @bkunda |
I purposely named it "isMidi" because the conditional checks if midi note
playing is enabled and I didn't want to make any major changes.
…On Wed, Sep 4, 2024 at 8:39 PM wizofaus ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/playback/internal/playbackcontroller.cpp
<#24352 (comment)>
:
> @@ -310,13 +310,13 @@ void PlaybackController::setTrackSoloMuteState(const InstrumentTrackId& trackId,
m_notation->soloMuteState()->setTrackSoloMuteState(trackId, state);
}
-void PlaybackController::playElements(const std::vector<const notation::EngravingItem*>& elements)
+void PlaybackController::playElements(const std::vector<const notation::EngravingItem*>& elements, bool isMidi)
maybe call the parameter "isEditing" to match the "playNotesWhenEditing"
function, and to allow for still getting playback when using on-screen
piano keyboard even if playNotesWhenEditing is off?
—
Reply to this email directly, view it on GitHub
<#24352 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALTBUMLRCCI4UVOIPJKUYSTZU6R3DAVCNFSM6AAAAABNONNIIGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOBRGY2DANRRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
af86afc
to
68142bb
Compare
@JohnodonCode Looks good to me! Bradley will be back in on Monday so I'll remind him to give this a once-over before we merge it. Thanks! |
@JohnodonCode quick update, chatted with Bradley today and I'm going to tweak the design a bit. I may not get to it this week but I'll write here as soon as we've agreed on something! |
@avvvvve Okay. I do also want someone to review my code, as I did make a change to the |
@RomanPudashkin could you take a look at the above? The design changes I mentioned will be purely UI. The playback piece has the desired behavior already. |
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 very good! The only thing one could say is that the order of the methods is not everywhere consistent. Doesn't matter much, but if you want to strive for perfection then you could fix that. I'd follow the same order as the UI does, so
- playNotesWhenEditing
- playChordsWhenEditing
- playHarmonyWhenEditing
- playNotesOnMidiInput
- (duration where applicable)
@JohnodonCode Apologies for the delay, but after iterating more on this and taking into consideration other preferences that are being added in parallel, I've got a new design for you if you are still able to help out! Let me know if you have any questions. See this PDF for the complete details: Preferences Note input MIDI.pdf And here's a peek of the default state: |
7d76d31
to
5171eb9
Compare
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 very good already! Just a few more minor comments:
- added accessibility label - added anchors in place of height & verticalAlignment - removed redundant changes - fixed navigation row order in both NoteInputPlaySelection and NoteInputSection
@JohnodonCode Thanks for turning this around! The UI looks great. Good catch about 'Play chords when editing', we noticed that too but didn't think to split it out into a separate playback-related task. I've logged that here: #26219 (Hopefully) small UI thing that's not a blocker to merge this. When turning off "Enable MIDI input" which disables the "Play MIDI input" option, if the latter was on, the checkbox stays on in the disabled state, which could (incorrectly) suggest that the setting is on. If it's relatively simple, could we do the following? If the user checks "Enable MIDI input" off:
We could do the same for all the "child" checkboxes of the "Hear playback..." toggle when it's turned off. |
@avvvvve I have updated the UI with the requested change, see below 2025-01-24.14-49-13.mp4 |
BEAUTIFUL! Thank you so much for working with all the feedback and the different iterations of the design. It looks awesome. @cbjeukendrup mind doing one more code review? |
87cb717
to
29d112e
Compare
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.
Tested and approved! Thanks!
…ters They are already emitted anyway because of the connections made in `NoteInputPreferencesModel::load()`.
070d56c
to
5cd86a8
Compare
(That was one more push to fix a mistake I made while merging, but no retesting is needed now, the automated tests will speak for themselves :) ) |
Resolves: #17012
This introduces a toggle in the Note input configuration to disable playing notes with MIDI input. This will allow users to keep note sounds playing when manually adding a note, but disable the sound if the note is added via MIDI input.