Great job!<br>Really appreciate it!<br><br>\r<br><br><div class="gmail_quote">On Mon, May 4, 2009 at 9:47 AM, Marc Hohl <span dir="ltr">&lt;<a href="mailto:marc@hohlart.de">marc@hohlart.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello tablature users,<br>
<br>
after sending my first version of a tablature.ly-file, I got a lot of positive resonse,<br>
and a lot more of corrections/improvements. Thank you all!<br>
<br>
Now, there is a (hopefully) better file which includes the following features/changes:<br>
<br>
1) the palmmute/deadnote stuff is the same, only the code has been simplified, thanks to Neil&#39;s proposals<br>
<br>
2) the \tabNumbersOnly settings are now the default, so when <a href="http://tablature.ly" target="_blank">tablature.ly</a> is included, the stems etc. are gone<br>
  (as proposed by Grammostola Rosea)<br>
<br>
3) the modern tab clef is now available as any other clef by typing \clef &quot;moderntab&quot;<br>
<br>
To implement (3), there is another function necessary, which will be in future releases of lilypond, but<br>
for now, you have to insert the following lines into scm/parser-clef.scm:<br>
<br>
;; a function to add new clefs at runtime<br>
(define-public (add-new-clef clef-name clef-glyph clef-position octavation c0-position)<br>
 &quot;Append the entries for a clef symbol to supported-clefs and c0-pitch-alist&quot;<br>
 (set! supported-clefs<br>
       (acons clef-name (list clef-glyph clef-position octavation) supported-clefs))<br>
 (set! c0-pitch-alist<br>
       (acons clef-glyph c0-position c0-pitch-alist)))<br>
