How to get the current position?
I'd like to do something to the currently selected note or chord. How do I know the position of the user's cursor? The selected
property seemed to be false for every element. Oh, and I'm trying to write this for 2.0.
Comments
So, am I out of luck here?
I haven't tried the new 2.0 stuff yet, but have you tried the method documented for the current version? That is, using a cursor object as described here: http://musescore.org/en/plugin-development/cursor-object?
In reply to I haven't tried the new 2.0 by Marc Sabatella
I tried to modify the behaviour of applyToNotesInSelection so that when nothing is selected it uses the regular cursor that you get. When I select a note or multiple note with ctrl-click this does nothing, only selections by clicking and than shift-clicking seem to work.
The documentation Marc mentioned says that after getting a cursor you should rewind. But that leaves it at the start of the staff, not at the currently selected note.
In reply to I have tried in 1.3, but it doesn't work by Ruud Mulder
That sounds right. As far as I know, if you don't see a blue box, there is no selection as far as the plugin framework is concerned. It's possible this is changed in the new 2.0 plugin framework.
In reply to That sounds right. As far as by Marc Sabatella
Right, just clicking on a nore or rest doesn't constitute a selection for the plugin framework, neither for copy/paste
You can select a single cohord though: click on one note/rest, shift right to create seletion spanning 2 chords/rests, shift left to reduce to one chord/rest
In reply to Right, just clicking on a by Jojo-Schmitz
Shift click on a note of the chord is shorter and should also work.
In reply to Shift click on a note of the by [DELETED] 5
Ah, thanks!
In reply to Right, just clicking on a by Jojo-Schmitz
I find this very strange. If I select a specific number of notes using command-click on the mac I can change them but it is not seen as a 'real' selection because there is no blue box? This is not how most other software, like a file manager, works.
In case you wonder why I want to do that it is because I want to change some notes enharmonically.
In reply to Strange selection criterium by Ruud Mulder
The selection mechanism in the plugin framework seems to depend on the selection being contiguous. The only reason I can image why you'd *need* to select thngs in a way that doesn't result in a blue box is to get a discontiguous selection. So the whole idea seems not likely to work.
ApBtw, are you aware that 2.0 already has a command to toggle enharmonic spelling? Cick note, press "J".
In reply to The selection mechanism in by Marc Sabatella
And of course, 2.0 is not released yet. So Marc is talking about the development version. You can try a nightly build. See [[nodetitle:Download]]
In reply to And of course, 2.0 is not by [DELETED] 5
OK. I will try it.
As I explained to Marc in another thread I come from Logic via Lilypond to MuseScore, so selecting a number of notes, slurs and whatever and copy/pasting them is what I am used to.
I'm not whining, I think MuseScore is a great program (Logic also has its quirks and Lilypond is only for those with an affinity for programming). I'm trying to understand the idea and design behind the program to make it better.