ellejohara / newretrograde

A retrograde plugin for MuseScore 3.x.
GNU General Public License v3.0
0 stars 2 forks source link

Ravelitis: tuplet problems #7

Closed elsewhere37 closed 1 year ago

elsewhere37 commented 1 year ago

Sorry to always bring bad news... Music is too vast to let it be squeezed in a code-jacket

This is a measure from Ravel La Valse In Ravel.png: Measure 1 & 2 contain measure 1 content. Select the bottom staff of measure 2 & run the plugin. You get an error code: 186:-1: TypeError: Cannot read property '0' of undefined Ravel

In Ravel2.png: Measure 1 – 3 contain measure 3 content. Select the bottom staff of measure 1 & run the plugin. You get no error but the quadruplet runs over into measure2 Ravel2

ellejohara commented 1 year ago

I can't reproduce the 186 TypeError, but I do notice that the retrograde doesn't work with the pedal marking. That makes sense because it's text, and the plugin doesn't play well with text (recall the problems with the chord markings). I don't know if that's something I can fix. I'll look into it, though. The plugin seems to work just fine when I remove the pedal markings, so for now I can put in the readme that the plugin only works for notes and rests, and any attached text will cause problems.

elsewhere37 commented 1 year ago

That's fine. Feel free to close. These engraver types do funny things sometimes. I've had someone 'faking' a tremolo with thick lines... EDIT: but I do get the 186 error even if I recreate the notes without the pedal markings, but only if it is the last measure

ellejohara commented 1 year ago

Ah! Yes, I see. Running it in the last measure I get the error as well. It's no doubt that last measure bug coming to haunt me again. I will look into it.

elsewhere37 commented 1 year ago

It must have to do with See https://musescore.org/en/node/320206 Each call to cursor.addNote() or cursor.addRest() advances the cursor, by the amount set by cursor.setDuration(), except when the cursor is already at the final beat of the last measure in the score. CAUTION: They do not return false value, and do not advance.

See also my TupletFill plugin (line 95 & ff.) https://musescore.org/en/project/fill-chosen-voices-selection-chosen-tuplet

ellejohara commented 1 year ago

I figured out what the problem was. There were a couple of lines where I was using cursor.prev() instead of the much better cursor.rewindToTick(curTick) which works even in the last measure. Fixed in 3.0.5.

elsewhere37 commented 1 year ago

Great! Thanks!!