Access to Parts? Style settings from the Parts (etc?)

• Mar 27, 2025 - 02:10

Is there any way for a plugin to access the parts of a score in a more detailed way than just through the Part object?

For example, can a plugin switch to a part and check what the Style settings are for that part?


Comments

In reply to by michaelnorris

As far as I know, 'spatium' (like many other parameters) is part of score style settings (enum 'Sid'), not a single 'part'. And it is normally accessible like this:
var style = curScore.style;
var staffSpacing = style.value("spatium");
You can also assign a new value like this:
var newvalue = (whatever you want);
style.setValue("spatium", newvalue);
I even have the doubt that we are not talking about the same thing: by 'part' I mean the single instrument; so how can (in the same score) the value 'spatium' be different depending on the part?
Anyway, if you found what you were looking for, good for you, the problem is solved.

In reply to by ILPEPITO

No, parts DO have their own Style settings. You can check this by opening a multi-part score, looking at the 'Stave spacing' (spatium) setting for the main score, then change to viewing a part, and open Page Settings again. You'll see the spatium is DIFFERENT.

Parts have their own Score objects which you can access via excerpt.partScore, and these have their own Style settings separate from the main score.

I've verified that you can access the different settings programmatically this way.

In reply to by michaelnorris

Now I understand what you mean. 'Part' not only as a single instrument in a score with multiple instruments (e.g. a string quartet), but as an independent score extracted (in the same file) with the function offered by the program. Just understand each other, and now I know something I didn't know before (about accessing these separate scores). As I said, if you found what you were looking for, problem solved.

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