Banjo 5th string problem, and proposed fix
The 5-string banjo is an odd duck. In its standard tuning, strings 1-4 are tuned D4 B3 G3 D3. String 5 is tuned to G4, a 4th above string 1, but it is tuned there in an odd way. It is usually a string of the same gauge and at similar tension to the 1st string, but it is shorter, beginning it’s vibrating life (usually) at the 5th fret. So, in effect it is really a D4 string capo-ed at the 5th fret. The banjo instrument definition in instruments.xml simply defines it as a G5 string, which is fine when the string is played open, as a sort of a high drone string, which is the case in most traditional banjo music.
The problem is that contemporary players are fretting the 5th string much more often, and MuseScore does not translate to/from tab properly for the 5th string when it is fretted. Since most banjo players use tab almost exclusively, this makes MuseScore very problematic for them.
When the 5th string is fretted on the 7th fret, two frets above where it begins, it sounds as an A note, 2 half tones above its normal G. But the MuseScore instrument definition simply show the 5th string as a G4 string. Therefore, when it is fretted on the 7th fret, MuseScore translates to/from a D note, 7 half tones above the G. (FWIW, I think Finale and Sibelius don't deal with this well either)
I'd like to fix it, but I wanted to do a check with the community on the right way to do that.
I'd propose adding an int stringCapo to the instrString structure. stringCapo would default to 0, but on the banjo 5th string would have value 5. There would be a new tag available in instruments.xml, , which would set a virtual capo on the string whose pitch was just specified. The instrument def for the banjo would then have it's pitch set to D4 instead of G4, with the 5th sring capo, so the pitch would be correct not only when it is played open but also when it's played fretted. StringData.convertPitch and StringData.getPitch would be changed to use stringCapo when making their translations.
As always, there are some complications.
The 5th string, in addition to always being "virtually fretted" is sometimes capo-ed individually higher than the 5th fret. Most banjos have small "spikes" on the fretboard under the fifth string that make this easy by tucking the string under one of the spikes as desired, so it's often called "spiking" the 5th string. Sometimes, the 5th string is spiked just for a slightly different tuning. When playing in D, one usually spikes to the 7th fret because the A is a much more useful note then the G - sort of equivalent to dropped D tuning on a guitar. Also, when the banjo is capo-ed with a full capo, the 5th string is usually spiked equivalently, so when there's a capo on the second fret, one usually spikes the 7th fret as well to maintain the usual string relationships. Therefore, I'd also propose adding a column to the Staff Properties -> Edit String Data dialog for stringCapo, so a score could specify a spiked 5th string without defining a new instrument.
The solution I propose is general in nature, and would handle any fretted instrument with strings of different lengths. Having said that, I don't know of any other such instruments. Are there any, such as ethnic instruments that I don't know about? If so, does this work for them? I have seen alternative guitar capos that either fret individual strings, or that fret half the fingerboard. This solution would work for those but I know they are rare.