gtrtab - outputs an empty ascii-tab template


 gtrtab                 # output seven systems
 gtrtab -s 2            # outputs two systems
 gtrtab -t DADGAd       # strings labelled D A D G A d
 gtrtab -t D,A,D,F#,A,d # strings labelled D A D F# A d
 gtrtab -p 18           # outputs bars of 18 dashes (=rhythmic pulses)


This script outputs an empty ascii-tab template, allowing different tunings, different numbers of systems, and different bar-lengths. It's like manuscript music-paper.
You can then edit this, using Your Favourite Text Editor, to produce a guitar piece in ascii-tab form, eg:

   G            E            Am    D      G  G7 C  Cm

Such ascii-tab can be converted into MIDI, using gtrtab2midi

It might be nice to be able to convert it into PostScript, perhaps even to integrate ascii-tab systems into a muscript score.


Tablature can use various lines, arrows, and other symbols to denote bends, hammer-ons, trills, pull-offs, slides, and so on. These are the symbols that usually represent various techniques, though the symbols may vary:

    h     hammer on
    p     pull off
    b     bend string up
    r     release bend
    /     slide up
    \     slide down
    v     vibrato (sometimes written as ~)
    t     right hand tap
    s     legato slide
    S     shift slide
    *     natural harmonic
    [n]   artificial harmonic
    n(n)  tapped harmonic
    tr    trill
    T     tap
    TP    tremolo picking
    PM    palm muting (also written as _ and .)
    N.C.  No chord: tacet or rest
    \n/   tremolo arm dip; n = amount to dip
    \n    tremolo arm down
    n/    tremolo arm up
    /n\   tremolo arm inverted dip
    =     hold bend; also acts as connecting device for hammers/pulls
    <>    volume swell (louder/softer)
    x     on rhythm slash represents muted slash
    o     on rhythm slash represents single note slash

Guitar tablature is not standardised and different sheet-music publishers adopt different conventions. Songbooks and guitar magazines usually include a legend setting out the convention in use.
I find these extra symbols useful above the system:

    d     down-stroke (usually with a plectrum; or also with fingernail)
    u     up-stroke   (usually with a plectrum; or also with fingernail)
And, within the system, using hexadecimal notation for the high frets:
    A     play the tenth 10th fret
    B     play the eleventh 11th fret
    C     play the twelfth 12th fret (the octave)
    D     play the thirteenth 13th fret
    E     play the fourteenth 14th fret
    F     play the fifteenth 15th fret


-p 12

Sets the number of Pulses per bar, each pulse being indicated by a minus-sign. The number of bars per system is calculated to fit onto a screen of 80 colums. So gtrtab -t DADGAd -p 12 -s 1 will print out:


The default -p is 24, with which three bars just fit onto one line. If -p is set to 0, then no barlines are added.

-s 4

This example outputs just four Systems. The default is seven, which takes up 63 lines of text output, which probably just fits on one page on your printer ...

-t DADGAd or -t D,A,D,G,A,d or -t D,A,D,F#,A,d

Sets the Tuning, from the lowest string to the highest. This is the order, bottom upwards, in which the letters will be shown in the output. The strings can also be specified in comma-separated form, such as -t D,A,D,G,A,d which is especially useful if there are sharps or flats involved, for example -t D,A,D,F#,A,d


Print the Version


This script is freely available at


 20180801 1.0 initial release


Peter J Billam,