Convert TrumpetFingering (v3) to TubaFingering (v3) and omit automatic placement

• Apr 14, 2019 - 10:12

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.


In reply to 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 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 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 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 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

Attachment Size
testBeforeFingering.mscz 29.03 KB
testAfterFingering.mscz 29.07 KB
Tubafingering.qml 3.97 KB
fingering.JPG 77.98 KB

In reply to 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.

Do you still have an unanswered question? Please log in first to post your question.