Can a plugin access on-time/off-time?
I.e., if I grit my teeth and dose up on coffee, can I write a plugin to impart a desired phrasing upon a run of notes?
I.e., if I grit my teeth and dose up on coffee, can I write a plugin to impart a desired phrasing upon a run of notes?
Do you still have an unanswered question? Please log in first to post your question.
Comments
You could check the plugin documentation at https://dmitrio95.github.io/plugins/html/index.html
But I don't this we're currently able to do this
In reply to You could check the plugin… by Jojo-Schmitz
WOW! I did not know about this. It says that offTimeOffset is indeed available and settable. If it's not lying, there is very great potential here, and the Piano Roll Editor might be looking for a job in a bar of the other kind ...
Thanks so much!
In reply to WOW! I did not know about… by [DELETED] 1831606
The documentation seems to presumptuous.
It was generated based of the C++ header: https://dmitrio95.github.io/plugins/html/note_8h_source.html which indeed has that function, but not as a QML-exposed item as far as I can see..
In reply to The documentation seems to… by jeetee
Yup, just figured that out. That's a shame. If that were exposed, musicianship would become four times easier here. Oh well. Thanks.
In reply to Yup, just figured that out. … by [DELETED] 1831606
Why is the fraction of functions and properties of MS objects exposed so minuscule? Is the idea to discourage plugins?
In reply to Why is the fraction of… by [DELETED] 1831606
It's just been an underloved part of MuseScore in v2.
The internal changes of v3 broke a lot of things internally, including nearly the (very limited) complete plugin framework. Slowly dmitrio95 is, with the help from some contributors, re-enabling the v2 stuff and newer properties.
As far as I'm aware there is nothing blocking pretty much full exposure of all functionality and properties besides someone having to put in the time to do so.
In reply to It's just been an underloved… by jeetee
If we could have off-time exposed, the extant ability to select all the notes in a voice in a staff, or within a selection so narrowed, would allow the instant re-articulation of whole instruments, passages, runs, etc., and with a little more plugin-UI, pairs/triplets etc. What a boon that would be to every musician using this program!
In reply to Why is the fraction of… by [DELETED] 1831606
The idea is to get you motivated to turn into a MuseScore developer and implement the rest ;-)
In reply to The idea is to get you… by Jojo-Schmitz
It has crossed my mind ....
In reply to It has crossed my mind .... by [DELETED] 1831606
Could you explicitly state what values you want exposed in a non-fuzzy way?
I'd like to take a look at it since I've been on a plugin api roll lately.
-Dale
In reply to Could you explicitly state… by DLLarson
Well, I guess I had to trim my beard, but....
of "Note:", setOnTimeOffset(int), setOffTimeOffset(int) at bare minimum, but there are no corresponding accessors to retrieve the int value, and it'd be nice to have (one should be able to get what one wishes to set). I don't know if setOffTimeType(int) and setOnTimeType(int) are needed --- the header file note.h says that it's compatibility (1=user, 2=offfset%) obsolete)? Do you know?, but, oddly, there are accessors for them, int offTimeType(), int onTimeType(). % probably means per mille, I'd bet.
Thanks!
In reply to Well, I guess I had to trim… by [DELETED] 1831606
Hi,
>Well, I guess I had to trim my beard, but....
The actually took a moment to sink in! Well it's probably good to see what's under there on occasion.
I have the onTimeOffset and offTimeOffset values exposed in QML now.
With regard to the offTimeType and onTimeType, I don't see those values used anywhere in the code except for what looks like file load code:
https://github.com/DLLarson/MuseScore/blob/master/libmscore/read114.cpp…
This might be for loading (and saving?) v1.1.4 file formats but I'm not near familiar enough with the overall program to know.
I don't think it'll be useful exposing those values.
I tested this by doing simple sets and gets in a QML script and all seems well.
On Console:
Debug: Before: note.onTimeOffset=0
Debug: Before: note.offTimeOffset=1000
Debug: After: note.onTimeOffset=100
Debug: After: note.offTimeOffset=990
That really doesn't mean much though. Is there a way I can get you a test version MuseScore3 test to see if it's really as useful as you hoped. I'm not really affiliated with the MuseScore organization.
For now my changes are on my fork of MuseScore here:
https://github.com/DLLarson/MuseScore/tree/add-onoff-time-props
Oh, I'm running on Windows if that matters.
-Dale
In reply to Hi, >Well, I guess I had to… by DLLarson
That read114() is indeed for reading MuseScore 1 scores
In reply to Hi, >Well, I guess I had to… by DLLarson
This is great! I'm running Mac, so a Windows build will not help me (nor am I willing to set up and debug the build environment).
The most apparent tests would be (1) interaction with the piano roll editor -- if you can grab a note in the plugin, set its off-time to 500, and look at it in the piano roll editor and see if it's indeed been halved , and see if the plugin sees changes made in the PRE, and (2) see that plugin-offtime-modified notes indeed play that way, e.g., 500 off-time = staccato.
In reply to This is great! I'm running… by [DELETED] 1831606
>in the piano roll editor
Where might I find that in the program. I'm not very experienced user of the program.
-Dale
In reply to >in the piano roll editor… by DLLarson
Never mind. I found it.
In reply to >in the piano roll editor… by DLLarson
https://musescore.org/en/handbook/3/piano-roll-editor
In reply to https://musescore.org/en… by [DELETED] 1831606
The essence of my need is to allow a plugin to manage off-time("Len", almost, in the PRE) in a more streamlined way than the PRE (in which i am now proficient, but it's all a half-way measure).
In reply to The essence of my need is to… by [DELETED] 1831606
You have to know what a note whose "length"/off-time has been adjusted sounds like. That's the point of my need. Enter some notes on a non-percussive instrument (e.g., violin, oboe, but not piano or harp), listen to how it sounds on playback, go into the PRE and change the lengths to 500 or 700 and listen again. If you can make a plugin that makes that change, we are set.
In reply to You have to know what a note… by [DELETED] 1831606
What's a "PRE"?
In reply to What's a "PRE"? by DLLarson
PRE = Piano Roll Editor
In reply to You have to know what a note… by [DELETED] 1831606
The script changes are indeed reflected in the piano roll.
Here's the test score. (The comment about undo's is addressed later in this post.)
The script:
The result:
Debug: Found a Chord
Debug: 0: Before note.onTimeOffset=0
Debug: 0: Before note.offTimeOffset=1000
Debug: 0: After note.onTimeOffset=250
Debug: 0: After note.offTimeOffset=750
Debug: Found a Chord
Debug: 1: Before note.onTimeOffset=0
Debug: 1: Before note.offTimeOffset=1000
Debug: 1: After note.onTimeOffset=0
Debug: 1: After note.offTimeOffset=500
However, note that the undo facility doesn't recognize the change so you can't easily back it out.
It also appears that the piano roll editor may have an undo stack that is different from the main program.
I raise this concern because I ported forward some v2.0 properties to 3.0 and the "setX" operations were rejected during the commit review for this very reason. I fear the same outcome may result in this case as well. The undo problem will need to be solved.
https://github.com/musescore/MuseScore/pull/5162
The undo system seems almost mystical to me since I don't see an undo layer everything passes through (it must be there somewhere.)
-Dale
In reply to The script changes are… by DLLarson
You don't have the whole PRE frame there -- did the changes show up properly in the "OnTime" and "Length" slots that are cut off in that image? How do the Inspector changes to Velocity get undo-stacked? I know that the changes made by the TempoChange plugin can be Undo-ne.....
In reply to You don't have the whole PRE… by [DELETED] 1831606
How's this one?
In reply to How's this one? [inline… by DLLarson
No, I see 0 and 1000 --- click on one of the notes you've modified, should turn yellow, and see what OnTime and Len say and let's see.
In reply to The script changes are… by DLLarson
To make a command undo-able start it with
curScore.startCmd();
and end it with
curScore.endCmd(false);
In reply to To make a command undo-able… by mike320
I'm not sure where this belongs. Seems to be it should be in the C++ code. I did add the calls to my test QML like so:
and ran the plugin (in the plugin creator) but neither of the undo buttons (main app or piano roll editor) reflected the change.
-Dale
In reply to I'm not sure where this… by DLLarson
It sounds like you and @mike320 can figure it out from commands that do this effectively ...
In reply to I'm not sure where this… by DLLarson
he said :"endCmd(false)", not what you have.
In reply to he said :"endCmd(false)",… by [DELETED] 1831606
Good catch but it didn't change the results.
This isn't surprising because in the the C++ code that's the default argument value if not specified.
In reply to I'm not sure where this… by DLLarson
In the plugin api C++ code...
Whatever dock type plugins are. I don't think my test QML is one of those.
-Dale
In reply to In the plugin api C++ code… by DLLarson
Query for the MuseScore community....
Is there any documentation of the undo system in MuseScore 3?
-Dale
In reply to Query for the MuseScore… by DLLarson
None I know of
In reply to None I know of by Jojo-Schmitz
So do you know what "dock plugin" is, or why these two calls might not be working for DL?
In reply to In the plugin api C++ code… by DLLarson
del
In reply to Surely @jojo or someone here… by [DELETED] 1831606
I just put the undo question in a separate topic found here:
https://musescore.org/en/node/291519
-Dale