Manipulating accidentals with a plugin
I am having problems manipulating accidentals in a plugin I’m writing, and the same issues occur with the Configure Courtesy Accidentals plugin (https://musescore.org/en/project/add-and-remove-courtesy-accidentals), which I’ve been studying. That plugin and my work-in-progress both assign values to the note.accidentalType property, and they both launch from a dialog box.
Assuming the behavior I’m seeing is reproducible, I’d like to know if it’s harmless. (If not, I’ll have more questions!)
I’m using MuseScore 2.3 and previously 2.2, on Windows 8, and if anyone wants to try this for themselves they’ll need to run the Configure Courtesy Accidentals plugin in the debugger (Plugin Creator tool). My test file is attached. Other files yield similar results.
When I first run the plugin on my test file, the debugger reports “Measure::findAccidental: note note found”; I believe tied notes trigger this message. But my bigger concern is what happens if I UNDO the plugin action and then run it in the debugger a second time. Now I get a string of “AddElement::cleanup: delete Accidental” messages, seemingly one for each of the accidentals created by the plugin the first time around. The attached illustration should make things clear.
Are these deleted objects a big deal? Or, would they be if I were processing a lot more notes?
Attachment | Size |
---|---|
Accidentals_Test.mscz | 4.65 KB |
Accidentals_Test_annotation-1.png | 177.98 KB |