How to tell where the barlines break

• Mar 1, 2025 - 04:33

I'm not even quite sure where to start, but I'd like my plugin to know whether the barlines go all the way through the staves (i.e. from the first staff down to the last staff), or whether they are broken somewhere in the middle. Is there a property of a measure or staff that will tell me this?
Thanks in advance


Comments

Imagining we have the 'barlines' in sel = curScore.selection.elements the information is in:
sel[i].staff.staffBarlineSpan;
To identify the instrument:
sel[i].staff.part.startTrack;
sel[i].staff.part.endTrack;
sel[i].staff.part.instrumentId;

In reply to by ILPEPITO

Thanks — that was very helpful.

On a related question, how do you get the bracket down the left of a system?
It's not in the 'blue selection', and I tried: curScore.systemBracket, measure.systemBracket, staff.systemBracket and system.systemBracket, and they all return 'undefined'.

In reply to by michaelnorris

Having never thought about this particular 'object' i cannot pretend to give you an answer with absolute certainty, however the situation seems to me to be the same as that of the VBox and HBox, i.e. objects outside the 'blue selection' and not linked to the 'Segment'. Big bad deal...The objects that can still be detected (via cursor.filter) despite their absence from the 'blue selection' can be found here:
https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/names…
as you can see there are no 'brackets' (but you can detect the Ambitus... eh eh eh). I think some 'creative' solution (similar to that of 'frames') will be needed here too. Sorry for not being of help.

In reply to by michaelnorris

I think you're right. I also don't see any useful 'command' to solve the problem. The 'systemBracket' property, which allows you to distinguish the types of 'brackets' at the beginning of the staff, is present only in the object itself. Which in turn is directly linked to 'system' (its first 'parent') which contains nothing related to it. I'm sorry, but if I have any ideas I'll let you know.

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