How to tell where the barlines break
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 Imagining we have the … by ILPEPITO
I forgot, for a 'blue rectangle selection' you will need to set the cursor.filter appropriately:
cursor.filter = Segment.BarLineType;
In reply to Imagining we have the … 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 Thanks — that was very… by michaelnorris
This post seems to suggest that there's no way to get a reference to any brackets/braces on the score — https://musescore.org/en/node/323697
In reply to This post seems to suggest… 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 Having never thought about… by ILPEPITO
Yes, that would be good, but unlike the creative solution I developed for frames — by inserting a frame then doing select similar — I don't think there is a command to insert a bracket. At least none that I can see in the list of valid commands at https://github.com/calculuswhiz/musescore-utils/blob/master/ValidComman…
In reply to Yes, that would be good, but… 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.