Knowing part name and staff index at the same time. Is it possible?

• Jul 12, 2016 - 19:18

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:
examplemusescore.png

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.

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