dragging anchor of instrument change text needs to revert staff's transposition

• Mar 15, 2017 - 21:38
Reported version
2.2
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Draggin instrument change text will leave behind incorrectly transposed notes. I noticed this while testing Marc's fix for #9352: Add ability to set transposition by range.

If start with a bunch of middle C's:

middle-c.png

And then add instrument change text to Tenor Saxophone on first note of meas 2:

inst-change-meas-2.mscz
middle-c-add-change-tenor-meas-2.png

Then we have the notes correctly transposed according to the new instrument's transposition.

However, if we then drag the instrument change text right to meas 3, those notes in meas 2 should revert to middle C without any transposition, but instead you will see the notes in meas 2 are left in an incorrectly-transposed state:

middle-c-add-drag-tenor-right-to-meas-3.png

Note that the although the staff transposition is incorrect, it is at least in the correct octave. Also if you listen to the playback, you will hear the notes in meas 2 at the correct pitch of concert middle C and played correctly in the original instrument (piano). Now, interestingly if you save the score inst-change-dragged.mscz and re-open it, you will see the score looks the same (with the notes in meas 2 displaying as middle D, but that the notes sound as middle D. So it seems the incorrect residual staff transposition was not saved into the mscx (which is good, because it shouldn't have been saved), but of course those notes were saved as the incorrect pitch, D.

Similarly, there if a problem if drag the change instrument text left of where it was initially inputted:

inst-change-dragged-left.png

Those two tenor sax note in meas 2 display as C but should be displayed as D. And if you save and reload the score, inst-change-meas-2-dragged-left.mscz then similarly will note that the those two C notes for tenor will sound incorrectly as Bb.

This bug was found on 2.1-dev 13d7332 nightly windows build.


Comments

There is an additional problem which occurs if change staff properties instrument after adding a change instrument text.

Start with:

to-tenor-meas-3.png

then set staff properties instrument to bari:

then-set-staff-as-bari.png

then dragging the change instrument text around doesn't affect anything:

then-dragging-doesnt-change.png

I don't have access to a machine running MuseScore right now, but I'm confused - what do you mean "drag"? Are you somehow trying to move an existing instrument change text from one measure to another? I'm not sure there is any supported means of doing that. If anything happens at all when you drag, that is probably a bug in itself - dragging text should affect its visual position only, not its behavior.

Title dragging instrument change text needs to revert staff's transposition dragging anchor of instrument change text needs to revert staff's transposition

click and hold the change instrument text and drag it such that its anchor is tied to a different tick.

That sounds like a bug to me. We do that for dynamics (and I don't like it) but as far as I know, other text should drag normally. I am not aware of any special code designed to handle instrument changes specially like that. Probably whatever is happening to change the tick on a drag should be disabled.

Title dragging anchor of instrument change text needs to revert staff's transposition disable dragging of anchor of instrument change text

ok...I'm changing this issue title then...I can probably go ahead and do that fix, since will be easy.

Title disable dragging of anchor of instrument change text dragging anchor of instrument change text needs to revert staff's transposition

It's here:

https://github.com/musescore/MuseScore/blob/2.1/libmscore/instrchange.c…

Looks like there was an initial implementation of a dynamics-like scheme for changing tick on drag, but to me that approach ia not good and we should delete this function so drag works normally. If we do decide we should handle instrument changes specially like dynamics - and I'd argue against that - we would need to complete the implementation, as indeed right now it doesn't do the things it would need to in order to work correctly.

Status (old) patch (code needs review) fixed

Fixed in branch master, commit cbd5471838

fix #181616 disable change anchor for Instrument Change text

Removes the overridden method InstrumentChange::drag(). So now just uses Element::drag(), which won't change the anchor.

Fixed in branch 2.1, commit fa578f9fd5

fix #181616 disable change anchor for Instrument Change text

Removes the overridden method InstrumentChange::drag(). So now just uses Element::drag(), which won't change the anchor.