Sophie

Sophie

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

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>Predefined fret diagrams - 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="Fret-diagram-markups.html#Fret-diagram-markups" title="Fret diagram markups">
<link rel="next" href="Automatic-fret-diagrams.html#Automatic-fret-diagrams" title="Automatic 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="Predefined-fret-diagrams"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Automatic-fret-diagrams.html#Automatic-fret-diagrams">Automatic fret diagrams</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Fret-diagram-markups.html#Fret-diagram-markups">Fret diagram markups</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">Predefined fret diagrams</h5>

<p><a name="index-fret-diagrams-2095"></a><a name="index-chord-diagrams-2096"></a>
Fret diagrams can be displayed using the <code>FretBoards</code> context.  By
default, the <code>FretBoards</code> context will display fret diagrams that
are stored in a lookup table:

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     \context FretBoards {
       \chordmode {
         c1 d
       }
     }
</pre>
     <p>
 <a href="../9a/lily-abf29bca.ly">
  <img align="middle"
    border="0" src="../9a/lily-abf29bca.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>The default predefined fret diagrams are contained in the file
<code>predefined-guitar-fretboards.ly</code>.  Fret diagrams are
stored based on the pitches of a chord and the value of
<code>stringTunings</code> that is currently in use. 
<code>predefined-guitar-fretboards.ly</code> contains predefined
fret diagrams only for <code>guitar-tuning</code>.  Predefined fret
diagrams can be added for other instruments or other tunings
by following the examples found in
<code>predefined-guitar-fretboards.ly</code>.

   <p>Chord pitches can be entered
either as simultaneous music or using chord mode (see
<a href="Chord-mode-overview.html#Chord-mode-overview">Chord mode overview</a>).

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     \context FretBoards {
       \chordmode {c1}
       &lt;c' e' g'>1
     }
</pre>
     <p>
 <a href="../c8/lily-a6e330aa.ly">
  <img align="middle"
    border="0" src="../c8/lily-a6e330aa.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>It is common that both chord names and fret diagrams are displayed together. 
This is achieved by putting a <code>ChordNames</code> context in parallel with
a <code>FretBoards</code> context and giving both contexts the same music.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     mychords = \chordmode{
       c1 f g
     }
     
     &lt;&lt;
       \context ChordNames {
         \mychords
       }
       \context FretBoards {
         \mychords
       }
     >>
</pre>
     <p>
 <a href="../95/lily-d8c76a1d.ly">
  <img align="middle"
    border="0" src="../95/lily-d8c76a1d.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Predefined fret diagrams are transposable, as long as a diagram for the
transposed chord is stored in the fret diagram table.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     mychords = \chordmode{
       c1 f g
     }
     
     mychordlist = {
       \mychords
       \transpose c e { \mychords}
     }
     &lt;&lt;
       \context ChordNames {
         \mychordlist
       }
       \context FretBoards {
         \mychordlist
       }
     >>
</pre>
     <p>
 <a href="../19/lily-dfc3a3f7.ly">
  <img align="middle"
    border="0" src="../19/lily-dfc3a3f7.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>The predefined fret diagram table contains seven chords (major, minor,
augmented, diminished, dominant seventh, major seventh, minor seventh)
for each of 17 keys.  A complete list of the predefined fret diagrams is
shown in <a href="Predefined-fretboard-diagrams.html#Predefined-fretboard-diagrams">Predefined fretboard diagrams</a>.  If there is no entry in
the table for a chord, the FretBoards engraver will calculate a
fret-diagram using the automatic fret diagram functionality described in
<a href="Automatic-fret-diagrams.html#Automatic-fret-diagrams">Automatic fret diagrams</a>.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     mychords = \chordmode{
       c1 c:9
     }
     
     &lt;&lt;
       \context ChordNames {
         \mychords
       }
       \context FretBoards {
         \mychords
       }
     >>
