New Retrograde plugin does not handle tpc (tonal pitch class)
https://musescore.org/en/project/new-retrograde
leading to potential sharp/flat errors.
Note: (I'm pretty sure that) tpc of chord notes needs to be set after addNote
EDIT: See: [#28530 Plugins cannot add chords and can add notes only in very limited ways ]
Comments
the plug in also resets the string data of Guitars etc ( if a note was on an higher fret on the 2. string the retrograde resets it to the 1. string)
Probably best to report either in https://musescore.org/en/node/add/project_issue?pid=301721 or, probably better, in https://github.com/ellejohara/newretrograde/issues/new
In reply to Probably best to report this… by Jojo-Schmitz
I posted here because the project issue page says:
"For support requests or potential bug reports, please post in the forum."
and github asks for a password... (that I don't have)
In reply to I posted here because the… by elsewhere
Yes, on GitHub an account is needed. It is free...
But maybe reporting it here is sufficient, although doing ot there will notify the author
In reply to Yes, on GitHub an account is… by Jojo-Schmitz
Done!
Hey, all! The developer here...
I have updated the plugin to include TPC values. Accidentals should behave properly now when running the retrograde on a selection.
Let me know if it's still being weird. Hopefully it's fixed, though.
Cheers!
ellejohara
In reply to Hey, all! The developer here… by ellejohara
Hi,
The new plugin has issues with chords esp. in the lower staff. See attached.
If I select the top staff or both staves of measure 1 I get results in measures 2-3. Note no change in the bottom staff.
If I select the bottom staff of measure 1 I get results in measures 4 & a TypeError
retrotest.mscz
EDIT: these problems stem in part from your changes in the 30/5/21 version. See Oldretrotest attached.
Bottom staff not changed when both selected also an issue there, but top staff is correct, and selecting the bottom staff only gives a tpc problem
Oldretrotest.mscz
EDIT2: another minor issue, but probably easy to fix, is that your code only looks at notes in voice 1, and thus leaves notes in other voices in place
EDIT3: Found the main bug affecting chords. See Lines 99,118,123 in attached. Dealing with multiple staves & voices I leave up to you.
EDIT4: found yet another bug: if the selection starts with a triplet the retro is wrong. In tripletbug attached measure 2 is the plugin applied to measure 1 content -> error; measure 4 is the plugin applied to the measure 3 content -> correct
tripletbug.mscz
EDIT5: another bug: if the selection is the last measure of a score the plugin says: "Nothing selected". See my comment at https://musescore.org/en/node/334491 for an explanation and a cure.
In reply to Hi, The new plugin has… by elsewhere
Your bugfix works to correct chord retrogrades (retrotest.mscz) and I didn't get any type errors or tpc errors with the corrected code, so I'll include that change and a credit to you in the release notes. It's still being weird with the last measure, so I'll look into that. I'll also work on fixing the triplet bug. Multiple staves and voices I'll save for later, and just make a new note in the readme that people will have to retro one voice/staff at a time.
I'll try to get a new version out before the end of the year.
In reply to Your bugfix works to correct… by ellejohara
I notice that the notenames.qml plugin does not have the "nothing selected" problem if you select the last measure. You might find inspiration there.
EDIT: For the triplet bug , a fun fact to know might be:
"no cursor segment in tuplets"
but I don't remember where I picked this up...
EDIT2: The previous CorrectedRetrograde still has problems. In a score without chords (see test.mscz) there is one cursor.next too many. Taking out line 105 & 107 solves it (see attached qml)
test.mscz (Select c-a in the right hand)
EDIT3: putting effort in allowing selection of multiple staves and voices might not be worth it, since you can select 1 stave and also 1 voice (with the F6 selection filter), and that works
Version 2.0 of New Retrograde is now available on my GitHub page. Now it can properly retrograde tuplets, multiple staves, and multiple voices. It also seems to work in MuseScore 4, though I haven't done extensive testing.
In reply to Version 2.0 of New… by ellejohara
Many thanks. Your code is very 'elegant' and I learn a lot from it...
In reply to Many thanks. Your code is… by elsewhere
There is still something wrong:
1. Run NewRetrograde on test.mscz with everything selected: left hand is not reversed.
2. Run MyRetrograde (containing the suggested fixes (if(cursor.tick == 0) cursor.rewind(1)) on test.mscz with everything selected: everything looks fine.
3. Select measures 2-4 (both staves): left hand is not reversed with NewRetrograde
4. Select measures 2-4 (both staves): left hand is reversed with MyRetrograde, but there are changes in measure 1!! (even though not selected)
In reply to Version 2.0 of New… by ellejohara
There is someting weird about how you handle writing chords. If I replace your code with an addchord routine I found on the internet long ago, everything is hunky dory (see attached)
In reply to There is someting weird… by elsewhere
I don't remember exactly the logic behind the way I did chords. I know I've seen that newElement(Element.NOTE) somewhere on the internet. Why I didn't use it, I don't know. But since it works much better, I'll happily include your changes in the code. I'll have a look at it with fresher eyes tomorrow with my version 3 and 4 MuseScore installs, and get it updated on my GitHub page. Thanks!
In reply to I don't remember exactly the… by ellejohara
Please note that MyRetrograde2 also contains the
if(cursor.tick == 0) cursor.rewind(1);
hack at line 89. You might want to look at how notenames.qml walks through the selection (line 147 & following). It’s cleaner & time tested.
In reply to Please note that… by elsewhere
I've uploaded the changes to GitHub, including the cursor.rewind at 87. I've noticed that the chord notation above the staff is not retrograding along with the notes. So that's a fix for later I guess.
In reply to I've uploaded the changes to… by ellejohara
Many thanks!!
If you want to include the chord symbols in the retrograde see:
https://musescore.org/en/node/346853
my Mar 26, 2023 comment (I don't know how to link to comments):
you will not see chord symbols that have no note under them, using the usual cursor.next () walk
In reply to I've uploaded the changes to… by ellejohara
FYI & FWIW:
1. I like your approach with active tracks better than dealing with staff & voices.
2. In colornotes3.qml I found the correct approach to select-all from within the plugin. It looks weird but it works. No selection now defaults to select all (as in most plugins).
3. I implemented the notename loop inside the tracks loop.
In reply to FYI & FWIW: 1. I like your… by elsewhere
As promised