Get ticks of selected elements
I have been working on the development of a plugin recently that generates a part of the score. For the moment I have only been using the range selection with the (quite weird to me as I don't understand this choice of implementation) cursor rewind method.
However MuseScore also has a Ctrl+click mechanic that enables to select notes individually, but I haven't found any way to access these notes... Does someone has the solution?
Also if someone could explain me the logic behind the cursor rewind, I would be grateful ^^
Thanks in advance!
Comments
This post only addresses this question:
> However MuseScore also has a Ctrl+click mechanic that enables to select notes
> individually, but I haven't found any way to access these notes... Does someone has the solution?
Soon...The ability to access selected elements will be available in v3.3. It was added as part of this request:
https://github.com/musescore/MuseScore/pull/5243
or in the nightly builds if you're so inclined.
In reply to This post address only this… by DLLarson
Thank you so much! That is a quick answer ^^
Any idea of when it could be released?
Thanks.
In current development builds, toward 3.3, curScore.selection retrieves a list of the element(s) clicked on.:
function find_usable_note() {
var selection = curScore.selection;
var elements = selection.elements
console.log(elements.length, "selections"
for (var idx = 0; idx < elements.length; idx++) {
var element = elements[idx]
console.log("element.type=" + element.type)
Plugins using it effectively start here: https://musescore.org/en/project/articulation-and-ornamentation-control
In reply to In current development… by [DELETED] 1831606
I downloaded MuseScore 3.3. beta and tried your plug-in for red notes. It worked good no mater how I selected the notes (a range selection or a collection selection). I consider this as a great improvement over the old way which really does not work good for me in version 3.2.
Finally a simple and logical way to code MuseScore plugin which walks over the selected elements! Now I might try to code some plugin.
Thank you
In reply to I downloaded MuseScore 3.3… by hstanekovic
I guess rednotes does, but the articulator doesn't. If you want blue notes, however, you need pitch adjustment :) ...
meanwhile the rewind (to score beginning, selection start or selection end) is explained in the manual of the plugin creator (hit ? button in the creator).
some code to use the rewind to treat just a portion of the Score: (careful, the two < signs have been turned into html entities :/
In reply to meanwhile the rewind (to… by berteh
The previous messages in this thread are "ancient history" in terms of 3.3 plugin dharma. Everything is up and running and published - see https://musescore.org/en/project/articulation-and-ornamentation-control and what it points to.
Did you ever get anywhere?
I couldn’t find anything, so I made one myself: https://musescore.org/en/project/show-ticks
Only tested with
3.2.3+dfsg2-8
in Debian, which has the 3.3 selection API backported. It checkscurScore.selection
though, so it should also work on older versions (untested).