Tab clef with strings labeled: Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 1: | Line 1: | ||
This snippet overrides the stencil for the Tab clef to include the string names. Useful for creating tabs for beginner guitarists or for tabs where a non-standard tuning is used. You can select the classic tab clef or the modern tab clef. | This snippet overrides the stencil for the Tab clef to include the string names. Useful for creating tabs for beginner guitarists or for tabs where a non-standard tuning is used. You can select the classic tab clef or the modern tab clef. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
myTabclef = | myTabclef = | ||
#(define-music-function () () | #(define-music-function () () | ||
Revision as of 18:55, 16 November 2025
This snippet overrides the stencil for the Tab clef to include the string names. Useful for creating tabs for beginner guitarists or for tabs where a non-standard tuning is used. You can select the classic tab clef or the modern tab clef.
\version "2.24"
myTabclef =
#(define-music-function () ()
#{
\override Staff.Clef.stencil = #ly:text-interface::print
\override Staff.Clef.text = \markup {
\vcenter
\fontsize #-4
\override #'(baseline-skip . 1.5)
\center-column
\sans \bold \whiteout { E B G D A E }
% Select classic or modern TAB; comment out the one you don't
% want to use.
% music glyph version
\vcenter \musicglyph "clefs.tab"
% modern tab version
% \vcenter
% \fontsize #2
% \override #'(baseline-skip . 2.4)
% \center-column
% \sans \bold { T A B }
}
#})
classicalGuitar = {
\time 4/4
c'4 d' e' f'
}
\new StaffGroup <<
\new Staff {
\clef "treble_8"
\classicalGuitar
}
\new TabStaff \with {
\myTabclef
stringTunings = #guitar-tuning
} \classicalGuitar
>>