Warning for the new version of Musescore
If you have a lot of plugins, I suggest making a copy of the file 'config.json'
C:\Users(username)\AppData\Local\MuseScore\MuseScore4\extensions\ -> config.json (WINDOWS)
/home/(username)/.local/share/MuseScore/MuseScore4/extensions/ -> config.json (LINUX)
before loading Musescore 4.5. To make sure that the new version can read it, you should replace all instances of "muse:\/\/
with
"musescore:\/\/
otherwise it creates a new one and you will need to re-enable all plugins.
Comments
Does it break other things? Some of my code no longer seems to work....
In reply to Does it break other things?… by michaelnorris
It shouldn't break more than 4.4 broke already
In reply to It shouldn't break more than… by Jojo-Schmitz
OK, it's mostly all fine, but it now seems to return Element.SLUR_SEGMENTs rather than Element.SLURs — and a SLUR_SEGMENT's spannerTick property always seems to return 'undefined'. I'm going to try and find out how to determine the beginning and end of a SLUR_SEGMENT.
In reply to OK, it's mostly all fine,… by michaelnorris
Incidentally, I had reported the problem here...
https://musescore.org/en/node/373273
It doesn't seem to me that in a blue rectangle selection you can find the SLUR_SEGMENT: just like before this Element is only accessible through individual selection. For the Tie element there is no problem, you can get the beginning and end from the firsTiedNote and lastTiedNote (or even tieBack and tieForward) properties of the Note element, for the Slur element at the moment I can't think of anything, I'll think about it... But I'm rather pessimistic.
In reply to Incidentally, I had reported… by ILPEPITO
Actually, the blue rectangle selection ONLY seems to return SLUR_SEGMENT in MS 4.5 — no SLUR objects are accessible any more. If only there were some way to get the SLUR object from a SLUR_SEGMENT — in the MS code base, there is a callback slurSegment.slur() which returns the underlying SLUR object, but that doesn't seem to be exposed to the API.
In reply to Actually, the blue rectangle… by michaelnorris
By the way, the same deal occurs with HAIRPINs — these are now being returned as HAIRPIN_SEGMENT in MS 4.5, and again, you can't get their spannerTick
In reply to By the way, the same deal… by michaelnorris
You're right, by golly! I assumed that in Musescore 4.5 there were no differences... now instead in the blue rectangle you have SLUR_SEGMENT. But what a nice surprise! This is good news (you can access the offsets, I can guarantee it because I just checked it); the bad news is that spannerTick(s) has totally disappeared from the properties. Maybe they will reappear in the next version... eh eh eh. I want to ask you a question: does it seem serious to you that a program can evolve in this way? Personally, I am seriously reconsidering going back to 3.6.2.
Moving on to your problem, I would solve the problem by learning to analyze mscx files, or trying to establish relationships between page sizes and positions, but it is certainly a complex and not always reliable system... I don't know what else to tell you.
In reply to You're right, by golly! I… by ILPEPITO
Thanks — it seems like there is probably a simple enough fix somewhere in the API — but I'm not sure how we get access to the current developers, what is the correct mechanism for logging bug reports related to the API?
In reply to Thanks — it seems like there… by michaelnorris
There is a forum dedicated to bugs, I don't know if this is the most suitable place... perhaps Jojo-Schmitz if he notices this post will be able to answer you more precisely.
In reply to There is a forum dedicated… by ILPEPITO
I wonder if the issue could be resolved in spanner.cpp, specifically the property delegate method?
EngravingItem* SpannerSegment::propertyDelegate(Pid pid)
{
switch (pid) {
case Pid::PLAY:
case Pid::COLOR:
case Pid::VISIBLE:
case Pid::PLACEMENT:
case Pid::EXCLUDE_FROM_OTHER_PARTS:
case Pid::POSITION_LINKED_TO_MASTER:
case Pid::APPEARANCE_LINKED_TO_MASTER:
return spanner();
default: break;
}
return nullptr;
}
All the properties listed above return valid entries to the plugin, plus the slur-specific ones mentioned in slurtie.cpp — but none of these handle the Spanner properties. I feel like if we could somehow handle the basic spanner properties in this method as well, that would solve our problems (and also give us access to the SlurSegment properties such as offsets)?
In reply to There is a forum dedicated… by ILPEPITO
I've tried logging an issue in GitHub. I don't know what the chances are of it being resolved.
In reply to I've tried logging an issue… by michaelnorris
Mind to share the link of the GitHub issue here?
In reply to Mind to share the link of… by Jojo-Schmitz
https://github.com/musescore/MuseScore/issues/27204
In reply to Mind to share the link of… by Jojo-Schmitz
I've never compiled the MuseScore source code before, but I'm planning to try it, in order to see whether making the following edit in spanner.cpp (adding the spannerTick and spannerTicks properties) would fix the bug:
EngravingItem* SpannerSegment::propertyDelegate(Pid pid)
{
switch (pid) {
case Pid::PLAY:
case Pid::COLOR:
case Pid::VISIBLE:
case Pid::PLACEMENT:
case Pid::EXCLUDE_FROM_OTHER_PARTS:
case Pid::POSITION_LINKED_TO_MASTER:
case Pid::APPEARANCE_LINKED_TO_MASTER:
case Pid::SPANNER_TICK:
case Pid::SPANNER_TICKS:
return spanner();
default: break;
}
return nullptr;
}
In reply to I've never compiled the… by michaelnorris
Best wishes... I'll add a detail that I noticed only now (I've never used spannerTick(s), so I didn't realize the matter before): just as the offsets in this type of elements are only available in their _SEGMENT version, for spannerTick(s) exactly the opposite is true, and this already from Musescore 3.6.2 (As soon as it occurred to me, I checked it). These, like other properties, are only virtually present in the object, but do not contain the information. In version 4.5 apparently spannerTick(s) has been eliminated, so it does not even appear virtually. Feel free to make your own considerations on all this...
In reply to Best wishes... I'll add a… by ILPEPITO
Thanks. The way I understand the source code of MuseScore (though I could be wrong), the SpannerSegment class inherits properties from the Spanner superclass (including tick and ticks). But it seems like those very properties of the Spanner superclass are then not being exposed in the API, because the SpannerSegment is not passing on the properties of spannerTick and spannerTicks to its superclass.
In reply to Best wishes... I'll add a… by ILPEPITO
I've just downloaded and built my own development version of MuseScore and tried my fix to spanner.cpp — it works perfectly! I'll make an official fork following the MuseScore guidelines and upload my fix, and hopefully get it into MuseScore 4.5.1
In reply to I've just downloaded and… by michaelnorris
Way to go!
In reply to I've just downloaded and… by michaelnorris
Yes, very well, and also good to know. However, I doubt that all the problems of the new version can be solved like this... In any case, I congratulate you.
In reply to Yes, very well, and also… by ILPEPITO
FYI, this fix should be coming in MuseScore 4.5.1
In reply to FYI by michaelnorris
The version with spannerTick(s) is out...congratulations!
In reply to The version with spannerTick… by ILPEPITO
Yup, using it now.
In reply to By the way, the same deal… by michaelnorris
Page positions and element sizes, I mean...
In reply to Page positions and element… by ILPEPITO
Ugh, no thanks!