tablature and banjo 5th string problems

• Mar 3, 2016 - 12:18

5 string banjos have a 5th string that starts at the 5th fret. So the valid fret numbers for the 5th string are 0, 6, 7...22. You can never have fret numbers 1..5 because it is impossible.

There needs to be some checks in the code to handle this. I looked for a option to set but couldn't find one.

So in the display part of the code, Musescore needs to do something like this:

int fretNumber = get the fret number from somewhere;
int stringNumber = get the string number from somewhere;

if (isBanjo && stringNumber == 5 && fretNumber > 0)
displayFret(fretNumber + 5);

Also the code that reads in notes from tablature has to do the reverse. i.e. convert a fretnumber of 7 to 2 internally.

Lilypond handles this with this option:
\set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo

I guess this would be equivalent to a Musescore staff property. However, this really isn't an option. There is never a case where you would not have this option ON in banjo tab.

For example, if you are playing far down the neck, lets say around the 15th fret. Today (V2.0.2) you would have to write fret 10 to mean fret 15 on the 5th string and the user interface lets you enter frets 1..5


I have attached an example with 2 measures. The first measure is part of a G scale that displays correctly but you will notice the sound of the 10'th fret fifth string is an 'F' instead of a 'C'.

The second measure changes the Fifth string note to the 5th fret, making it sound like a 'C' but the actual note on a banjo, fifth fret is a 'G'.

So, Musescore reads, writes and tracks the Fifth string notes properly. All that needs to change is a little tweak at display time that adds 5 to the fret number if the fret number > 0.

Attachment Size
Banjo Fifth String Test.mscz 4.86 KB

I looked at the source code and found a fix for this bug. It turns out to be trivial.

In note.cpp at line 716 int Note::draw():

QString s;
if (fixed())
s = "/";
s = tab->fretString(_fret, _string, _ghost);

The fix is:
int f = _fret;
if (_string == 4 && f > 0 && staff()->lines() == 5)
f += 5;

QString s;
if (fixed())
s = "/";
s = tab->fretString(f, _string, _ghost);

I thought at first there would be more work required (e.g. to validate input) but everything just magically works. The fix only affects tablature for 5 string instruments, only the 5th string and only if the 5th string is fretted. I looked for something better than staff()->lines() == 5 but couldn't find anything like isBanjoStaff().

I know that banjo tabs are not a musescore priority but is there anyone out there that would consider adding this fix in for us banjo players.

Thanks in advance

In reply to by banjobits

Looking at how you've figured this out in code, and apparently even been able to test your fix, none would be better suited to make this patch a pull request. MuseScore is open source for exactly this reason ;)

1. Create this feature request in the issue tracker:
Include a link to this forum topic and assign yourself to the feature request

2. Read throught the MuseScore git workflow if you haven't already (

3. Make sure to sign the CLA (

4. Create your pull request according to the documentation in step 2 (especially take note on the format of your commit message)

5. Put the feature request at 'patch (code ready for review)' and post a link to the pull request over there.

In reply to by banjobits

I don't think special casing five strings and assuming that this is a banjo is a good idea. There are plenty of other five string instruments. Perhaps there could eventually be a new option added to the string definition that allows you to specify a first fret offset or something. Meanwhile, though, I assume you can still enter music correctly, you just can't necessary trust the automatic guesses MsueScore makes about what string to sue if you try entering music on a standard staff first then convert to tablature?

In reply to by Marc Sabatella

I know that this is an old thread, but I'm curious if anything has happened with it. I do enter banjo tab, and often fret the 5th string, which doesn't seem to work correctly right now. It seems like to do this in a general way, there should be a new tag added to instruments.xml. One could add a tag "open-string-fret". So on a standard 5-string banjo (5th string tuned to G, beginning at 5th fret) the "strings" list would have the 5th string listed as a D4, just like the 1st string, but "open-string-fret" would be set to 5, so the open string sounds as a G4. The 7th fret, though, would play as A4, 7 frets above the D4 and NOT 7 frets above the G4 open string sound. Also, it makes it really ease to adjust the instrument for a spiked (capo-ed) 5th string, since the pitch in the "strings" list doesn't change, just the open-string-fret.

In other words, everything in MuseScore would use the data in the "strings" list, just like it does now, except that fret 0 on that string would be translated internally to the specified open-string-fret and the banjo instrument would be changed to have the 5th string as D4 instead of G4. Also, the edit strings dialog in staff properties would need to have a column added for the new parameter.

Does this make any sense, and is it a project worth doing?

BTW - a couple of additional data points. I just looked at a radically new banjo which has the fifth string full length, but with spikes at the fifth fret for "normal" 5-string banjo playing. So, the 5th string is literally tuned normally to a D, just like the 1st string. Also, there's been a bunch of discussion on (leading forum and tab repository) from users currently using tablEdit about switching to MuseScore. This issue hasn't come up yet, but would likely be a deal killer for many users if it isn't addressed.

Do you still have an unanswered question? Please log in first to post your question.