Chord Symbol Text
Is it possible to access chord symbol text from a plugin? I've been through the manual provided with the plugin creator, but cant find anything.
Thanks
Is it possible to access chord symbol text from a plugin? I've been through the manual provided with the plugin creator, but cant find anything.
Thanks
Do you still have an unanswered question? Please log in first to post your question.
Comments
I found it eventually, for anybody else that may be interested they are stored in the segment.annotations array as objects of type Harmony.
In reply to I found it eventually, for by stevel05
This gives the Root and Bass notes, how can I find the chord text please.
Thanks
In reply to This gives the Root and Bass by stevel05
OK found that too, .text property on annotations items.
In reply to OK found that too, .text by stevel05
The text is only present in annotation items when it is first entered. When the score is reloaded the text is not present.
Do I need to refresh the score somehow, or is the text actually stored elsewhere?
In reply to The text is only present in by stevel05
The text as typed by the user is stored internally in the Harmony object, but it is not the main representation used by MuseScore. Instead, that text is parsed into tokens that are then rendered according to set of layout rules defined by the selected chord symbol style in Style / General (eg, Jazz, Standard, or a custom option). Unfortunately these are internal implementations details that are not exposed to the plugin framework.
In reply to The text as typed by the user by Marc Sabatella
Thanks Marc,
I found that transposing the score and putting it back updates the text in the harmony objects, which is what I am after.
It would be nice to be able to do something similar from within the plugin, I will look at that another day.
In reply to Thanks Marc, I found that by stevel05
You could trigger the internal commands for transposing: 'transpose-up' and 'transpose-down' using the cmd() function.
In reply to You could trigger the by jeetee
Thanks jeetee, that works a treat.
I can't find any documentation for the cmd() function, are the available options related to keyboard shortcuts?
Do you know if there is any documentation available?
Thanks
In reply to Thanks jeetee, that works a by stevel05
I don't think there is currently a clear list available.
You can use all actions that have a shortcut that way, but there are more actions/commands located in the source code.
For the shortcutlist see mscore/data/shortcuts.xml and use the value of the
<key>
elements as a string argument tocmd()
In reply to I don't think there is by jeetee
Thanks jeetee