Knowing part name and staff index at the same time. Is it possible?
While parsing staves, how can I know which part the current staff belongs to?
Or otherwise: while parsing parts, how can I access their staves?
I ask this because Part Objects have the partName property, but no nstaves property, while Cursor Objects can tell me the current staff (staffIdx) but not the current part.
As an example of what I have to do, consider a plugin writing to the console the name of the part, the index of the staff and the index of the voice for each non-empty voice.
Score:
Desired output:
Soprano - Staff 1 - Voice 1
Piano - Staff 2 - Voice 1
Piano - Staff 2 - Voice 2
Piano - Staff 3 - Voice 1
Comments
Have a look at how my Parsons Code Exporter lists the instruments/staff. A part has a startTrack and an endTrack. Each staff consists of 4 tracks (one for each voice), even when those voices are empty.
See specifically this line within the fillDropDowns function.
In reply to Have a look at how my Parsons by jeetee
Thanks, I had completely missed the startTrack and endTrack properties.
So, I can parse the parts (getting the name) and access the tracks between startTrack and endTrack.
Got it, thanks to jeetee's contribution
https://raw.githubusercontent.com/ChromaticIsobar/MusescorePlugins/mast…