<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- header_tag --> <html lang="en"> <head> <title>Fretted strings - LilyPond snippets</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="description" content="LilyPond snippets"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="prev" href="Percussion.html#Percussion" title="Percussion"> <link rel="next" href="Unfretted-strings.html#Unfretted-strings" title="Unfretted strings"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } hr { border:0; height:1; color: #000000; background-color: #000000; } /* hr { border: none; height: 1px; color: #666666; background-color: #666666; } body { border-left: 1px solid #666666; border-right: 1px solid #666666; color: #332d28; margin-right: auto; margin-left: auto; width: 60em; list-style-type: square; font-family: Arial,Helvetica,sans-serif; padding-right: 1em; padding-left: 1em; } a { border-bottom: 1px dashed #344242; text-decoration: none; color: #344242; } a:link { text-decoration: none; } a:visited { border-bottom: 1px dashed #666666; color: #666666; } a:active { border-bottom: 1px solid #00cccc; color: #00cccc; } a:hover { border-bottom: 1px solid #1d7b85; color: #1d7b85; } blockquote { border: 1px solid #cccccc; padding: 3px; width: 40em; } .node { border-left: 1px solid #666666; margin: -0.5em 0px 1em; padding: 2px 1px 0px; font-style: italic; } .node a { border: none; text-decoration: underline; font-style: normal; font-weight: bold; } .verbatim { font-family: "Courier New",Courier,monospace; } .unnumberedsubsubsec { font-size: large; color: #1d7b85; } .subsubheading { font-size: large; color: #3b220d; } .contents { border: 1px dashed #339999; margin: 3px 2em; list-style-type: square; padding-right: 1em; width: 40em; background-color: #fcfff9; } .contents a { border-bottom: 1px dashed #423d34; text-decoration: none; color: #423d34; } .contents a:visited { border-bottom: 1px dashed #666666; color: #666666; } .contents a:active { border-bottom: 1px solid #f0d86d; color: #f0d86d; } .contents a:hover { border-bottom: 1px solid #3b220d; color: #3b220d; } .menu { border-left: 1px dashed #339999; margin: 3px 2em 1em; list-style-type: square; padding-left: 1.4em; width: 40em; } .unnumbered { } h2 { font-size: x-large; color: #1d7b85; } */ --></style> </head> <BODY BGCOLOR=WHITE TEXT=BLACK> <div class="node"> <p> <a name="Fretted-strings"></a> Next: <a rel="next" accesskey="n" href="Unfretted-strings.html#Unfretted-strings">Unfretted strings</a>, Previous: <a rel="previous" accesskey="p" href="Percussion.html#Percussion">Percussion</a>, Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> <hr> </div> <h2 class="unnumbered">Fretted strings</h2> <p>These snippets illustrate the Notation Reference, section <a href="../../../Documentation/user/lilypond/Fretted-string-instruments.html#Fretted-string-instruments">Fretted string instruments</a>. <p><a name="adding-fingerings-to-a-score.ly"></a> <h3 class="unnumberedsec">Adding fingerings to a score</h3> <p>Fingering instructions can be entered using a simple syntax. <pre class="verbatim"> \relative c'' { c4-1 d-2 f-4 e-3 } </pre> <p> <a href="../c8/lily-da20b121.ly"> <img align="middle" border="0" src="../c8/lily-da20b121.png" alt="[image of music]"> </a> </p> <p><a name="adding-fingerings-to-tablatures.ly"></a> <h3 class="unnumberedsec">Adding fingerings to tablatures</h3> <p>To add fingerings to tablatures, use a combination of <code>\markup</code> and <code>\finger</code>. <pre class="verbatim"> one = \markup { \finger 1 } two = \markup { \finger 2 } threeTwo = \markup { \override #'(baseline-skip . 2) \column { \finger 3 \finger 2 } } threeFour = \markup { \override #'(baseline-skip . 2) \column { \finger 3 \finger 4 } } \score { \new TabStaff { \stemUp e8\4^\one b\2 <e, g\3 e'\1>^>[ b\2 e\4] <a\3 fis'\1>^>^\threeTwo[ b\2 e\4] } } </pre> <p> <a href="../10/lily-8706a1a6.ly"> <img align="middle" border="0" src="../10/lily-8706a1a6.png" alt="[image of music]"> </a> </p> <p><a name="allowing-fingerings-to-be-printed-inside-the-staff.ly"></a> <h3 class="unnumberedsec">Allowing fingerings to be printed inside the staff</h3> <p>By default, fingering numbers will be printed outside the staff. However, this behavior can be canceled. <pre class="verbatim"> \relative c' { <c-1 e-2 g-3 b-5>2 \once \override Fingering #'staff-padding = #'() <c-1 e-2 g-3 b-5>2 } </pre> <p> <a href="../51/lily-3f70c2ad.ly"> <img align="middle" border="0" src="../51/lily-3f70c2ad.png" alt="[image of music]"> </a> </p> <p><a name="controlling-the-placement-of-chord-fingerings.ly"></a> <h3 class="unnumberedsec">Controlling the placement of chord fingerings</h3> <p>The placement of fingering numbers can be controlled precisely. <pre class="verbatim"> \relative c' { \set fingeringOrientations = #'(left) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(down) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(right) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(up) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(left down) <c-1 e-3 a-5>2 \set fingeringOrientations = #'(up right down) <c-1 e-3 a-5>2 } </pre> <p> <a href="../de/lily-34875599.ly"> <img align="middle" border="0" src="../de/lily-34875599.png" alt="[image of music]"> </a> </p> <p><a name="customizing-fretboard-fret-diagrams.ly"></a> <h3 class="unnumberedsec">Customizing fretboard fret diagrams</h3> <p>Fret diagram properties can be set through <code>fret-diagram-details</code>. For FretBoard fret diagrams, overrides are applied to the <code>FretBoards.FretBoard</code> object. <pre class="verbatim"> \include "predefined-guitar-fretboards.ly" \storePredefinedDiagram \chordmode { c' } #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);" << \context ChordNames { \chordmode { c1 c c d } } \context FretBoards { % Set global properties of fret diagram \override FretBoards.FretBoard #'size = #'1.2 \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'in-dot \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'white \chordmode { c \once \override FretBoards.FretBoard #'size = #'1.0 \once \override FretBoards.FretBoard #'fret-diagram-details #'barre-type = #'straight \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'black \once \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'below-string c' \once \override FretBoards.FretBoard #'fret-diagram-details #'barre-type = #'none \once \override FretBoards.FretBoard #'fret-diagram-details #'number-type = #'arabic \once \override FretBoards.FretBoard #'fret-diagram-details #'orientation = #'landscape \once \override FretBoards.FretBoard #'fret-diagram-details #'mute-string = #"M" \once \override FretBoards.FretBoard #'fret-diagram-details #'label-dir = #-1 \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'black c' \once \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'below-string \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-radius = #0.35 \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-position = #0.5 \once \override FretBoards.FretBoard #'fret-diagram-details #'fret-count = #3 d } } \context Voice { c'1 c' c' d' } >> </pre> <p> <a href="../25/lily-db5de719.ly"> <img align="middle" border="0" src="../25/lily-db5de719.png" alt="[image of music]"> </a> </p> <p><a name="customizing-markup-fret-diagrams.ly"></a> <h3 class="unnumberedsec">Customizing markup fret diagrams</h3> <p>Fret diagram properties can be set through <code>fret-diagram-details</code>. For markup fret diagrams, overrides can be applied to the <code>Voice.TextScript</code> object or directly to the markup. <pre class="verbatim"> << \chords { c1 c c d } \new Voice = "mel" { \textLengthOn % Set global properties of fret diagram \override Voice.TextScript #'size = #'1.2 \override Voice.TextScript #'fret-diagram-details #'finger-code = #'in-dot \override Voice.TextScript #'fret-diagram-details #'dot-color = #'white %% C major for guitar, no barre, using defaults % terse style c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" } %% C major for guitar, barred on third fret % verbose style % size 1.0 % roman fret label, finger labels below string, straight barre c'1^\markup { % standard size \override #'(size . 1.0) { \override #'(fret-diagram-details . ( (number-type . roman-lower) (finger-code . in-dot) (barre-type . straight))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } } %% C major for guitar, barred on third fret % verbose style % landscape orientation, arabic numbers, M for mute string % no barre, fret label down or left, small mute label font c'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (number-type . arabic) (label-dir . -1) (mute-string . "M") (orientation . landscape) (barre-type . none) (xo-font-magnification . 0.4) (xo-padding . 0.3))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } %% simple D chord % terse style % larger dots, centered dots, fewer frets % label below string d'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (dot-radius . 0.35) (dot-position . 0.5) (fret-count . 3))) { \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" } } } >> </pre> <p> <a href="../b0/lily-97afdcd2.ly"> <img align="middle" border="0" src="../b0/lily-97afdcd2.png" alt="[image of music]"> </a> </p> <p><a name="faking-a-hammer-in-tablatures.ly"></a> <h3 class="unnumberedsec">Faking a hammer in tablatures</h3> <p>A hammer in tablature can be faked with slurs. <pre class="verbatim"> \score { \new TabStaff { \relative c'' { c4( d) d( d) d2( c) } } } </pre> <p> <a href="../a3/lily-b42f6b20.ly"> <img align="middle" border="0" src="../a3/lily-b42f6b20.png" alt="[image of music]"> </a> </p> <p><a name="fingerings,-string-indications,-and-right-hand-fingerings.ly"></a> <h3 class="unnumberedsec">Fingerings, string indications, and right-hand fingerings</h3> <p>This example combines left-hand fingering, string indications, and right-hand fingering. <pre class="verbatim"> #(define RH rightHandFinger) \relative c { \clef "treble_8" <c-3\5-\RH #1 >4 <e-2\4-\RH #2 >4 <g-0\3-\RH #3 >4 <c-1\2-\RH #4 >4 } </pre> <p> <a href="../b8/lily-c4d886c0.ly"> <img align="middle" border="0" src="../b8/lily-c4d886c0.png" alt="[image of music]"> </a> </p> <p><a name="flamenco-notation.ly"></a> <h3 class="unnumberedsec">Flamenco notation</h3> <p>For flamenco guitar, special notation is used: <p>* a golpe symbol to indicate a slap on the guitar body with the nail of the ring finger <p>* an arrow to indicate (the direction of) strokes <p>* different letters for fingering ("p": thumb, "i": index finger, "m": middle finger, "a": ring finger and "x": little finger) <p>* 3- and 4-finger rasgueados; stroke upwards with all fingers, ending with an up- and down using the index finger <p>* abanicos: strokes (in tuples) with thumb (down), little and index finger (both up). There's also an abanico 2 where middle and ring finger are used instead of the little finger. <p>* alza pua: fast playing with the thumb <p>Most figures use arrows in combination with fingering; with abanicos and rasgueados, noteheads are printed only for the first chord. <p>This snippet contains some header-like code that can be copied as ‘<samp><span class="samp">flamenco.ly</span></samp>’ and included in source files. <pre class="verbatim"> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% Cut here ----- Start 'flamenco.ly' % Text indicators abanico = \markup { \italic Abanico } rasgueaso = \markup { \italic Ras. } alzapua = \markup { \italic Alzapua } % Finger stroke symbols strokeUp = \markup { \postscript #" 0.1 setlinewidth 0.5 0 moveto 0.5 2 lineto 0.2 1.4 lineto 0.5 2 moveto 0.8 1.4 lineto stroke "} strokeDown = \markup { \postscript #" 0.1 setlinewidth 0.5 2 moveto 0.5 0 lineto 0.2 0.6 lineto 0.5 0 moveto 0.8 0.6 lineto stroke "} % Golpe symbol golpe = \markup { \postscript #" 0.2 setlinewidth 0 0 moveto 1 0 lineto 1 1 lineto stroke "\postscript #" 0.1 setlinewidth -0.6 -0.1 moveto -0.6 1.0 lineto 0.5 1.0 lineto stroke "} strokeUpGolpe = \markup { \column { \golpe \line { \strokeUp }}} iUpGolpe = \markup { \column { \golpe \line { \small i } \line { \strokeUp }}} % Strokes for all fingers pUp = \markup { \column { \small p \line { \strokeUp }}} pDown = \markup { \column { \small p \line { \strokeDown }}} iUp = \markup { \column { \small i \line { \strokeUp }}} iDown = \markup { \column { \small i \line { \strokeDown }}} mUp = \markup { \column { \small m \line { \strokeUp }}} mDown = \markup { \column { \small m \line { \strokeDown }}} aUp = \markup { \column { \small a \line { \strokeUp }}} aDown = \markup { \column { \small a \line { \strokeDown }}} xUp = \markup { \column { \small x \line { \strokeUp }}} xDown = \markup { \column { \small x \line { \strokeDown }}} % Just handy :) tupletOff = { \once \override TupletNumber #'stencil = ##f \once \override TupletBracket #'stencil = ##f } tupletsOff = { \override TupletNumber #'stencil = ##f \override TupletBracket #'bracket-visibility = #'if-no-beam } tupletsOn = { \override TupletBracket #'bracket-visibility = #'default \revert TupletNumber #'stencil } headsOff = { \override TabNoteHead #'transparent = ##t \override NoteHead #'transparent = ##t \override NoteHead #'no-ledgers = ##t } headsOn = { \override TabNoteHead #'transparent = ##f \override NoteHead #'transparent = ##f \override NoteHead #'no-ledgers = ##f } %%%%%%% Cut here ----- End 'flamenco.ly' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% part = \relative c' { <a, e' a cis e>8^\iUp <a e' a cis e>8^\iDown r4 r2^\golpe <a e' a cis e>8^\iUp <a e' a cis e>8^\iDown <a e' a cis e>8^\iUpGolpe <a e' a cis e>8^\iDown r2 <a e' a cis e>16^\aUp \headsOff <a e' a cis e>^\mUp <a e' a cis e>^\iUp <a e' a cis e>^\iDown~ \headsOn <a e' a cis e>2 r4 \tupletOff \times 4/5 { <a e' a cis e>16^\xUp \headsOff <a e' a cis e>^\aUp <a e' a cis e>^\mUp <a e' a cis e>^\iUp <a e' a cis e>^\iDown~ \headsOn } <a e' a cis e>2 r4 \tupletsOff \times 2/3 { <a e' a cis e>8^\pDown \headsOff <a e' a cis e>^\xUp <a e' a cis e>^\iUp \headsOn } \times 2/3 { <a e' a cis e>8^\pDown \headsOff <a e' a cis e>^\xUp <a e' a cis e>^\iUp \headsOn } \times 2/3 { <a e' a cis e>8^\pDown \headsOff <a e' a cis e>^\xUp <a e' a cis e>^\iUp \headsOn } \times 2/3 { <a e' a cis e>8^\pDown \headsOff <a e' a cis e>^\xUp <a e' a cis e>^\iUp \headsOn } \tupletsOff \override Beam #'positions = #'(2 . 2) \times 2/3 { a8^\markup{ \small p } <e' a>^\strokeUpGolpe <e a>^\strokeDown } \times 2/3 { a,8^\markup{ \small p } <e' a>^\strokeUpGolpe <e a>^\strokeDown } \times 2/3 { a,8^\markup{ \small p } <e' a>^\strokeUpGolpe <e a>^\strokeDown } \times 2/3 { a,8^\markup{ \small p } <e' a>^\strokeUpGolpe <e a>^\strokeDown } \tupletsOn \once \override TextScript #'extra-offset = #'(0 . -1) <g, b f'>1_\golpe^\mUp \bar "|." } \score { \new StaffGroup << \context Staff = "part" << \clef G \transpose c c' { \part } >> \context TabStaff { \part } >> \layout { ragged-right = ##t } } </pre> <p> <a href="../c3/lily-867b8c3f.ly"> <img align="middle" border="0" src="../c3/lily-867b8c3f.png" alt="[image of music]"> </a> </p> <p><a name="fret-diagrams-explained-and-developed.ly"></a> <h3 class="unnumberedsec">Fret diagrams explained and developed</h3> <p>This snippet shows many possibilities for obtaining and tweaking fret diagrams. <pre class="verbatim"> << \chords { a2 a c2 c d1 } \new Voice = "mel" { \textLengthOn % Set global properties of fret diagram \override Voice.TextScript #'size = #1.2 \override Voice.TextScript #'fret-diagram-details #'finger-code = #'below-string \override Voice.TextScript #'fret-diagram-details #'dot-color = #'black %% A chord for ukelele a'2^\markup { \override #'(fret-diagram-details . ( (string-count . 4) (dot-color . white) (finger-code . in-dot))) { \fret-diagram #"4-2-2;3-1-1;2-o;1-o;" } } %% A chord for ukelele, with formatting defined in definition string % 1.2 * size, 4 strings, 4 frets, fingerings below string % dot radius .35 of fret spacing, dot position 0.55 of fret spacing a'2^\markup { \override #'(fret-diagram-details . ( (dot-color . white) (open-string . "o"))) { \fret-diagram #"s:1.2;w:4;h:3;f:2;d:0.35;p:0.55;4-2-2;3-1-1;2-o;1-o;" } } %% C major for guitar, barred on third fret % verbose style % roman fret label, finger labels below string, straight barre c'2^\markup { % 110% of default size \override #'(size . 1.1) { \override #'(fret-diagram-details . ( (number-type . roman-lower) (finger-code . below-string) (barre-type . straight))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } } %% C major for guitar, barred on third fret % verbose style c'2^\markup { % 110% of default size \override #'(size . 1.1) { \override #'(fret-diagram-details . ( (number-type . arabic) (dot-label-font-mag . 0.9) (finger-code . in-dot) (fret-label-font-mag . 0.6) (fret-label-vertical-offset . 0) (label-dir . -1) (mute-string . "M") (orientation . landscape) (xo-font-magnification . 0.4) (xo-padding . 0.3))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } } %% simple D chord d'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (dot-radius . 0.35) (dot-position . 0.5) (fret-count . 3))) { \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" } } } >> </pre> <p> <a href="../a3/lily-807ee76a.ly"> <img align="middle" border="0" src="../a3/lily-807ee76a.png" alt="[image of music]"> </a> </p> <p><a name="how-to-change-fret-diagram-position.ly"></a> <h3 class="unnumberedsec">How to change fret diagram position</h3> <p>If you want to move the position of a fret diagram, for example, to avoid collision, or to place it between two notes, you have various possibilities: <p>1) modify #'padding or #'extra-offset values (as shown in the first snippet) <p>2) you can add an invisible voice and attach the fret diagrams to the invisible notes in that voice (as shown in the second example). <p>If you need to move the fret according with a rythmic position inside the bar (in the example, the third beat of the measure) the second example is better, because the fret is aligned with the third beat itself. <pre class="verbatim"> harmonies = \chordmode { a8:13 % THE FOLLOWING IS THE COMMAND TO MOVE THE CHORD NAME \once \override ChordNames.ChordName #'extra-offset = #'(10 . 0) b8:13 s2. % THIS LINE IS THE SECOND METHOD s4 s4 b4:13 } \score { << \context ChordNames \harmonies \context Staff {a8^\markup { \fret-diagram #"6-x;5-0;4-2;3-0;2-0;1-2;" } % THE FOLLOWING IS THE COMMAND TO MOVE THE FRET DIAGRAM \once \override TextScript #'extra-offset = #'(10 . 0) b4.~^\markup { \fret-diagram #"6-x;5-2;4-4;3-2;2-2;1-4;" } b4. a8\break % HERE IS THE SECOND METHOD << { a8 b4.~ b4. a8} { s4 s4 s4^\markup { \fret-diagram #"6-x;5-2;4-4;3-2;2-2;1-4;" } } >> } >> } </pre> <p> <a href="../e8/lily-3ffb84ab.ly"> <img align="middle" border="0" src="../e8/lily-3ffb84ab.png" alt="[image of music]"> </a> </p> <p><a name="jazz-combo-template.ly"></a> <h3 class="unnumberedsec">Jazz combo template</h3> <p>This is quite an advanced template, for a jazz ensemble. Note that all instruments are notated in <code>\key c \major</code>. This refers to the key in concert pitch; the key will be automatically transposed if the music is within a <code>\transpose</code> section. <pre class="verbatim"> \header { title = "Song" subtitle = "(tune)" composer = "Me" meter = "moderato" piece = "Swing" tagline = \markup { \column { "LilyPond example file by Amelie Zapf," "Berlin 07/07/2003" } } } %#(set-global-staff-size 16) \include "english.ly" %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%% sl = { \override NoteHead #'style = #'slash \override Stem #'transparent = ##t } nsl = { \revert NoteHead #'style \revert Stem #'transparent } crOn = \override NoteHead #'style = #'cross crOff = \revert NoteHead #'style %% insert chord name style stuff here. jazzChords = { } %%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%% global = { \time 4/4 } Key = { \key c \major } % ############ Horns ############ % ------ Trumpet ------ trpt = \transpose c d \relative c'' { \Key c1 | c | c | } trpHarmony = \transpose c' d { \jazzChords } trumpet = { \global \set Staff.instrumentName = #"Trumpet" \clef treble << \trpt >> } % ------ Alto Saxophone ------ alto = \transpose c a \relative c' { \Key c1 | c | c | } altoHarmony = \transpose c' a { \jazzChords } altoSax = { \global \set Staff.instrumentName = #"Alto Sax" \clef treble << \alto >> } % ------ Baritone Saxophone ------ bari = \transpose c a' \relative c { \Key c1 c1 \sl d4^"Solo" d d d \nsl } bariHarmony = \transpose c' a \chordmode { \jazzChords s1 s d2:maj e:m7 } bariSax = { \global \set Staff.instrumentName = #"Bari Sax" \clef treble << \bari >> } % ------ Trombone ------ tbone = \relative c { \Key c1 | c | c } tboneHarmony = \chordmode { \jazzChords } trombone = { \global \set Staff.instrumentName = #"Trombone" \clef bass << \tbone >> } % ############ Rhythm Section ############# % ------ Guitar ------ gtr = \relative c'' { \Key c1 \sl b4 b b b \nsl c1 } gtrHarmony = \chordmode { \jazzChords s1 c2:min7+ d2:maj9 } guitar = { \global \set Staff.instrumentName = #"Guitar" \clef treble << \gtr >> } %% ------ Piano ------ rhUpper = \relative c'' { \voiceOne \Key c1 | c | c } rhLower = \relative c' { \voiceTwo \Key e1 | e | e } lhUpper = \relative c' { \voiceOne \Key g1 | g | g } lhLower = \relative c { \voiceTwo \Key c1 | c | c } PianoRH = { \clef treble \global \set Staff.midiInstrument = #"acoustic grand" << \new Voice = "one" \rhUpper \new Voice = "two" \rhLower >> } PianoLH = { \clef bass \global \set Staff.midiInstrument = "acoustic grand" << \new Voice = "one" \lhUpper \new Voice = "two" \lhLower >> } piano = { << \set PianoStaff.instrumentName = #"Piano" \new Staff = "upper" \PianoRH \new Staff = "lower" \PianoLH >> } % ------ Bass Guitar ------ Bass = \relative c { \Key c1 | c | c } bass = { \global \set Staff.instrumentName = #"Bass" \clef bass << \Bass >> } % ------ Drums ------ up = \drummode { \voiceOne hh4 <hh sn> hh <hh sn> hh4 <hh sn> hh <hh sn> hh4 <hh sn> hh <hh sn> } down = \drummode { \voiceTwo bd4 s bd s bd4 s bd s bd4 s bd s } drumContents = { \global << \set DrumStaff.instrumentName = #"Drums" \new DrumVoice \up \new DrumVoice \down >> } %%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%% \score { << \new StaffGroup = "horns" << \new Staff = "trumpet" \trumpet \new Staff = "altosax" \altoSax \new ChordNames = "barichords" \bariHarmony \new Staff = "barisax" \bariSax \new Staff = "trombone" \trombone >> \new StaffGroup = "rhythm" << \new ChordNames = "chords" \gtrHarmony \new Staff = "guitar" \guitar \new PianoStaff = "piano" \piano \new Staff = "bass" \bass \new DrumStaff \drumContents >> >> \layout { \context { \RemoveEmptyStaffContext } \context { \Score \override BarNumber #'padding = #3 \override RehearsalMark #'padding = #2 skipBars = ##t } } \midi { } } </pre> <p> <a href="../ea/lily-36b7ad93.ly"> <img align="middle" border="0" src="../ea/lily-36b7ad93.png" alt="[image of music]"> </a> </p> <p><a name="laissez-vibrer-ties.ly"></a> <h3 class="unnumberedsec">Laissez vibrer ties</h3> <p>Laissez vibrer ties have a fixed size. Their formatting can be tuned using <code>'tie-configuration</code>. <pre class="verbatim"> \relative c' { <c e g>4\laissezVibrer r <c f g>\laissezVibrer r <c d f g>4\laissezVibrer r <c d f g>4.\laissezVibrer r8 <c d e f>4\laissezVibrer r \override LaissezVibrerTieColumn #'tie-configuration = #`((-7 . ,DOWN) (-5 . ,DOWN) (-3 . ,UP) (-1 . ,UP)) <c d e f>4\laissezVibrer r } </pre> <p> <a href="../fd/lily-61b8d987.ly"> <img align="middle" border="0" src="../fd/lily-61b8d987.png" alt="[image of music]"> </a> </p> <p><a name="letter-tablature-formatting.ly"></a> <h3 class="unnumberedsec">Letter tablature formatting</h3> <p>Tablature can be formatted using letters instead of numbers. <pre class="verbatim"> #(define (letter-tablature-format str context event) (let* ((tuning (ly:context-property context 'stringTunings)) (pitch (ly:event-property event 'pitch))) (make-whiteout-markup (make-vcenter-markup (string (integer->char (+ (char->integer #\a) (- (ly:pitch-semitones pitch) (list-ref tuning (- str 1)))))))))) music = \relative c { c4 d e f g4 a b c d4 e f g } << \new Staff { \clef "G_8" \music } \new TabStaff \with { tablatureFormat = #letter-tablature-format } { \music } >> </pre> <p> <a href="../06/lily-8b6a0e98.ly"> <img align="middle" border="0" src="../06/lily-8b6a0e98.png" alt="[image of music]"> </a> </p> <p><a name="modern-tab-text-clef.ly"></a> <h3 class="unnumberedsec">Modern TAB text clef</h3> <p>Use a markup text to replace the (TAB) clef glyph with a modern font. <pre class="verbatim"> TAB = \markup { \raise #1.5 \sans \bold \huge \override #'(baseline-skip . 2.5) \center-column { T A B } } \new TabStaff { \override Staff.Clef #'stencil = #(lambda (grob) ly:clef::print (grob-interpret-markup grob TAB)) a } </pre> <p> <a href="../d9/lily-7ff0d7c4.ly"> <img align="middle" border="0" src="../d9/lily-7ff0d7c4.png" alt="[image of music]"> </a> </p> <p><a name="placement-of-right-hand-fingerings.ly"></a> <h3 class="unnumberedsec">Placement of right-hand fingerings</h3> <p>It is possible to exercise greater control over the placement of right-hand fingerings by setting a specific property, as demonstrated in the following example. <pre class="verbatim"> #(define RH rightHandFinger) \relative c { \clef "treble_8" \set strokeFingerOrientations = #'(up down) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >4 \set strokeFingerOrientations = #'(up right down) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >4 \set strokeFingerOrientations = #'(left) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >2 } </pre> <p> <a href="../c4/lily-716f1902.ly"> <img align="middle" border="0" src="../c4/lily-716f1902.png" alt="[image of music]"> </a> </p> <p><a name="polyphony-in-tablature.ly"></a> <h3 class="unnumberedsec">Polyphony in tablature</h3> <p>Polyphony is created the same way in a <code>TabStaff</code> as in a regular staff. <pre class="verbatim"> upper = \relative c' { \time 12/8 \key e \minor \voiceOne r4. r8 e, fis g16 b g e e' b c b a g fis e } lower = \relative c { \key e \minor \voiceTwo r16 e d c b a g4 fis8 e fis g a b c } \score { << \new StaffGroup = "tab with traditional" << \new Staff = "guitar traditional" << \clef "treble_8" \context Voice = "upper" \upper \context Voice = "lower" \lower >> \new TabStaff = "guitar tab" << \context TabVoice = "upper" \upper \context TabVoice = "lower" \lower >> >> >> } </pre> <p> <a href="../d1/lily-8daee2d6.ly"> <img align="middle" border="0" src="../d1/lily-8daee2d6.png" alt="[image of music]"> </a> </p> <p><a name="stem-and-beam-behavior-in-tablature.ly"></a> <h3 class="unnumberedsec">Stem and beam behavior in tablature</h3> <p>The direction of stems is controlled the same way in tablature as in traditional notation. Beams can be made horizontal, as shown in this example. <pre class="verbatim"> \new TabStaff { \relative c { g16 b d g b d g b \stemDown \override Beam #'damping = #+inf.0 g,,16 b d g b d g b } } </pre> <p> <a href="../e7/lily-1c507d5a.ly"> <img align="middle" border="0" src="../e7/lily-1c507d5a.png" alt="[image of music]"> </a> </p> <!-- footer_tag --><br><hr> <div class="node"> <p> Next: <a rel="next" accesskey="n" href="Unfretted-strings.html#Unfretted-strings">Unfretted strings</a>, Previous: <a rel="previous" accesskey="p" href="Percussion.html#Percussion">Percussion</a>, Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> </div> <div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;"> <p> <font size="-1"> This page is for LilyPond-2.11.57 (development-branch). <br> <address> Report errors to <a href="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs">http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs</a>. </address> <br> Your <a href="http://lilypond.org/web/devel/participating/documentation-adding">suggestions for the documentation</a> are welcome. </font> </p> </div> </BODY></html>