How to play the note's sound while selecting it by the plugin?
While user selecting a note by mouse or keyboard, the MuseScore plays that note's sound.
However, if it was selected by a plugin using something like curScore.selection.select(cursor.element.notes[0])
, it does select the note but doesn't play the sound.
I tried some workarounds by using some commands in cmd()
but haven't got any results so far.
Anyone got any ideas to achieve this?
Comments
Try INPUT_STATE_SYNC_WITH_SCORE https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class…
Sorry, my previous comment doesnt work, it playback notes only during creating them.
But for select playback, commad
cmd("next-chord")
should work (it is like navigating in score)In reply to Sorry, my previous comment… by sammik
Thank you so much!!
Here is my final solution using your
cmd("next-chord")
suggestion and it worked very well and can handle any situations: