Convert TrumpetFingering (v3) to TubaFingering (v3) and omit automatic placement
I had a peek into TrumpetFingering. Though I have no experience in this scripting language I found it quite straight forward. Thus I have been able to adapt it for B-Tuba in C-Notation. I've also changed the text.offsetY to 10 to get the text beeing displayed underneath the notes. But this only honored if automatic placement isn't active. Therefore I have to select all created text and uncheck automatic placement in the inspecteur. Knowing the right spell it should be easy to do this directly with the plugin by adding this property for the text. Please help with this instruction.
Comments
AKAIK en/disable autoplacement is not (yet) exposed to the plugin framework
In reply to AKAIK en/disable… by Jojo-Schmitz
Is position exposed? If it is then changing the position to below should be a start.
In reply to Is position exposed? If it… by mike320
I don't think it is
Check https://dmitrio95.github.io/plugins/html/index.html
Edit: it is,
Placement.ABOVE
andPlacement.BELOW
autoplace
is too BTW.In reply to Is position exposed? If it… by mike320
So, to be clear, the correct solution is to change placement and leave offset alone and leave autoplace enabled.
In reply to So, to be clear, the correct… by Marc Sabatella
With brass fingerings, it may be desirable to have them lineup and that would mean disabling auto placement might be the best route to achieve this. It leaves the plugin programmer the challenge of doing the math to make this look right though so no fingerings overlap existing notes (like the B below the staff and lower). It also poses the challenge of not having them run into the staff below also.
In reply to With brass fingerings, it… by mike320
Even so, disabling autoplace would not help - it makes the problem harder, because now nothing aligns by default. Right now, completely aligning fingerings would be tricky no matter how you slice it because the placement is per note. If the goal is perfect alignment, I'd use staff text instead of fingering, and then simply choose a large enough offset to avoid collisions - and if you do that, again, it works perfectly fine without disabling autoplace.
In reply to So, to be clear, the correct… by Marc Sabatella
I'm not sure that I got it right. Does the statement "the property is not yet exposed to the plugin api" still hold or is there anything I could change in the plugin's code right now?
In reply to I'm not sure that I got it… by SlyDr
It does not hold. See the other response above, it shows exactly how to access the placement property (which you definitely want) as well as autoplace (which I still say you don't).
In reply to It does not hold. See the… by Marc Sabatella
At first it seemed to function quite well. I have simply added the line:
text.placement = Placement.BELOW;
and indeed the fingering appeared below the notes.
But afterwards I wanted to have more space and went to Style::Max. System distance.
With increasing the value the placement property gets lost and the fingering moves above the line again. Is there a cure for this effect, too?
In reply to At first it seemed to… by SlyDr
Do you mean, after running the plugin, changing that setting via the dialog box affected the placement of elements already set? That shouldn't happen. Can you post a sample score with the plugin already run, and then we can try changing the style setting ourselves to see if we can reproduce?
EDIT: wait, also, does it also reset on save? If so, it could be a matter of the UNSTYLED flag needing to be set in the property. Not sure if that's exposed to the framework or something that should be happening internally.
In reply to Do you mean, after running… by Marc Sabatella
I have reproduced my finding. Then I applied the plugin to the original score and saved it before adjusting the settings. Oddly the saved score looks weired after reload.
I have attached
a) the original score
b) the score after using the plugin
c) the plugin
d) how it lookes when I reload the score I saved after using the plugin
In reply to I have reproduced my finding… by SlyDr
So, I can see after running your plugin that indeed, the placement property was not set to NOSTYLE. This is apparent because for instance, in the Inspector, the reset button doesn't become active. I know that is why it doesn't survive save/reload, but I don't know the right thing to do about it. In the MuseScore code, any time we take set a property that was at the default value for the style and explicitly set to it a different, we have to mark the property UNSTYLED. As I said, I'm not sure if that's exposed to plugins or if it's something that should be handled automatically.