The Mudcat Café TM
Thread #73647   Message #3929592
Posted By: GUEST
07-Jun-18 - 02:09 AM
Thread Name: ABC to standard notation
Subject: RE: ABC to standard notation
"With ABC I can access the fantastic file resources on-line but I can't do guitar tab"

I’ve no intention of doing so but it would be possible to write an online abc converter that allows a user to enter their own (eg.) guitar tab. Reading through Guido Gonzato’s Guide, the behind the scenes chain would be running abc2xml.py with a -f switch, converting the xml output back to abc using xmltoabc with a -t switch and then sending the abc through abc2svg.

I don’t know what the limitations of this tab are but here here is an example from the guide I’ve played with. This one is 5 string banjo.

Original abc with the tab instructions:

%%scale 0.65
X:1
T:Blue Moon Of Kentucky (banjo)
C:http://moinejf.free.fr/abcm2ps-doc/banjo.xhtml
M:4/4
L:1/4
V:1 treble-8
V:2 tab strings=G4,D3,G3,B3,D4 octave=-1
K:C
%
[V:1] z[Bg]   [cg]   [^cg]    |: ^c/[dd]/ g/d/       d/g/       d/d/ |
[V:2] z[B!5!g][c!5!g][^c!5!g] |: ^c/[dd]/ !5!g/!2!d/ d/!5!g/ !2!d/d/ |
%
[V:1] B/d/ B/d/ A/d/ G/d/ | E/c/ G/d/    g/G/ d/g/    |
[V:2] B/d/ B/d/ A/d/ G/d/ | E/c/ G/d/ !5!g/G/ d/!5!g/ |
%
[V:1] G/e/    g/G/ e/G/ E/e/ | D/d/    g/G/ d/g/    B/d/ |
[V:2] G/e/ !5!g/G/ e/G/ E/e/ | D/d/ !5!g/G/ d/!5!g/ B/d/ |

abc after going to and from xml:

%%beginsvg
<style type="text/css">
.bf {font-family:sans-serif; font-size:7px}
</style>
<defs>
<rect id="clr" x="-3" y="-1" width="6" height="5" fill="white"></rect>
<rect id="clr2" x="-3" y="-1" width="11" height="5" fill="white"></rect>
<g id="kop0" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">0</text></g>
<g id="kop1" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">1</text></g>
<g id="kop2" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">2</text></g>
<g id="kop3" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">3</text></g>
</defs>
%%endsvg
X:1
T:Blue Moon Of Kentucky (banjo)
C:http://moinejf.free.fr/abcm2ps-doc/banjo.xhtml
%%score 1 2
L:1/8
M:4/4
I:linebreak $
K:C
%%map tab2 =A, print=B heads=kop2
%%map tab2 =B, print=d heads=kop0
%%map tab2 =C print=d heads=kop1
%%map tab2 =D print=f heads=kop0
%%map tab2 =D, print=G heads=kop0
%%map tab2 =E print=f heads=kop2
%%map tab2 =E, print=G heads=kop2
%%map tab2 =G print=E heads=kop0
%%map tab2 =G, print=B heads=kop0
%%map tab2 ^C print=d heads=kop2
%%map tab2 ^^C print=d heads=kop3
V:1 treble-8
V:2 tab stafflines=5 strings=G4,D3,G3,B3,D4
%%voicemap tab2
K:none
M:none
%%clef none
%%staffscale 1.6
%%flatbeams true
%%stemdir down
V:1
z2 [Bg]2 [cg]2 [^cg]2 |: ^c[dd] gd dg dd | Bd Bd Ad Gd | Ec Gd gG dg | Ge gG eG Ee | Dd gG dg Bd | %6
V:2
x2 [=G=B,]2 [=G=C]2 [=G^C]2 |: ^C[=D^^C] =G^^C =D=G ^^C=D | =B,=D =B,=D =A,=D =G,=D | %3
=E,=C =G,=D =G=G, =D=G | =G,=E =G=G, =E=G, =E,=E | =D,=D =G=G, =D=G =B,=D | %6

This should convert here