Hello all,

When I first joined this list last year I wanted to work on how to set
guitar tablature and soon discovered that Ronald Gelten had written macros
for just such a task for use with MusiXTeX. Before long I was able to set
tab on a 6-line guitar staff below the main staff in a somewhat limited way.
This works the same as a regular staff, except that one leaves out stems and
uses numbers in place of note heads.

I have since been interested in expanding this package in an intelligent way
but have lacked the skills to undertake it. Fortunately, I have been able to
improve my TeXing skills in the past several months enough to understand
some of the macros already written. Unfortunately for me, I don't know
enough about how MusiXTeX works to implement the changes alone.

I feel a good place to begin modifications is the insertion of notes of
short duration, similar to grace notes. A perfect example is the small
pick-up note before the main note, usually played on the guitar using the
so-called hammer (or in the other direction pull-off) technique, which in
the main staff I often notate--and guitar players let me know if this is
incorrect--using grace notes. The tab notation might look something like
this:

----0h2----

Ronald Gelten's macro definitions (in tabdefs.tex, attached) uses a \special
hook to overwrite the staff line (not always especially necessarily and
makes the tab unreadable for dvi output, but it works well), and essentially
places the number using \ccharnote, \lcharnote, or \zcharnote. It looks like
this:

% \tabbox ensures a white background for the tab number in the ps-file
% (the stafflines don't overrun the number). Symbols are centered.
\def\tabbox#1#2{\setbox0=\hbox{\tabfnt #2}%
  \special{ps: 1 setgray}%
  \ccharnote{#1}{\vrule height \ht0 width \wd0 depth \dp0}%
  \special{ps: 0 setgray}%
  \ccharnote{#1}{\box0}%
}

Without knowing what the arguments mean it doesn't make total sense, but
they're easy: the first argument gives a note name (that corresponds to the
6-line staff) and the second argument is the text (intended by Ron to be a
number) to be placed at that note position. This \tabbox command (and the
similar commands \ltabbox and \rtabbox) is not directly seen by the user,
but can be called by a directly useable command such as \tab, defined as
follows:

\def\tab#1#2{%
  \ifcase\tabreverse
  \expandafter\tabbox{\ifcase#1\or n\or l\or j\or h\or f\or d\fi}{#2}\sk%
  \or
  \expandafter\tabbox{\ifcase#1\or d\or f\or h\or j\or l\or n\fi}{#2}\sk%
  \fi
}

This command uses \tabbox to set the number on a "string" (lines 1-6 of the
staff). Argument #1 is the string number, seen in that the \ifcase assings a
note value (between n and d or d and n, depending on how \tabreverse is set,
so that one can number the strings backward if desired) as the first
argument to \tabbox. The second argument is simply a number (or any text you
feel like entering). I don't quite get how the \expandafter works (I've read
descriptions but don't quite grasp the token/expand terminology--I'll have
to read the TeXbook more closely), but I believe that the basic idea is that
\tabbox sets the text and then \sk skips to the next note position for a
future note. (In the PMX code, Werner and Christian showed me how a silent
rest allows correct horizontal control.)

As Daniel Taupin warns in ?2.8 of the MusiXTeX manual, I should avoid the
temptation to use \kern or \hskip, because I need to record the space for
correct handling of beams, line-breaking, etc. My idea is to manipulate
existing spacing commands from MusiXTeX in the definitions of commands
similar \tabbox and \tab (for example, \htabbox supports \hmr as a
hammer-positioning command). I've tried fooling around with \loffset to no
avail (not that it's not useful, I just don't know how to go about it
properly).

Does anyone have ideas? Perhaps something similar to a grace note, replacing
the notehead with a number? Once I get the hang of how to do this I hope to
be able to implement a series of commands to enhance Ron's existing
commands, and work my way toward adjustable-length notation such as slide
marks and slurs/ties between "notes" on the tab staff. I think it will be a
challenge to implement it into PMX and eventually M-Tx, but I hope to be
able to do it.

Much thanks,
Mike Chapman

tabdefs.tex

Reply via email to