Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Approach to allow for Banjo tab (and other instruments with out of order strings, like Uke) #1031

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

jeremy9959
Copy link

@jeremy9959 jeremy9959 commented Jun 29, 2024

Re Issue #1021

This is a very basic approach to allowing for tablature where the instrument has strings that don't lie in ascending order (for example, the 5-string banjo). The approach is:

  • Provide the instrument tuning with the strings in ascending order regardless of their physical layout; so for the banjo in Open G this would be ['D','G','B','d','g'].
  • Provide a "str_order" field that relates the tuning to the physical layout. So the banjo this would be [4,0,1,2,3]. Meaning pitch 4 from the tuning maps to string 0, pitch 0 from the tuning maps to string 1, and so forth. By default this is [0,1,...]

After the already existing tablature logic, working with the string tunings in their ascending configuration, has worked out the tablature, apply the str_order permutation to get the notes on to the right physical string.

This doesn't do any analysis of appropriate fingering, and it doesn't treat the fifth string appropriately (there needs to be some kind of way to de-prioritize the fifth string and treat it mostly as a drone) but it does seem to generate correct note<->string/fret combinations.

I've also added a default tablature instrument called "banjoOpenG". It's easy to add other banjo tunings if this actually works.

Curious to know your opinion of this approach, and any suggestions (or bugs, obviously, I don't know the software well enough to do comprehensive tests).

image

@jeremy9959 jeremy9959 changed the title Devel2 Approach to allow for Banjo tab (and other instruments with out of order strings, like Uke) Jun 29, 2024
@paulrosen
Copy link
Owner

I've been thinking about banjo tab and I'd love to have it. I was thinking about a little bit different approach, though. I think some software allows the decoration !5s!. If that is put before a note, it puts that note on the fifth string. And that would allow creating tablature outside of 1st position in general. And it would work on all instruments.

Then only two things need to change:

  1. abcjs should allow string tunings to be out of order, but it would still try to place each note on the highest pitch first. (That means that no note would accidentally be put on the 5th string - it would always be put on the first string.)
  2. abcjs should support the !5s decoration.

One common thing is to play the drone string and the first string at the 5th fret at the same time - that is, doubling the "g" note. That would be notated [!5s!gg], I guess.

@asjl
Copy link

asjl commented Jun 30, 2024 via email

@jeremy9959
Copy link
Author

@paulrosen it seems like your (1) and (2) together would require changing the ABC parser and making pretty substantial changes to the existing tablature logic.

Also as long as you go down that road, you might want similar tools for, say, ukelele (but then it's the fourth string) and as @asjl mentions maybe also for other banjo configurations.

Most of the ABC repositories are full of music written for fiddle so they aren't annotated in this way, your approach would be great for tunes specifically written out for banjo style.

I'm still super interested in this project but I'm a little intimidated.

@paulrosen
Copy link
Owner

A clarification: when I said "banjo" I was talking about supporting any string instrument that has the strings out of order. So the same technique would also support ukelele. I'm not sure I know of others but it would work for them, too.

Four string banjo is usually not tuned "out of order" - it is usually tuned like a viola, an octave mandolin, or 4 strings of a guitar so it is already completely supported by the existing tablature.

My goal of the tablature is to expand the definition so that you can specify any number of strings and specify that each string is tuned to any note you want. That will take care of a lot of cases. Then there are shorthand definitions, like "mandolin" so that most users don't have to specify the details.

@paulrosen
Copy link
Owner

I just thought of another complication with 5 string banjo: the numbering starts at the 5th fret so a "g" is open and is marked as "0" but a "^g" is on the 6th fret and should be marked as "6".

@paulrosen
Copy link
Owner

I agree it is a little intimidating to jump in. I think the solution won't be very many changes but they will be spread out over a number of areas. There is also a little bit of refactoring needed, I think.

I have one other feature I am in the middle of, but I'll study this right after that - hopefully within the week.

A flaw in your approach is seen on measure 7 of your example: it shows the "a" played on the fifth string at fret 2 - first of all, that should be fret 7, but second of all, no one would play it there, they would play it on the first string.

@jeremy9959
Copy link
Author

Yes, no doubt my approach is a hack and the issue with the note you point out makes that pretty clear.

@jeremy9959
Copy link
Author

Having thought about this a bit more, it seems like a good strategy would be to allow for the author of the abc file to explicitly give string numbers. (In other words, not just the !5! notation for the special case of the banjo fifth string). This is possible in lilypond and I was able to take advantage of that to generate nicely typeset tab using this preprocessor that I wrote. So abcjs could try to "guess" the correct string when it's not specified, but use the provided string if one is specified.

If I understand the ABC standard correctly, the !n! notation is supposed to reflect fingering rather than string number, so stealing it for strings might produce strange conflicts. But if you were going to steal it, then you could allow !n! for a range of positive integers.

@paulrosen
Copy link
Owner

I wasn't aware of the way lilypond did it - that seems confusing to me because it is so similar to the duration notation. That is, (assuming L:1/4) A/2 means to play the note as an 8th note and A\2 means to play it on the second string. Also, in javascript that needs to be escaped so it would look like: const abc = "A\\2".

The notation that I've seen for the string adds the character "s" in. So that if you wanted to indicate the second finger you use !2!A and if you want to indicate the second string you use !2s!A.

@jeremy9959
Copy link
Author

Having the !ns! option available seems like a good solution, though I didn't see that in the ABC standard. I might have just not known where to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants