Accessing Ties in a Plugin
Is there a way to detect ties and then set their colour?
It would save me manual effort for this type of formatting:
Is there a way to detect ties and then set their colour?
It would save me manual effort for this type of formatting:
Do you still have an unanswered question? Please log in first to post your question.
Comments
A
Note
has atieForward
property: API docsAnd since a Tie is an Element, you should be able to use its
.color
property.In reply to A Note has a tieForward… by jeetee
Thanks, that sounds good as I should be able to pick up the colour from the tied-from note.
In reply to A Note has a tieForward… by jeetee
What does the tieForward value actually mean? How do I then use it?
Example:
Gives:
Debug: Tie Forward: Ms::PluginAPI::Tie(0x14617270)
But how do I use this 0x14617270 value?
In reply to What does the tieForward… by yonah_ag
Take it as a truth value, I guess
In reply to What does the tieForward… by yonah_ag
Or as (the pointer to) an element, that you'd now change the color on?
In reply to Or as the pointer to an… by Jojo-Schmitz
I tried adding .color but that was invalid so it doesn't appear to an element.
I guess it is some sort of pointer because it's a slightly different value for each tie.
In reply to I tried adding .color but it… by yonah_ag
I'm a babe in the woods at this, but FYI:
There is also a note property: firstTiedNote
https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class…
says:
The first note of a series of ties to this note.
This will return the calling note if there is not tieBack.
In reply to I'm a babe in the woods at… by elsewhere
Does it return a note object or a pointer?
My element.notes[0] should also be returning a note, and this to be confirmed by being able to reference its tieForward property. Then I get stuck because I don't know how to use the pointer that this property seems to be.
In reply to What does the tieForward… by yonah_ag
The debug log shows you the element type and the address value for the wrapper element from it.
You can use it as a truthy value to see whether it exists or not and you can also use the object directly to access the element.
Check out this slightly modified walk.qml which also shows the tieForward color and the score used to test it with.
In reply to The debug log shows you the… by jeetee
Thanks, that's exactly what I needed. I am now able to set the tie's colour.
In reply to The debug log shows you the… by jeetee
Is the tie line type available in the plugin api? I want to set it to dashed.
In reply to Is the tie line type… by yonah_ag
When in doubt, try it out
lineType
orlineStyle
seem plausible candidates.In reply to Is the tie line type… by yonah_ag
Found it: .lineType
Our posts over-lapped. I found the api documentation and spotted lineType.
0 : Continuous
1 : Dotted
2 : Dashed
3 : Wide Dashed