<br>
Otherwise the new clef definition won&#39;t work.<br>
<br>
Thanks again to Carl and Neil for their help!<br>
<br>
There is one problem now with the settings in <a href="http://tablature.ly" target="_blank">tablature.ly</a>: I simply made ties transparent, but<br>
then, the fret number appears as it were a note to be played. Hopefully somewhere in the future,<br>
I will find a possibility to let the fret number disappear, but as David Stocerk pointed out,<br>
some cases had to be  distinguished (the following is a quote from a former posting from David):<br>
<br>
(quote...)<br>
<br>
It should be noted that a publishing standard is when there is a Note Staff + Tab Staff, tied notes (that is, the notes that are &#39;held&#39;) in the Tab Staff are indicated by parenthesizing the tab number(s). There are several conventions that are related to tied notes in a Notes+Tab situation:<br>

<br>
  * Tab numbers that are &#39;tied to&#39; are sometimes parenthesized,<br>
    sometimes hidden.<br>
  * In the case that &#39;tied to&#39; notes are hidden, a parenthesized tab<br>
    number is usually forced if the &#39;tied to&#39; note is at the beginning<br>
    of a line (i.e., the note is tied over a system break).<br>
  * Likewise, parenthesized tab numbers are forced when a &#39;tied to&#39;<br>
    note begins a 2nd ending or Coda section.<br>
  * A parenthesized chord in the Tab Staff are indicated with a single<br>
    pair of parentheses surrounding all of the notes in the chord (as<br>
    opposed to as single pair of parentheses around each individual<br>
    note in the chord).<br>
<br>
(...quote)<br>
<br>
So this seems to be a difficult task, but somehow to manage.<br><font color="#888888">
<br>
Marc<br>
<br>
<br>
<br>
</font><br>%%%% <a href="http://tablature.ly" target="_blank">tablature.ly</a><br>
%%%%<br>
%%%% source file of the GNU LilyPond music typesetter<br>
%%%%<br>
%%%% (c) 2009 Marc Hohl &lt;<a href="mailto:marc@hohlart.de">marc@hohlart.de</a>&gt;<br>
<br>
<br>
% some publications use the triangled note head<br>
% for palm mute, so here we go:<br>
palmMuteOn = { \set shapeNoteStyles = #(make-vector 7 do) }<br>
palmMuteOff = { \unset shapeNoteStyles }<br>
% for single notes (or groups of notes within { ...} :<br>
palmMute =  #(define-music-function (parser location notes) (ly:music?)<br>
      #{<br>
         \palmMuteOn $notes \palmMuteOff<br>
      #})<br>
<br>
% x-tab-format uses a &quot;x&quot; instead of the fret number:<br>
#(define (x-tab-format str context event)<br>
    (make-whiteout-markup<br>
      (make-vcenter-markup<br>
        (markup #:musicglyph &quot;noteheads.s2cross&quot;))))<br>
<br>
% dead notes are marked with a cross-shape note head,<br>
% both in normal notation and in tablature:<br>
deadNotesOn = {<br>
   \override NoteHead #&#39;style = #&#39;cross<br>
   \set tablatureFormat = #x-tab-format<br>
}<br>
deadNotesOff = {<br>
   \unset tablatureFormat<br>
   \revert NoteHead #&#39;style<br>
}<br>
% for single notes or groups of notes within {...}:<br>
deadNotes = #(define-music-function (parser location notes) (ly:music?)<br>
   #{<br>
      \deadNotesOn  $notes \deadNotesOff<br>
   #})<br>
<br>
% definitions for the &quot;moderntab&quot; clef:<br>
% the &quot;moderntab&quot; clef will be added to the list of known clefs,<br>
% so it can be used as any other clef:<br>
%<br>
% \clef &quot;moderntab&quot;<br>
%<br>
#(add-new-clef &quot;moderntab&quot; &quot;markup.moderntab&quot; 0 0 0)<br>
<br>
% this function decides which clef to take<br>
#(define (clef::print-modern-tab-if-set grob)<br>
    (let* ((glyph (ly:grob-property grob &#39;glyph)))<br>
          ;; which clef is wanted?<br>
          (if (string=? glyph &quot;markup.moderntab&quot;)<br>
              ;; if it is &quot;moderntab&quot;, we&#39;ll draw it<br>
              (let* ((staff-symbol (ly:grob-object grob &#39;staff-symbol))<br>
                     (line-count   (ly:grob-property staff-symbol &#39;line-count))<br>
                     (staff-space  (ly:grob-property staff-symbol &#39;staff-space 1)))<br>
                    (grob-interpret-markup grob (make-customTabClef-markup line-count staff-space)))<br>
              ;; otherwise, we simply use the default printing routine<br>
              (ly:clef::print grob))))<br>
<br>
% define sans serif-style tab-Clefs as a markup:<br>
#(define-markup-command (customTabClef layout props num-strings staff-space) (integer? number?)<br>
    (define (square x) (* x x))<br>
    (let* ((scale-factor (/ staff-space 1.5))<br>
           (font-size (- (* num-strings 1.5 scale-factor) 7))<br>
           (base-skip (* (square (+ (* num-strings 0.195) 0.4)) scale-factor)))<br>
       (interpret-markup layout props<br>
         (markup #:vcenter #:bold<br>
                 #:override (cons &#39;font-family &#39;sans)<br>
                 #:fontsize font-size<br>
                 #:override (cons &#39;baseline-skip base-skip)<br>
                 #:left-align<br>
                 #:center-column (&quot;T&quot; &quot;A&quot; &quot;B&quot;)))))<br>
<br>
% commands for switching between tablature with numbers only...<br>
tabNumbersOnly = {<br>
   % no time signature<br>
   \override TabStaff.TimeSignature #&#39;stencil = ##f<br>
   % no stems, beams, dots, ties and slurs<br>
   \override TabVoice.Stem #&#39;stencil = ##f<br>
   \override TabVoice.Beam #&#39;stencil = ##f<br>
   \override TabVoice.Dots #&#39;stencil = ##f<br>
   \override TabVoice.Tie  #&#39;stencil = ##f<br>
   \override TabVoice.Slur #&#39;stencil = ##f<br>
   % no tuplet stuff<br>
   \override TabVoice.TupletBracket #&#39;stencil = ##f<br>
   \override TabVoice.TupletNumber #&#39;stencil = ##f<br>
   % no dynamic signs, text spanners etc.<br>
   \override DynamicText #&#39;transparent = ##t<br>
   \override DynamicTextSpanner #&#39;stencil = ##f<br>
   \override TextSpanner #&#39;stencil = ##f<br>
   \override Hairpin #&#39;transparent = ##t<br>
   % no rests<br>
   \override TabVoice.Rest #&#39;stencil = ##f<br>
   \override TabVoice.MultiMeasureRest #&#39;stencil = ##f<br>
   % no markups<br>
   \override TabVoice.Script #&#39;stencil = ##f<br>
   \override TabVoice.TextScript #&#39;stencil = ##f<br>
}<br>
% and the full notation<br>
tabFullNotation = {<br>
   % time signature<br>
   \revert TabStaff.TimeSignature #&#39;stencil<br>
   % stems, beams, dots<br>
   \revert TabVoice.Stem #&#39;stencil<br>
   \revert TabVoice.Beam #&#39;stencil<br>
   \revert TabVoice.Dots #&#39;stencil<br>
   \revert TabVoice.Tie #&#39;stencil<br>
   \revert TabVoice.Slur #&#39;stencil<br>
   % tuplet stuff<br>
   \revert TabVoice.TupletBracket #&#39;stencil<br>
   \revert TabVoice.TupletNumber #&#39;stencil<br>
   % dynamic signs<br>
   \revert DynamicText #&#39;transparent<br>
   \override DynamicTextSpanner #&#39;stencil = ##f<br>
   \revert TabVoice.DynamicTextSpanner #&#39;stencil<br>
   \revert TabVoice.Hairpin #&#39;transparent<br>
   % rests<br>
   \revert TabVoice.Rest #&#39;stencil<br>
   \revert TabVoice.MultiMeasureRest #&#39;stencil<br>
   % markups<br>
   \revert TabVoice.Script #&#39;stencil<br>
   \revert TabVoice.TextScript #&#39;stencil<br>
}<br>
<br>
% the defaults for tablature:<br>
% the clef handler will be included and the tablature<br>
% is displayed \tabNumbersOnly-style:<br>
\layout {<br>
   \context {<br>
      \TabStaff<br>
      % the clef handler<br>
      \override Clef #&#39;stencil = #clef::print-modern-tab-if-set<br>
      \override TimeSignature #&#39;stencil = ##f<br>
   }<br>
   \context {<br>
      \TabVoice<br>
      \override Stem #&#39;stencil = ##f<br>
      \override Beam #&#39;stencil = ##f<br>
      \override Dots #&#39;stencil = ##f<br>
      \override Tie  #&#39;stencil = ##f<br>
      \override Slur #&#39;stencil = ##f<br>
      \override TupletBracket #&#39;stencil = ##f<br>
      \override TupletNumber #&#39;stencil = ##f<br>
      \override DynamicText #&#39;transparent = ##t<br>
      \override DynamicTextSpanner #&#39;stencil = ##f<br>
      \override TextSpanner #&#39;stencil = ##f<br>
      \override Hairpin #&#39;transparent = ##t<br>
      \override Rest #&#39;stencil = ##f<br>
      \override MultiMeasureRest #&#39;stencil = ##f<br>
      \override Script #&#39;stencil = ##f<br>
      \override TextScript #&#39;stencil = ##f<br>
   }<br>
}<br>
<br>\version &quot;2.12.2&quot;<br>
\include &quot;<a href="http://tablature.ly" target="_blank">tablature.ly</a>&quot;<br>
<br>
% for testing purposes only; in newer versions of lilypond, they will be<br>
% already defined:<br>
#(define-public guitar-seven-string-tuning &#39;(4 -1 -5 -10 -15 -20 -25))<br>
#(define-public guitar-drop-d-tuning       &#39;(4 -1 -5 -10 -15 -22))<br>
#(define-public bass-four-string-tuning    &#39;(-17 -22 -27 -32))<br>
#(define-public bass-drop-d-tuning         &#39;(-17 -22 -27 -34))<br>
#(define-public bass-five-string-tuning    &#39;(-17 -22 -27 -32 -37))<br>
#(define-public bass-six-string-tuning     &#39;(-12 -17 -22 -27 -32 -37))<br>
<br>
\markup{<a href="http://tablature.ly" target="_blank">tablature.ly</a> - second attempt.}<br>
<br>
alotofstuff = {<br>
   \time 3/4<br>
   c4^&quot;test&quot; d( e)<br>
   f4\f g a^\fermata<br>
   c8\&lt; c16 c ~ c2\!<br>
   c&#39;2.<br>
   \mark \default<br>
   R2.<br>
   r4 d4 r8 r<br>
   \times 3/4 { b4 c d c }<br>
   c4. d-_( e\varcoda)<br>
   -&gt;f g~ a\prall g\thumb e-. f-. g-.<br>
   \times 3/4 { b4 c d c }<br>
   \bar &quot;|.&quot;<br>
}<br>
<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \clef &quot;G_8&quot;  \alotofstuff }<br>
      \new TabStaff { \clef &quot;tab&quot; \alotofstuff }<br>
   &gt;&gt;<br>
}<br>
<br>
\markup{When we invoke tabNumbersOnly, it looks better.}<br>
<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \clef &quot;G_8&quot; \alotofstuff }<br>
      \new TabStaff   { \tabNumbersOnly \alotofstuff }<br>
   &gt;&gt;<br>
}<br>
<br>
\markup{ <a href="http://tablature.ly" target="_blank">tablature.ly</a> supports an easy way to mark notes as played palm mute-style...}<br>
<br>
palmmute = \relative c, {<br>
    \time 4/4<br>
    e8^\markup { \musicglyph #&quot;noteheads.u2do&quot;  = palm mute } \palmMuteOn e e \palmMuteOff  e e  \palmMute e e e<br>
    e8 \palmMute { e e e } e e e e<br>
    \palmMuteOn<br>
    &lt; e b&#39; e&gt;8 e e e &lt;e b&#39; e&gt;2<br>
    \bar &quot;|.&quot;<br>
}<br>
<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \clef &quot;G_8&quot; \palmmute }<br>
      \new TabStaff  { \clef &quot;moderntab&quot;<br>
                       \palmmute }<br>
   &gt;&gt;<br>
}<br>
<br>
\markup {... or dead notes:}<br>
<br>
deadnotes = \relative c,, {<br>
   e8. \deadNotesOn e16 \deadNotesOff g4 a b<br>
   e8. \deadNotes e16 g4 a b<br>
   e,4. \deadNotes { e8 e e } e4<br>
   \bar &quot;|.&quot;<br>
}<br>
<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \clef &quot;bass_8&quot; \deadnotes }<br>
      \new TabStaff  { \set TabStaff.stringTunings =  #bass-four-string-tuning<br>
                       \clef &quot;moderntab&quot;<br>
                       \deadnotes }<br>
   &gt;&gt;<br>
}<br>
<br>
\markup { The new sansSerifTab-Clef supports tablatures from 4 to 7 strings.}<br>
% some stuff<br>
bass = \relative c,, {<br>
   e4 g a b<br>
   b4 f g d&#39;<br>
   \bar &quot;|.&quot;<br>
}<br>
<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \mark \markup{4 strings}<br>
                   \clef &quot;bass_8&quot; \bass }<br>
      \new TabStaff   { \set TabStaff.stringTunings =   #bass-four-string-tuning<br>
                        \bass }<br>
   &gt;&gt;<br>
}<br>
<br>
% five strings, calculated clef<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \mark \markup{5 strings}<br>
                   \clef &quot;bass_8&quot; \bass }<br>
      \new TabStaff   { \set TabStaff.stringTunings =  #bass-five-string-tuning<br>
                        \bass }<br>
   &gt;&gt;<br>
}<br>
<br>
guitar = \relative c {<br>
   c4 d e f<br>
   g4 a b c<br>
   \bar &quot;|.&quot;<br>
}<br>
<br>
% six strings, calculated clef<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \mark \markup{6 strings}<br>
                   \clef &quot;G_8&quot; \guitar }<br>
      \new TabStaff   { \set TabStaff.stringTunings = #guitar-tuning<br>
                        \guitar }<br>
   &gt;&gt;<br>
}<br>
<br>
% seven strings, calculated clef<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \mark \markup{7 strings}<br>
                   \clef &quot;G_8&quot; \guitar }<br>
      \new TabStaff   { \clef &quot;moderntab&quot;<br>
                        \set TabStaff.stringTunings = #guitar-seven-string-tuning<br>
                        \guitar }<br>
   &gt;&gt;<br>
}<br>
<br>
% seven strings, calculated clef<br>
\score {<br>
   &lt;&lt;<br>
      \new Staff { \mark \markup{7 strings, staff space 1.2}<br>
                   \clef &quot;G_8&quot; \guitar }<br>
      \new TabStaff   { \clef &quot;moderntab&quot; \override TabStaff.StaffSymbol #&#39;staff-space = #1.2<br>
                        \set TabStaff.stringTunings =  #guitar-seven-string-tuning<br>
                        \guitar }<br>
   &gt;&gt;<br>
}<br>
<br>
<br>
<br></blockquote></div><br>