Is it possible to write a plug-in?
Using the "Right Arrow" button you can play the entire melody as if you were playing the piano, but if it has no pauses and tied notes. I want to use the MuseScoore to teach children the duration of notes.
Is it possible to write a plug-in to move the cursor with the "Right Arrow" button without cursor stopping at pauses and the second of two tied notes?
Comments
I don't think so
In reply to I don't think so by Jojo-Schmitz
Is it possible to solve this problem in other ways?
Currently right arrow plays notes without any difference in duration. If this is sufficient for your task and your intention is just to have a way to iterate over notes skipping rests and tied notes I believe it should be perfectly possible to do so. I am not sure whether it is possible to override a global shortcut for right arrow but it should at least be possible to show a panel which would make right arrow behave so when focused (or would contain a button which has a similar effect). If this is what is needed I could describe here possible ways to implement this, or maybe create a minimalistic plugin with this functionality so you could modify it further for your needs.
In reply to Currently right arrow plays… by dmitrio95
Yes, that’s exactly what I need. Thank you for your willingness to help! I really need to cursor not stops on pauses and the second of the tied notes. I need to cursor stops only on notes that must sound on playing.
In reply to Yes, that’s exactly what I… by arturchernysh
Well, this indeed is doable. The plugin which implements something similar is attached to this post. You can assign a shortcut to it (be it right arrow or any other key or key sequence) in Plugin Manager, so there is no need to implement any additional UI for it to work. You might need to ensure that the shortcut does not conflict with other shortcuts which are normally defined in Edit→Preferences.
As for its code, the parts which you might most likely need to modify are
onRun
which defines the main logic of plugin andskipElement
which defines criteria for skipping elements when searching for the next note to play. I left comments in the code to explain what happens in some parts of it, but feel free to ask here in case of any questions.Hope this helps!
In reply to Well, this indeed is doable… by dmitrio95
Hi Dmitrio!
Thanks for the plugin!!
If possible, make changes to the plugin code so that at the beginning of the score the cursor can be placed on the treble clef (or first pause) and begin to move further along the notes from it.
Now the plugin only works if I place the cursor on the first note. But I need to cursor jump to the first note by the first click on the plugin shortcut button.
In reply to Hi Dmitrio! Thanks for the… by arturchernysh
Hi! I have modified the plugin to work if something different from note or rest is selected as well as corrected its behavior if rest was selected. The modified version is attached below.
In reply to Hi! I have modified the… by dmitrio95
Dmitry, everything is super! Thank you very much!!! God bless you !!!
Дмитрий, всё супер! Огромное Вам спасибо!!! Дай вам бог здоровья!!!
In reply to Hi! I have modified the… by dmitrio95
I found one unpleasant feature - if I move cursor with plug-in hotkey, the program immediately switches to the "note input" mode. If later you want to select some place in the score with the cursor, you have to first exit the input mode by pressing Esc or N. This is very inconvenient - you can accidentally enter an extra note in the score and even not notice it.
Is it possible to change the code so that when moving the cursor with the hotkey, the program does not enter the "note input" mode?
Обнаружил одну неприятную особенность - если перемещать курсор горячей клавишей плагина, то программа сразу переходит в режим "ввод ноты". Если потом хочешь выбрать какое-то место в партитуре курсором, то приходится сначала выходить из режима ввода клавишей Esc или N. Это очень неудобно - можно случайно ввести в партитуру лишнюю ноту и даже этого не заметить.
Можно ли изменить код, чтобы при перемещении курсора горячей клавишей программа не входила в режим "ввод ноты"?
In reply to I found one unpleasant… by arturchernysh
Remove the following line right before the end of the file:
cmd("note-input");
In reply to Remove the following line… by Spire42
I deleted the line - it did not help.
In reply to I deleted the line - it did… by arturchernysh
Did you use the plugin manager to reload plugins after you saved?
In reply to Well, this indeed is doable… by dmitrio95
Does anyone have any ideas how to change the plugin code to fix what I wrote about?
In reply to Does anyone have any ideas… by arturchernysh
I can't tell you from the shortcut, but I can tell you Ctrl+Home will select the first clef, and Alt+Right will navigate other elements like key signatures, time signatures, etc.
In reply to I can't tell you from the… by Marc Sabatella
Thank You. But I need that the plugin hotkey to be able to move the cursor from the treble clef to the first sounding note.
In reply to Thank You. But I need that… by arturchernysh
Can you explain why, exactly? The other hotkey I mentioned does this already. Why does it need to be the same key?
In reply to Can you explain why, exactly… by Marc Sabatella
The Casio TV-300 keyboard has a learning mode. In it, you can play the entire passage if you rhythmically correctly press only one key. I want to implement this mode using MuseScore.
In reply to The Casio TV-300 keyboard… by arturchernysh
Right, and what I am saying is, this happens already once you first press Alt+Right to get started. Or click the first note/rest. So unless something physically prevents you from doing that, it seems the problem is solved. Pres Alt+Right or click to get started, and then you play the song using the plugin from there.
In reply to Right, and what I am saying… by Marc Sabatella
To return to the beginning of the passage, I click Ctrl Home. The cursor moves to the treble clef of the first measure. And in order to start play, I need to press another button one or more times until the first note sounds. It is not comfortable. Imagine that you need to play the Jingle Bells on the piano, but you have to play the first note on the saxophone.
In reply to To return to the beginning… by arturchernysh
Switching from one key to another is much simpler than switching instruments, it's trivial in comparison. Unless I'm missing something here, which is possible. But - instead of Ctrl+Home, try Rewind, which selects the first note or rest.
In reply to Switching from one key to… by Marc Sabatella
Marс, thanks for your advice, but can you help me with the plugin code to change it the way I need?
In reply to Marс, thanks for your advice… by arturchernysh
Sorry, I'm not familiar with plugin coding. so I',m trying to help you actually get the job done the best way I can - by telling you other ways to accomplish exactly the same thing.
In reply to Switching from one key to… by Marc Sabatella
One can even assign a keyboard shortcut to the “Player: rewind” command.
In reply to One can even assign a… by Spire42
Thanks for the tip!