Applying then removing "Change Instrument" to first note removes original instrument from Mixer
Steps to reproduce:
- Add some notes to a blank staff. There is one instrument in the Mixer.
- Apply "Change Instrument" text to the 1st note in the score. (Normal behaviour for any other note.)
- There is still only 1 instrument in the Mixer (as expected, see note below).
- Now delete (or Undo) the "Change Instrument" text.
- There are now zero instruments in the Mixer, and no sound on playback.
Expected behaviour: Deleting "Change Instrument" text should not remove the final instrument.
Note: Arguably the bug really lies in step 2 since changing instrument normally adds a new entry to the Mixer. However, I think that changing instrument on the 1st note should not add another entry to the Mixer, it should instead be equivalent to changing instrument for the entire staff. Only when the note selected is not the first note should a new entry be created in the Mixer. This is the current behaviour anyway, so the only problem is what happens when the "Change Instrument" text is deleted.
GIT commit: bf97799
Comments
I think the first instrument change *should* add an entry to the mixer. It's a not uncommon situation - the part might for alto saxophone overall, but the piece might start off with the player doubling on flute. It is assumed he will switch to alto saxophone later or else you would have simply created the part for flute in the first place (or done an actual change of instrument for the staff). So you'll want the entry sooner or later. Might as well create it now, rather than special casing this and hoping to get all the special cases right everywhere they occur.
On the other hand, knowing what I do about how "maps" work, I suspect that it might be easier after all to let an instrument change at the beginning of the score simply change the existing Mixer entry. I suspect it will prove impossible to differentiate actually changing the staff's instrument to flute versus inserting a flute instrument change text at tick 0. In which case, the solution might indeed be to speical case deleting an instrument change at tick 0. Hmm, but I also wonder about inserting a measure at the beginning of the score. This could prove thorny.
Having considered it further I agree that "Change Instrument" should produce a new entry in the Mixer, even for the first note. The case I had envisioned before was that you might want to use the "Change Instrument" object as a reminder of the staff name. (In this case "Change Instrument" would be applied to the first note that isn't a rest, and you obviously wouldn't want a new instrument in the Mixer.) However, this can easily be achieved by adding ordinary staff text and setting its type to "Instrument Change", so it appears in the correct formatting but without creating a new instrument in the Mixer.
Agred. Also, even when using hide empty staves, the staff name should occur if there is one - I guess you deleted the short name in this score?
FWIW, a PR was just submitted a few hours ago to fix the bug, and the result will be that new mixer entry is created whether you attach to the first note or elsewhere.
Good to hear a pull request is imminent!
Yes, I did delete the short instrument name, but even if it was still there I would still want the full name visible too. I find the short name is unhelpful/ambiguous if the long name is not also visible somewhere on the score. Regarding the "hide empty staves feature", I think there should be an option to show the long name the first time a part comes in if it has been hidden in the first system. I find the "Don't hide empty staves in first system" option to be a waste of space. I'm happy to create a separate issue for this if you think it merits one (I couldn't find an existing one in the tracker).
FWIW, that's why the default is to *not* hide empty staves for the first system. Virtually all published condensed scores I have seen are done this way - first system shows all instruments with full, then abbreviated names afterwards. But sure, if you wish to submit a feature request to allow the full name name to be used the first time it appears if you for whatever reason are *not* using the "Don't hide..." option, go for it.
Interesting. That may be the case in orchestral scores, but in vocal scores the names of the characters/parts are usually hidden until they come in, at which point the full name is given and it is only abbreviated after that.
I've added this as a feature request here: #46876: Option to show "long instrument name" in first visible staff when using "hide empty staves".
Makes sense.
Meanwhile, here is igevorse's PR:
https://github.com/musescore/MuseScore/pull/1743
Fixed in 96028a366e
Automatically closed -- issue fixed for 2 weeks with no activity.