Integrate instrument and staff type changes

• Feb 26, 2019 - 17:45
Reported version
3.0
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

This is critical relative to the staff-type change functionality itself. Changing staff types is almost useless at this time because it does not integrate with the instrument change function.
For example, to get to the number of strings from a tablature Staff pointer it would look like this:
staff->part()->instrument(tick)->stringData()->strings()
All of the advanced style properties are stored as Instrument and InstrumentTemplate class members, not class Staff or StaffType. In 99% of all real world staff type changes, the reason for changing staff types is a simultaneous instrument change.
The staff-type change functionality must be integrated with the instrument change functionality for it to make sense - from a design perspective, forget about the low level code details. I am not proposing a specific design, but this issue can be used as the place to discuss a new design.


Comments

Title v3 Change Staff Type design is flawed Integrate instrument and staff type changesI'm not sure
Severity S3 - Major S5 - Suggestion
Priority P1 - High

I'm not so sure the correlation is anything like 99% - I see staff type changes used for purely notational purposes, and the vast majority of instrument changes I see require no staff type change. But it's obviously true for the special case of for changes between pitched and unpitched percussion or tablature. In any case, definitely worth looking at improvements.

In reply to by Marc Sabatella

Title Integrate instrument and staff type changes Integrate instrument and staff type changesI'm not sure

I'll rephrase: Instrument changes certainly do not require staff type changes. But staff type changes might well require an instrument change at the same time. In the cases where a staff-type change does require an instrument change, the current code does not handle it.

Title Integrate instrument and staff type changesI'm not sure Integrate instrument and staff type changes

I messed up Jojo's title change. So I'm fixing it.

I think it's not easy to integrate both because of the many different use cases. But it would be very nice if every Instrument Change automatically adds a Staff Change when really needed (mainly on tablatures), so the composer can then delete it if she/he doesn't want it. Could that be done?

In reply to by elerouxx

@elerouxx, I believe the work you have been doing to allow all instrument changes will make staff type changes very rare at instrument changes, though there will no doubt be cases where someone will want more or fewer lines on something like temple blocks. Ideally, cases like this could be handled in the staff/parts properties dialog after the instrument change so the staff type change would be unnecessary.

In reply to by mike320

I thought of several ways to integrate staff Type and instrument changes but I found so many obstacles for this: for example, instruments can change in the middle of a measure and staff types don't. And even if we allow that, it would be very hard with the actual code to have more than one kind of staff (1-line, 5-lines etc) in the same measure. Then there is a series of issues on: how do you switch from normal Note Entry to drum mode...

It eventually seemed to me that tying to force a Staff Type change to do what is actually the instrument's job (to know if is pitched, which clefs are allowed, etc) was actually the hard way, and changing that made things start to work better. In my opinion (unless the whole thing is rethought) Staff Type Changes should take care of the visual stuff while Instrument Changes take care of what's functional.

Speaking of that, I was thinking on adding at least these two fields to Instrument Changes, so they start replacing the staff names from that tick on.

Attachment Size
instrument names.jpg 51.62 KB

As someone who does a lot of instrument changes in symphonic pieces, I'm content to change the instrument names in staff/part properties. In many cases I change the transposition at the same time, like horns written in the bass clef written an octave lower than sounding, which was common in the 1800's. These are actually my most common instrument changes. As you mentioned, you can't do a staff type change mid measure, so a horn that switches between treble and bass mid measure requires a transposition change at the same time.

That very use case had come up a couple days/weeks ago I can't find it anymore though...
It seems to be a different issue though

Hmm, actually it might be the one you just linked to

FWIW I have been working mainly on instrument changes and staff type changes. It is becoming clear (to me at least) that most functional data is related to instruments, not the staff type, and this linking of the staff type to determine what clefs, input mode, notation, etc. is allowed turned out as just a limit imposed by design. I mean, the user should not have to choose between a 5-line percussion or a 5-line pitched staff since they are just the same staff, visually speaking. (I believe that limitation was inherited from the need to tell apart tablatures from staves.)

So I created this PR that places Instrument, instead of staff type, in control of what can be done from that point on (i.e. input using drum tools or pitched notes, allowing pitched or unpitched clefs) and so allowing pitched and unpitched instruments regardless of the staff "type".

https://github.com/musescore/MuseScore/pull/6398

That would leave Staff Type Changes basically in control of the visual change of the staff but again, not limiting the functional part of it.

Now about integration - As Marc said, the vast majority of instrument changes on a staff don't require a visual staff change. Even changing to one-line percussion to switch from, say, a xylophone to a triangle, is not a mandatory rule, but an engraver's choice - although is a good practice and a good choice. However, the same can't be said about tablatures, in which obviously you want to change the number of strings to match the new instrument, if different (i.e. from guitar to bass). In this case, integration would be very convenient.

As a side note, In Sibelius, starting from version 6, an instrument change is mandatory to have a visual staff change. This didn't please every user, as you can see around in some forums, since many users just wanted to cutaway parts of the score, or "cutaway to a single line" while the instrument is not playing, or even have the staff lines dissappear to introduce some text or stemless notes for relative pitches/free improvisation, known cases in modern music in which it's messy to have unnecessary instrument changes every single time.
So, we should think on the best way this integration could work from the user's side but IMO not making an Instrument Change the only way to change the staff.
Maybe an instrument change would somehow 'contain' a staff change that you can control from the inspector? I would think on a checkbox "[ ] Change Staff" that would activate the Staff Type Change inspector along with the Instrument Change Inspector.
And the Staff Type Change would still be available as a separate tool.