The Language Tutorial

There are two types of TexTab text file:
  1. those in conventional music notation (CMN), and
  2. those in tablature notation (TN).
The only difference between the file formats is in the way in which the pitch is defined. For example, the second fret of the second string of a banjo tuned to GDGBD gives the C# note above middle C. This pitch is called `C4S' in CMN, where the `4' denotes the octave and the `S' denotes the sharp. Middle C is called `C4' and the note below that is called `B3' (i.e. the octave numbering increases by one between B and C). In TN this note is called `202', where the first `2' denotes the second string and the `02' the denotes the second fret.

We'll start by defining a single note. Let's choose C# above middle C, as above, which is called `C4S' in CMN and `202' in TN on a banjo tuned to GDGBD. We also need to define the length of the note, which is done by placing a `/' and two digits after the `C4S' or `202'. This uses the conventional fractional notation, where `/01' represents a semibreve, `/02' a minim, `/04' a crotchet, `/08' a quaver, `/16' a semiquaver etc. - lets choose a semiquaver, so the full note is indicated by `202/16' in TN. In tablature, this looks like:

There are a two things to note about this. Firstly the `2' is placed in between the horizontal lines - if you prefer it intersecting one line, then that is easily changed (see later). Also, although this is a very short tune, it also needs vertical lines to show the beginning and end of a bar. TexTab indicates these by the symbol `|'. The full TN code for the above is therefore `|202/16|'. Similarly, in CMN, this would be `|C4S/16|'.

The rest of this tutorial will deal only with TN - if you want to change the notation to CMN, just change each note as described above (e.g. `202' becomes `C4S').

Let's now add another note after this, a semiquaver at the third fret of the second string. This note is called `203/16' and must be separated from the first note in some way. We do this by using either a `&' character when the notes are within a single bar, or with a `|' character when the notes span two bars (the `|' character is also the bar separator). The two notes together are therefore coded as `|202/16&203/16|', which looks like:

We now often want to group notes by connecting the tails together. We do this by enclosing a set of notes in square brackets (`[' and `]'). The above pair of notes would then be coded as `|[202/16&203/16]|', which looks like:

We may then want to add an additional note, say, an open first string, in conjunction with the second note shown above. An open first string is coded as `100' (since the fret number of the open string is called `00'), and this is just added to the `203' of the existing second note to give `|[202/16&203100/16]|', which looks like:

Now, let's make the `202' note and the `203' note be connected by a slide, hammer, push or pull. This is done by enclosing the relevant notes in round brackets (`(' and `)') to give `|[(202/16&203)100/16]|', which looks like:

There is normally a series of letters along the bottom of the tablature to indicate (a) the finger used to pluck the string and (b) the presence of a slide, hammer, push or pull. TexTab does this by the underline character (`_'). Each time you insert a `_' for a given note, the annotation line moves down one level. To insert a single character, on the first annotation level, the `_' and the character are placed immediately after the note. Therefore to insert an `I' (for index finger) under the first note of the above and an `M' (for middle finger) under the second note, the code becomes `|[(202/16_I&203)100/16_M]|', which looks like:

Let's now assume that the `202' note and the `203' note are connected by a hammer. This requires a `H' underneath the `M' that is already there - i.e. on the next level of annotation down. This is done by adding a `_H' after the `_M' to give `|[(202/16_I&203)100/16_M_H]|', which looks like:

We now almost have the first bar of a tune (e.g. one version of Foggy Mountain Breakdown), which is coded as:

`|[(202/16_I&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]|',

(the code has here been split over two lines - line breaks make no difference to TexTab) which looks like:

You may now want to indicate a chord above the beginning of the bar. This is done using the `^' symbol, which works in the same way as `_' (underline) - each time you insert a `^' for a given note, the annotation line moves up one level. Therefore to indicate a G-chord, insert `^G' after the note, so that the code becomes:

`|[(202/16_I^G&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]|',

which looks like:

If you want to add more than one character on a given annotation line, just enclose it in double quotes ("). It should be noted that a region within quotes is one of the few places where spaces mean anything in the TexTab code - otherwise spaces (and also end-of-line characters) are generally ignored and may be used by yourself to make the code easier to read (e.g. by putting spaces between each bar, or by putting each bar on a separate line). The exceptions to this rule are that you should not:

Therefore, to put `G-chord' instead of just `G', the code becomes:

`|[(202/16_I^"G-chord"&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]|',

which looks like:

Also, to add subscripts and superscripts, you use the `_' (underline) and `^' characters, respectively. Note that this meaning (i.e. when within double quotes) is different from usage above. Therefore to insert the annotation line `Em' (for an E minor chord), instead of `G' or `G-chord', the code becomes: `|[(202/16_I^"E_m"&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]|',

which looks like:

Here are a few more useful items: A `$' is used to indicate a double vertical line at the beginning or end of a bar (i.e. instead of `|'). Our bar of the tune then becomes (going back to the G-chord):

`$[(202/16_I^G&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]$',

which looks like:

If you want to repeat this bar, then the `repeat' character is a `:', and our tune becomes:

`$:[(202/16_I^G&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]:$',

which looks like:

Finally, you may want to add a time signature. This is indicated by the `#' character. The actual numbers used are specified elsewhere (see `Parameter File', below). Our tune becomes:

`$:#[(202/16_I^G&203)100/16_M_H&(202/16_T&203)100/16_M_H]&

[500/16_T&200/16_I&100/16_M&500/16_T]:$',

which looks like:



Return to the TexTab Home Page or contact John Hunter for help or further information.