Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 3a7b4dfc766af1222d90c7f03a0844e6 > files > 7310

lilypond-doc-2.11.57-1mdv2009.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- header_tag -->
<html lang="en">
<head>
<title>Fret diagram markups - GNU LilyPond Notation Reference</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="GNU LilyPond Notation Reference">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Common-notation-for-fretted-strings.html#Common-notation-for-fretted-strings" title="Common notation for fretted strings">
<link rel="prev" href="Custom-tablatures.html#Custom-tablatures" title="Custom tablatures">
<link rel="next" href="Predefined-fret-diagrams.html#Predefined-fret-diagrams" title="Predefined fret diagrams">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1999--2007 by the authors

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.1 or any later version published by the Free Software
     Foundation; with no Invariant Sections.  A copy of the license is
     included in the section entitled ``GNU Free Documentation
     License''.
   -->
<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="Fret-diagram-markups"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Predefined-fret-diagrams.html#Predefined-fret-diagrams">Predefined fret diagrams</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Custom-tablatures.html#Custom-tablatures">Custom tablatures</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Common-notation-for-fretted-strings.html#Common-notation-for-fretted-strings">Common notation for fretted strings</a>
<hr>
</div>

<h5 class="unnumberedsubsubsec">Fret diagram markups</h5>

<p><a name="index-fret-diagrams-2091"></a><a name="index-chord-diagrams-2092"></a>
Fret diagrams can be added to music as a markup to the desired
note.  The markup contains information about the desired fret
diagram.  There are three different fret-diagram markup
interfaces: standard, terse, and verbose.  The three interfaces
produce equivalent markups, but have varying amounts of
information in the markup string.  Details about the markup
interfaces are found at <a href="Text-markup-commands.html#Text-markup-commands">Text markup commands</a>.

   <p>The standard fret diagram markup string indicates the string
number and the fret number for each dot to be placed on the string. 
In addition, open and unplayed (muted) strings can be indicated.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode { 
            c1 d:m          
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup 
           \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;"
         &lt; d a d' f'> ^\markup
           \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;"
       }  
     >>
</pre>
     <p>
 <a href="../f8/lily-a3984dce.ly">
  <img align="middle"
    border="0" src="../f8/lily-a3984dce.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Barre indications can be added to the diagram from
the fret-diagram markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            f1 g
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; f, c f a c' f'>1 ^\markup
           \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
         &lt; g, d g b d' g'> ^\markup
           \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;"
       }
     >>
</pre>
     <p>
 <a href="../28/lily-fbecb24d.ly">
  <img align="middle"
    border="0" src="../28/lily-fbecb24d.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>The size of the fret diagram, and the number of frets in the diagram
can be changed in the fret-diagram markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            f1 g
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; f, c f a c' f'>1 ^\markup
           \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
         &lt; g, b, d g b g'> ^\markup
           \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;"
       }
     >>
</pre>
     <p>
 <a href="../55/lily-83cf644d.ly">
  <img align="middle"
    border="0" src="../55/lily-83cf644d.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>The number of strings in a fret diagram can be changed to accomodate
different instruments such as banjos and ukeleles with the fret-diagram
markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            a1
          }
       }
       \context Staff {
             %% A chord for ukelele
         a'1 ^\markup \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;"
       }
     >>
</pre>
     <p>
 <a href="../4c/lily-7e740a2e.ly">
  <img align="middle"
    border="0" src="../4c/lily-7e740a2e.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Fingering indications can be added, and the location of fingering labels
can be controlled by the fret-diagram markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode { 
            c1 d:m          
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup 
           \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;"
         &lt; d a d' f'> ^\markup
           \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;"
       }  
     >>
</pre>
     <p>
 <a href="../12/lily-324dadff.ly">
  <img align="middle"
    border="0" src="../12/lily-324dadff.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Dot radius and dot position can be controlled with the fret-diagram
markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode { 
            c1 d:m          
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup 
           \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;"
         &lt; d a d' f'> ^\markup
           \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;"
       }  
     >>
</pre>
     <p>
 <a href="../44/lily-1bfbbecb.ly">
  <img align="middle"
    border="0" src="../44/lily-1bfbbecb.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>The fret-diagram-terse markup string omits string numbers; the string
number is implied by the presence of semicolons.  There is one semicolon
for each string in the diagram.  The first semicolon corresponds to the
highest string number and the last semicolon corresponds to the first string. 
Mute strings, open strings, and fret numbers can be indicated.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            c1 d:m
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup
           \fret-diagram-terse #"x;3;2;o;1;o;"
         &lt; d a d' f'> ^\markup
           \fret-diagram-terse #"x;x;o;2;3;1;"
       }
     >>
</pre>
     <p>
 <a href="../80/lily-2b1b823e.ly">
  <img align="middle"
    border="0" src="../80/lily-2b1b823e.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Barre indicators can be included in the fret-diagram-terse markup string.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            f1 g
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; f, c f a c' f'>1 ^\markup
           \fret-diagram-terse #"1-(;3;3;2;1;1-);"
         &lt; g, d g b d' g'> ^\markup
           \fret-diagram-terse #"3-(;5;5;4;3;3-);"
       }
     >>
