-
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
Show playing notes on the piano keyboard #21874
base: master
Are you sure you want to change the base?
Show playing notes on the piano keyboard #21874
Conversation
52998ac
to
5ea4a62
Compare
rebase needed |
Any progress on getting this merged? I really want this feature. As a pianist, it would really help me to visualize and understand the music written. |
5ea4a62
to
c293fed
Compare
Done. I've also changed the source file headers of new files to MuseScore Studio (20dd58e). Please check if it's correct. |
I guess the MuseScore team is busy with more important issues, so it may take some time until they get into this one. In the meantime, you can test this PR using these builds: |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Yes, now it works! I can see the notes in the score being played on the keyboard now! Thank you! I can finally see my beautiful harmonies! Hopefully this gets added to the real app soon... Here's some little nitpicks:
Either way, overall in it's current form it's still very good and much, much better then not being able to see anything at all. I think it's in about the same state that I remember it being in Musescore 3. |
|
MidiInputOutputController in the notation module will listen to events coming from the synthesizers and knowing the track ID is necessary to check whether it's the metronome or a chord track.
Modules outside framework can listen to these channels to receive note MIDI events, for example to output them to MIDI devices or to show the playing notes on the piano keyboard.
There must be a special synthesizer to handle note MIDI events so that they can be sent to MIDI devices even when using synths such as MuseSamplerWrapper. The MIDI events are sent through the channels in PlayerHandler because they're going to be sent to devices by the notation module which has access to track information.
Use the MIDI output synthesizer together with the synthesizer which is used to play audio.
The note MIDI event channels can now be used to easily implement this feature. Edge cases such as removing an instrument while playing are handled too.
c293fed
to
ef79184
Compare
I can split the changes into multiple PRs to fix #23054 first, if needed. |
This PR needs a proper review, and potentially some further investigation, by @RomanPudashkin, because it makes changes to the audio engine that may affect performance. Unfortunately this will likely take some time due to other competing demands on his work slate at the moment. Thank you for your understanding and patience! |
Resolves: #14428
Resolves: #23054
The current implementation of MIDI output isn't very elegant. FluidSynth, which is used only with MS Basic, is used to send MIDI events to MIDI output devices. That means using e. g. Muse Sounds will disable MIDI output completely.
It was therefore necessary to add a special synthesizer which handles MIDI output and nothing else (no audio playback). This synthesizer is always active, even if Muse Sounds or VST is used. The MIDI events aren't, however, sent to MIDI devices from the synthesizer, but instead sent through a channel in
PlayerHandler
so that any module outside framework can listen to note MIDI events.There's a
MidiInputOutputController
class in the notation module which currently only handles MIDI input. Because of the class name, it makes sense to handle MIDI output there too. To avoid sending MIDI events of muted mixer channels (#18389), it was necessary to make synthesizers aware of track ID so that the special MIDI output synthesizer can send MIDI events with the track ID. The track ID is then used to get the mute state of the channel.The visualization of notes on the piano keyboard is implemented using the MIDI event channels too.
Please note:
FluidSequencer
is sufficient. MaybeFluidSequencer
could be moved out of FluidSynth to be a common sequencer for these two synthesizers.playingNotesRevoked()
channel could be used).