Instrumentdialog - clef of first additional staff should always be instrument standard

• Nov 25, 2018 - 04:33
Reported version
2.3
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
active
Regression
No
Workaround
Yes
Project

If an additional staff is added the clef for the first added is always a bass clef. The original clef is not copied for the first additional clef but the following. That makes sense for a piano but not for most instruments at all.

  1. Create new score with several instruments.
  2. Go to Edit -> Instruments, click one of the existing instruments on the right, choose "Add Staff."

Expected result for most instruments: Treble Clef. Actual result: Bass Clef.


Comments

I'm guessing this is a result of the code that tries to make sure adding a second staff to the default score - which is "piano" instrument, one treble staff - would complete the grand staff. Somehow in 2.x we managed to do that without just always adding a bass clef, though.

Hmm, I'm seeing something different from you guys then. In both 2.3.2 and in 30, if I have a flute and a staff a staff, I get another treble staff. If I take the default empty score (treble staff, piano instrument) and add a staff, I get a bass clef - correct result since this is a piano instrument. And if I have a trombone instrument and add a staff, I get another bass clef. So I don't see a difference, nor do I see a problem. can someone post a sample score and precise steps to reproduce the perceived problem?

mike320 - as I mentioned, it's actually quite important that adding a second staff to the default empty score should add a bass clef, to complete the grand staff. Like it or not, this is probably how the majority of beginners operate.

Marc - you're right it doesn't occur all the time. In fact it only occurs after opening a score or using a template.
So I found the problem only applies to the use of templates and most annoying saved files but not if the instrument is added in the current session.
I proposed an easy fix for that by simply checking whether the instrumentID contains keyboard. Not the nicest fix but I guess the most efficient here. Will upload my PR soon, but I'm working on multiple staff issues right now and will upload together.

In reply to by fbrauchle

Unfortunately checking for a keyboard won't work. Off the top of my head I can think of Harp, plucked strings; Marimba, pitched percussion; Accordion, Free reed that can all have grand staves.

As far as key board is concerned, if I want to add a staff between the staves on a piano, I would expect it to be a treble clef, not bass. If I want a bass clef I'd add it after the bass clef.

As far as noobs adding a staff to the default treble clef to make a piano, they far more often add a new instrument than a staff and then get confused because they can't use cross-staff notation.

All you have to do is look at questions asked on the forum about "how to add a bass clef staff to my score" or check out the number of scores for piano posted to msuescore.com that were clearly created this way, to realzie that a huge numbers of people use Add Staff to convert the default score into a "real" piano score.

Anyhow, interesting, I think I see what is meant about results differing according to how the session came about. I would rather investigate this as the clue than keying anything off the instrument id.

I think my fix covers most use cases and is already an improvement on the issue with other instruments.
If a staff is added to an instrument that was created in the same dialog session, the instruments are not yet created, so we have to use a slightly different approach here. Nothing to really worry about and also the reason for the different behaviours. Adding the bass clef makes only sense when a template is loaded (=score opened) and only in this case a differentiation is made.
To cover the most common use case I would recommend to use that "workaround" and dig into it later.
Another possible solution could be on top of the "workaround" to always use the clef of the actual selected element?