</pre>
     <p>
 <a href="../78/lily-c76f03de.ly">
  <img align="middle"
    border="0" src="../78/lily-c76f03de.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Fingering indications can be included in the fret-diagram-terse markup string.

<!-- Need to use override to enable fingerings to show this - can we do so? -->
   <blockquote>
<pre class="verbatim">     
     &lt;&lt;    
       \context ChordNames {
          \chordmode {
            c1 d:m
          }
       }
       \context Staff {
         \override Voice.TextScript 
           #'fret-diagram-details #'finger-code = #'below-string
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup
           \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;"
         &lt; d a d' f'> ^\markup
           \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;"
       }
     >>
</pre>
     <p>
 <a href="../c6/lily-2882f059.ly">
  <img align="middle"
    border="0" src="../c6/lily-2882f059.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Other fret diagram properties must be adjusted using <code>\override</code> when using
the fret-diagram-terse markup.

   <p>The fret-diagram-verbose markup string is in the format of a Scheme list.  Each
element of the list indicates an item to be placed on the fret diagram.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;  \context ChordNames {
          \chordmode {
            c1 d:m
          }
       }
       \context Staff {
         \clef "treble_8"
         &lt; c e g c' e' > 1 ^\markup
           \fret-diagram-verbose #'(
             (mute 6)
             (place-fret 5 3)
             (place-fret 4 2)
             (open 3)
             (place-fret 2 1)
             (open 1)
           )
         &lt; d a d' f'> ^\markup
           \fret-diagram-verbose #'(
             (mute 6)
             (mute 5)
             (open 4)
             (place-fret 3 2)
             (place-fret 2 3)
             (place-fret 1 1)
           )
       }
     >>
</pre>
     <p>
 <a href="../4a/lily-373741b2.ly">
  <img align="middle"
    border="0" src="../4a/lily-373741b2.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Fingering indications and barres can be included in a
fret-diagram-verbose markup string.

<!-- \override is necessary to make fingering visible -->
   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \context ChordNames {
          \chordmode {
            f1 g
          }
       }
       \context Staff {
         \clef "treble_8"
         \override Voice.TextScript
           #'fret-diagram-details #'finger-code = #'below-string
     
         &lt; f, c f a c' f'>1 ^\markup
           \fret-diagram-verbose #'(
             (place-fret 6 1)
             (place-fret 5 3)
             (place-fret 4 3)
             (place-fret 3 2)
             (place-fret 2 1)
             (place-fret 1 1)
             (barre 6 1 1)
           )
         &lt; g, b, d g b g'> ^\markup
           \fret-diagram-verbose #'(
             (place-fret 6 3 2)
             (place-fret 5 2 1)
             (open 4)
             (open 3)
             (open 2)
             (place-fret 1 3 3)
           )
       }
     >>
</pre>
     <p>
 <a href="../0b/lily-3a90e1f8.ly">
  <img align="middle"
    border="0" src="../0b/lily-3a90e1f8.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>All other fret diagram properties must be adjusted using <code>\override</code>
when using the fret-diagram-verbose markup.

   <p>The graphical layout of a fret diagram can be customized according to
user preference through the properties of the <code>fret-diagram-interface</code>. 
Details are found at <a name="index-fret_002ddiagram_002dinterface-2093"></a><a href="../lilypond-internals/fret_002ddiagram_002dinterface.html#fret_002ddiagram_002dinterface">fret-diagram-interface</a>.  For a fret diagram
markup , the interface properties belong to <code>Voice.TextScript</code>.

<p class="noindent">

<h5 class="subsubheading">Selected Snippets</h5>

<p><em>Customizing markup fret diagrams</em>

   <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.

   <blockquote>
<pre class="verbatim">     
     &lt;&lt;
       \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="../f8/lily-2ad875a8.ly">
  <img align="middle"
    border="0" src="../f8/lily-2ad875a8.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

<p class="noindent">

<h5 class="subsubheading">See also</h5>

   <p class="indent">

   <p>Notation Reference:
<a href="Text-markup-commands.html#Text-markup-commands">Text markup commands</a>.

   <p>Snippets:
<a href="../../../input/lsr/lilypond-snippets/Fretted-strings.html#Fretted-strings">Fretted strings</a>.

   <p>Internals Reference:
<a name="index-fret_002ddiagram_002dinterface-2094"></a><a href="../lilypond-internals/fret_002ddiagram_002dinterface.html#fret_002ddiagram_002dinterface">fret-diagram-interface</a>.

   <!-- footer_tag --><br><hr>
<div class="node">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Predefined-fret-diagrams.html#Predefined-fret-diagrams">Predefined fret diagrams</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Custom-tablatures.html#Custom-tablatures">Custom tablatures</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Common-notation-for-fretted-strings.html#Common-notation-for-fretted-strings">Common notation for fretted strings</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>


<P>
 Other languages: <a href="Fret-diagram-markups.fr.html">français</a>, <a href="Fret-diagram-markups.es.html">español</a>, <a href="Fret-diagram-markups.de.html">deutsch</a>.
 <BR>
 
</P>
</BODY></html>