A plugin cannot create Roman Numerals or Nashville numbers, only Chord symbols.
Reported version
3.5
Type
Plugins
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
The plugin-API allows for creating HARMONies:
harmony = newElement(Element.HARMONY);
This creates a "Chord Symbol" but not a Roman Numeral symbol or a Nashville Number symbol - you get an ordinary "Chord Symbol". The API does not expose any way to set its subtype (to RNA or NN).
Existing RNA- elements CAN be altered (change its text) and deleted - BUT not created.
It would be useful if Roman numerals and Nashville numbers had all the functionality (applicable) as Chord Symbols, including creating them from a plugin (and possibly other use cases?).
Fix version
3.6.0
Comments
You're all but one...
And this hasn't been implemented, so isn't a bug but a feature request, AKA Suggestion
Doesn't
harmony.subStyle = Tid.HARMONY_ROMAN
orharmony.subStyle = Tid.HARMONY_NASHVILLE
after creating an element already do what is intended here?:) That's exactly what I am doing (setting the subStyle) - but it seems like subStyle is a property of the HARMONY element's text and not the sub-TYPE of the HARMONY itself (subStyle and subType are different things and I haven't found a way in the API to set the subType, only view it).
I am getting Chord Symbols with text that is parsed as RN but correctly presented as such only if you double click the text.
If you right click a true RN in a score (added by hand) - you will see that MS recognizes this almost like an ELEMENT type of itself; "Roman numeral".
HARMONYs a plugin creates with subStyle HARMONY_ROMAN are unfortunately still recognized as Chord symbols - not Roman Numerals.
I haven't really tried Nashvilles that much. From the little I have done they behave like Roman numerals.
In reply to :) That's exactly what I am… by Vincent_Wong
And I used the object explorer plugin to discover that Romans and Nashville probably are subTypes:
Using
element.subtypeName = function() { [code] };
you'll get a string saying something like Roman numeral or Nashville.
(posts crossed I guess)
A code sample:
var harmony = newElement(Element.HARMONY);
harmony.subStyle = Tid.HARMONY_ROMAN;
harmony.placement = 1;
harmony.text = "bvii(43)"
cursor.add(harmony);
Ah, it looks like chord symbol type is controlled by a separate property with id
Pid::HARMONY_TYPE
which indeed isn't exposed to plugins. Then exposing it would indeed be good to do.See https://github.com/musescore/MuseScore/pull/6722.
Fixed in branch 3.x, commit 54c64e1603
fix #309285: expose harmonyType property to plugins
Automatically closed -- issue fixed for 2 weeks with no activity.