Banjo Tablature
Representation#
When typeset, banjo tablature looks like:
+3+
+-------0---0-----4-+
+-----0----------5--+
+---3p2-----0-x-7---+
+-------------------+
+-0-------0---------+
but this isn’t an economical way of writing it on a computer. There is a need for a concise abstract representation of tablature, suitable for input to a type-setting program.
The first instinct is to say “let’s treat it like music,” but this isn’t helpful. Tablature isn’t music, and that’s an important thing to remember — tablature is a handy way of showing the finger-movements needed to create music. Bluegrass banjo isn’t a stream of 16th notes, because of sustain of the strings ensure notes are still ringing when the next are played.
Once we get away from needing to represent the “musical” quality of tablature, we can reduce our input to:
- String
- Fret
- Rhythm (triplets, etc)
- Bar lines
- Slur indication (hammer-on, pull-off)
Representation#
With these essentials in mind, I envisage input to a tablature typesetting program to be:
INPUT = ELEMENT *
ELEMENT = INSTANT | 2 INSTANT INSTANT | 3 INSTANT INSTANT INSTANT | BAR
INSTANT = OPEN-PAREN NOTE (SEMICOLON NOTE ) * CLOSE-PAREN
NOTE = FRET COMMA STRING (COMMA SLUR)?
SLUR = s | p | h
OPEN-PAREN = (
CLOSE-PAREN = )
SEMICOLON = ;
COMMA = ,
BAR = |
FRET = integer | x
STRING = integer
For instance, the tablature given above would be represented as
|(0,5)(3,3)(2,3,p;0,1)(0,5)(0,3;0,1)(x,3)3(7,3)(5,2)(4,1)|
The Program#
The program will work by reading in the file, note by note, and constructing the tablature, bar by bar. At the end of each bar, it decides whether it can place the bar on the current line, and if it can’t, it starts a new line (checking that the bar isn’t larger than the line).
The program will build the bar in terms of character and position pairs. For instance, it will know to put a 0 at the position three characters in and five down, to represent (0,5) at the start of the bar. To print the bar out, it lays down a bare staff to the length of the bar, and overlays the characters it knows about, offset by the starting position of the bar.
Double-digit fretted notes are normally spaced four characters apart, eg --14--14--14-- and triplets are spaced three apart, eg --14-14-14-- with a +--3--+ indicator above. For single-digit notes, space normally as --3--4--5-- and triplets as --3-4-5--.
Author#
This document was written by Nathan Torkington.