</pre>
     <p>
 <a href="../0f/lily-dd6d0d80.ly">
  <img align="middle"
    border="0" src="../0f/lily-dd6d0d80.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Fret diagrams can be added to the fret diagram table.  To add a diagram,
you must specify the chord for the diagram, the tuning to be used, and the
fret-diagram-terse definition string for the diagram.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     
     \storePredefinedDiagram \chordmode {c:9} 
                             #guitar-tuning
                             #"x;3-2;2-1;3-3;3-4;x;"
     
     mychords = \chordmode{
       c1 c:9
     }
     
     &lt;&lt;
       \context ChordNames {
         \mychords
       }
       \context FretBoards {
         \mychords
       }
     >>
</pre>
     <p>
 <a href="../c6/lily-122b4bf3.ly">
  <img align="middle"
    border="0" src="../c6/lily-122b4bf3.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Different fret diagrams for the same chord name can be stored using different
octaves of pitches.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     
     \storePredefinedDiagram \chordmode {c'} 
                             #guitar-tuning
                             #(offset-fret 2 (chord-shape 'bes))
     
     mychords = \chordmode{
       c1 c'
     }
     
     &lt;&lt;
       \context ChordNames {
         \mychords
       }
       \context FretBoards {
         \mychords
       }
     >>
</pre>
     <p>
 <a href="../83/lily-bab9f946.ly">
  <img align="middle"
    border="0" src="../83/lily-bab9f946.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>In addition to fret diagrams, LilyPond stores an internal list of chord
shapes.  The chord shapes are fret diagrams that can be shifted along
the neck to different posistions to provide different chords.  Chord
shapes can be added to the internal list and then used to define
predefined fret diagrams.

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     
     % add a new chord shape
     
     \addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
     
     % add some new chords based on the power chord shape
     
     \storePredefinedDiagram \chordmode {f'} 
                             #guitar-tuning 
                             #(chord-shape 'powerf)
     \storePredefinedDiagram \chordmode {g'} 
                             #guitar-tuning
                             #(offset-fret 2 (chord-shape 'powerf))
     
     mychords = \chordmode{
       f1 f' g g' 
     }
     
     &lt;&lt;
       \context ChordNames {
         \mychords
       }
       \context FretBoards {
         \mychords
       }
     >>
</pre>
     <p>
 <a href="../7a/lily-f1c77774.ly">
  <img align="middle"
    border="0" src="../7a/lily-f1c77774.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <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-2097"></a><a href="../lilypond-internals/fret_002ddiagram_002dinterface.html#fret_002ddiagram_002dinterface">fret-diagram-interface</a>.  For a
predefined fret diagram, the interface properties belong to
<code>FretBoards.FretBoard</code>.

<p class="noindent">

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

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

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

   <blockquote>
<pre class="verbatim">     
     \include "predefined-guitar-fretboards.ly"
     \storePredefinedDiagram \chordmode { c' }
                             #guitar-tuning
                             #"x;1-1-(;3-2;3-3;3-4;1-1-);"
     &lt;&lt;
       \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="../39/lily-3a65a465.ly">
  <img align="middle"
    border="0" src="../39/lily-3a65a465.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="Custom-tablatures.html#Custom-tablatures">Custom tablatures</a>,
<a href="Automatic-fret-diagrams.html#Automatic-fret-diagrams">Automatic fret diagrams</a>,
<a href="Chord-mode-overview.html#Chord-mode-overview">Chord mode overview</a>,
<a href="Predefined-fretboard-diagrams.html#Predefined-fretboard-diagrams">Predefined fretboard diagrams</a>.

   <p>Installed Files:
<samp><span class="file">ly/predefined-guitar-fretboards.ly</span></samp>.

   <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-2098"></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="Automatic-fret-diagrams.html#Automatic-fret-diagrams">Automatic fret diagrams</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Fret-diagram-markups.html#Fret-diagram-markups">Fret diagram markups</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>

</BODY></html>