order of Sagittal accidentals in accidental.cpp and types.h
I'm trying to adapt a microtonal tuning plugin to work with Sagittal accidentals, but it seems that the plugin doesn't recognize some Sagittal accidentals, while there are also some that it does recognize and while it works fine with all other accidentals. One thing I noticed when trying to figure out why it doesn't work is that the order of the Sagittal accidentals in accidental.cpp (where they are listed by their SymIds) is different from that in types.h (where they are listed by their capitalized element names). (Those capitalized element names like "SAGITTAL_SHARP" are used in the plugin, by the way.) I was wondering whether this might be the reason why they are not recognized.
The image below shows the Sagittal accidentals in SMUFL order. (They occur in that order in the accidentals palette.) Peculiarly, the orders in both accidental.cpp and types.h deviate from this order (and in different ways).
Comments
Yes, the order in types.h is wrong, accidental.cpp and types.h need to be in sync (the order in SMuFL or sym.{h.cpp} is not relevant here though), needs to get fixed to:
See https://github.com/musescore/MuseScore/pull/7520
You can grab and try the artifacts build from that PR
In reply to Yes, the otder in types.h is… by Jojo-Schmitz
The order in accidental.cpp seems off as well. In SMUFL order sharps are listed before flats.
By the way, could this issue be the reason why sagittal accidentals aren't recognized by the plugin?
In reply to The order in accidental.cpp… by Rayosu
The SMuFL order doesn't matter
Which accidentals exactly are not recognized by your plugin?
It should really reconize them all, just for some show the wrong ones
In reply to the SMuFL order doesn't… by Jojo-Schmitz
SAGITTAL_5CD and SAGITTAL_5CU work.
SAGITTAL_FLAT5CU, SAGITTAL_SHARP5CD, SAGITTAL_FLAT5, and SAGITTAL_SHARP don't. If I replace them with other accidentals, then those work, but for some reason, these sagittals aren't recognized.
In reply to The order in accidental.cpp… by Rayosu
Can you share that plugin?
What OS are you on? If Windows (and 64-bit) you could try this artifact (similar to a development build)
In reply to Can you share that plugin?… by Jojo-Schmitz
I'm not sure how to share it, but its a plugin made by someone else. I'm just making some slight changes to ti and I'm not sure whether the original creator would object to me sharing it.
What it does, is scan a score for microtonal accidentals (that are defined in the plugin) and the retune those notes accordingly. It works perfectly with any accidental (that is, I can give any accidental a retuning value withing the plugin), except the sagittal accidentals with two vertical lines. All the sagittal accidentals with one vertical line work fine, but those with two don't.
In reply to I'm not sure how to share it… by Rayosu
I'm on Windows 10 (64 bit), but the link in your comment doesn't work, by the way.
In reply to I'm on Windows 10 (64 bit),… by Rayosu
It does for me
In reply to It does for me by Jojo-Schmitz
I get a 404 error.
In reply to I get a 404 error. by Rayosu
Can you get to https://github.com/musescore/MuseScore/pull/7520? Then to the checks, then to Ci_Windows, https://github.com/musescore/MuseScore/pull/7520/checks?check_run_id=18… and then to artifacts
In reply to Can you get to https:/… by Jojo-Schmitz
Downloading now. I will report later whether this version solves the issue.
In reply to Downloading now. I will… by Rayosu
It does not solve the issue. Other accidentals are recognized, but sagittals with two vertical lines are not.
In reply to Yes, the otder in types.h is… by Jojo-Schmitz
It looks to me like that fix still gets the order wrong.
The order in accidentals.cpp is:
accSagittalFlat25SUp
accSagittalSharp25SDown
accSagittalFlat7CUp
accSagittalSharp7CDown
accSagittalFlat5CUp
accSagittalSharp5CDown
accSagittalFlat5v7kUp
accSagittalSharp5v7kDown
accSagittalFlat
accSagittalSharp
The same order in types.h should then be:
SAGITTAL_FLAT25SU,
SAGITTAL_SHARP25SD,
SAGITTAL_FLAT7CU,
SAGITTAL_SHARP7CD,
SAGITTAL_FLAT5CU,
SAGITTAL_SHARP5CD,
SAGITTAL_FLAT5V7KU,
SAGITTAL_SHARP5V7KD,
SAGITTAL_FLAT,
SAGITTAL_SHARP,
And that's not the same as what I see there.
edit:
No. My mistake. It is correct.
But then, why doesn't it work?...
In reply to It looks to me like that fix… by Rayosu
So before the change you claimed SAGITTAL_FLAT5CU, SAGITTAL_SHARP5CD, SAGITTAL_FLAT5 (??), and SAGITTAL_SHARP to not work, and SAGITTAL_5CD (?) and SAGITTAL_5CU (?) to work, some of these don't even exist?!?
Is it still the same that do/don't?
SAGITTAL_FLAT25SU,
SAGITTAL_SHARP25SD,
SAGITTAL_FLAT7CU,
SAGITTAL_SHARP7CD,
SAGITTAL_FLAT5CU,
SAGITTAL_SHARP5CD,
SAGITTAL_FLAT5V7KU,
SAGITTAL_SHARP5V7KD,
SAGITTAL_FLAT,
SAGITTAL_SHARP,
Please share the plugin
In reply to It looks to me like that fix… by Rayosu
As far as I can they all work:
Here in revers palette order
In reply to As far as I can they all… by Jojo-Schmitz
They all "work" in the sense that you can add them to a score, but what doesn't work is their "recognition". For some of them, the plugin just doesn't "see" that they are there.
In reply to It looks to me like that fix… by Rayosu
Maybe it is an issue with the width of that
enum class AccidentalType : unsigned char
? It should go from 0 - 255, but maybe in the plugins it gets turned into justchar
, which in this case is asigned char
and so goes from -128 - 127, which makes it end atSAGITTAL_SHARP25SD
, so everything after that gets cut off?In reply to Maybe it is an issue with… by Jojo-Schmitz
I suppose I can try whether that is the exact cut off point between those that work and those that don't. I'll try.
In reply to I suppose I can try whether… by Rayosu
Yes. SAGITTAL_SHARP25SD still works. Everything after that doesn't.
In reply to Yes. SAGITTAL_SHARP25SD… by Rayosu
So a different problem than the one I (tried to) solve(d) with my PRs, not related to the (wrong) order.
Please try the new artifact from https://github.com/musescore/MuseScore/pull/7520/checks?check_run_id=18…
In reply to So a different problem thanb… by Jojo-Schmitz
It works perfectly. So whatever you fixed. That solved it.
In reply to It works perfectly. So… by Rayosu
Thanks for testing.