Sophie

Sophie

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

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>Tweaks and overrides - 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="Contexts-and-engravers.html#Contexts-and-engravers" title="Contexts and engravers">
<link rel="next" href="Paper-and-layout.html#Paper-and-layout" title="Paper and layout">
<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="Tweaks-and-overrides"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Paper-and-layout.html#Paper-and-layout">Paper and layout</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Contexts-and-engravers.html#Contexts-and-engravers">Contexts and engravers</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="unnumbered">Tweaks and overrides</h2>

<!-- FIXME make xref more precise when the chapter has been -->
<!-- revised in GDP -->
<p>These snippets illustrate the Notation Reference,
section <a href="../../../Documentation/user/lilypond/Changing-defaults.html#Changing-defaults">Changing defaults</a>.

   <p>See also Learning Manual, section
<a href="../../../Documentation/user/lilypond-learning/Tweaking-output.html#Tweaking-output">Tweaking output</a>.

   <p><a name="alignment-vertical-spacing.ly"></a>

<h3 class="unnumberedsec">Alignment vertical spacing</h3>

<p>By setting properties in <code>NonMusicalPaperColumn</code>, vertical spacing
can be adjusted per system.

   <p>By setting <code>alignment-extra-space</code> or
<code>fixed-alignment-extra-space</code> an individual system may be
stretched vertically.

   <p>For technical reasons, <code>\overrideProperty</code> must be used for
changing these properties within a staff; <code>\override</code> in a
<code>\context</code> block may still be used for global overrides.

<pre class="verbatim">
#(set-global-staff-size 13)

\relative c''
\new StaffGroup &lt;&lt;
  \new Staff {
    c1 \break
    c1 \break
    c1 \break
  }
  \new Staff {
    c1 | c | c
  }
  \new PianoStaff &lt;&lt;
    \new Voice  {
      \set PianoStaff.instrumentName = #"piano"
      \set PianoStaff.shortInstrumentName = #"pn"
      c1_"normal"
      
      \overrideProperty
        #"Score.NonMusicalPaperColumn"
        #'line-break-system-details
        #'((fixed-alignment-extra-space . 15))
      c_"fixed-aligment-extra-space"

      \overrideProperty
        #"Score.NonMusicalPaperColumn"
        #'line-break-system-details
        #'((alignment-extra-space . 15))
      c_"aligment-extra-space"
    }
    { c1 | c | c }
  >>
>>
</pre>
<p>
 <a href="../9c/lily-a3881ca4.ly">
  <img align="middle"
    border="0" src="../9c/lily-a3881ca4.png" alt="[image of music]">
 </a>
</p>

   <p><a name="analysis-brackets-above-the-staff.ly"></a>

<h3 class="unnumberedsec">Analysis brackets above the staff</h3>

<p>Simple horizontal analysis brackets are added below the staff by
default. The following example shows a way to place them above the
staff instead.

<pre class="verbatim">
\layout {
 \context {
   \Voice
   \consists "Horizontal_bracket_engraver"
 }
}
\relative c'' {
 \once \override HorizontalBracket #'direction = #UP
 c2\startGroup
 d\stopGroup
}

</pre>
<p>
 <a href="../17/lily-b04ac6ea.ly">
  <img align="middle"
    border="0" src="../17/lily-b04ac6ea.png" alt="[image of music]">
 </a>
</p>

   <p><a name="caesura-railtracks-with-fermata.ly"></a>

<h3 class="unnumberedsec">Caesura ("railtracks") with fermata</h3>

<p>A caesura is sometimes denoted with a double "railtracks" breath mark
with a fermata sign positioned above. This snippet should present an
optically pleasing combination of railtracks and a fermata.

<pre class="verbatim">
{
  c''2.
  % construct the symbol
  \override BreathingSign #'text = \markup {
    \line {
      \musicglyph #"scripts.caesura.curved"
      \translate #'(-1.75 . 1.6)
      \musicglyph #"scripts.ufermata"
    }
  }
  \breathe c''4
  % set the breathe mark back to normal
  \revert BreathingSign #'text
  c''2. \breathe c''4
  \bar "|."
}
</pre>
<p>
 <a href="../c2/lily-16581e34.ly">
  <img align="middle"
    border="0" src="../c2/lily-16581e34.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-a-single-notes-size-in-a-chord.ly"></a>

<h3 class="unnumberedsec">Changing a single note's size in a chord</h3>

<p>Individual note heads in a chord can be modified with the
<code>\tweak</code> command inside a chord, by altering the <code>font-size</code>
property.

   <p>Inside the chord (within the brackets <code>&lt; &gt;</code>), before the note to
be altered, place the <code>\tweak</code> command, followed by
<code>#'font-size</code> and define the proper size like <code>#-2</code> (a tiny
notehead).

<pre class="verbatim">
\layout { ragged-right = ##t }
\relative {
  &lt;\tweak #'font-size #+2 c e g c \tweak #'font-size #-2 e>1^\markup { A tiny e }_\markup { A big c }
}
</pre>
<p>
 <a href="../69/lily-7e4a3f0d.ly">
  <img align="middle"
    border="0" src="../69/lily-7e4a3f0d.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-form-of-multi--measure-rests.ly"></a>

<h3 class="unnumberedsec">Changing form of multi-measure rests</h3>

<p>If there are ten or fewer measures of rests, a series of longa
and breve rests (called in German "Kirchenpausen" - church rests)
is printed within the staff; otherwise a simple line is shown. 
This default number of ten may be changed by overriding the
<code>expand-limit</code> property:

<pre class="verbatim">
\relative c'' {
  \compressFullBarRests
  R1*2 | R1*5 | R1*9
  \override MultiMeasureRest #'expand-limit = 3
  R1*2 | R1*5 | R1*9
}
</pre>
<p>
 <a href="../08/lily-6df2a91f.ly">
  <img align="middle"
    border="0" src="../08/lily-6df2a91f.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-properties-for-individual-grobs.ly"></a>

<h3 class="unnumberedsec">Changing properties for individual grobs</h3>

<p>The <code>\applyOutput</code> command allows the tuning of any layout
object, in any context. It requires a Scheme function with three
arguments.

<pre class="verbatim">
\layout {
  ragged-right = ##t
}

#(define (mc-squared grob grob-origin context)
  (let*
   (
     (ifs (ly:grob-interfaces grob))
     (sp (ly:grob-property grob 'staff-position))
   )
   (if (memq 'note-head-interface ifs)
    (begin
     (ly:grob-set-property! grob 'stencil ly:text-interface::print)
     (ly:grob-set-property! grob 'font-family 'roman)
     (ly:grob-set-property! grob 'text
      (make-raise-markup -0.5
       (case sp
	((-5) (make-simple-markup "m"))
	((-3) (make-simple-markup "c "))
	((-2) (make-smaller-markup (make-bold-markup "2")))
	(else (make-simple-markup "bla"))
      ))))
  )))

\relative c' {
  &lt;d f g b>2
  \applyOutput #'Voice #mc-squared
  &lt;d f g b>
}
</pre>
<p>
 <a href="../2f/lily-ce713f02.ly">
  <img align="middle"
    border="0" src="../2f/lily-ce713f02.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-text-and-spanner-styles-for-text-dynamics.ly"></a>

<h3 class="unnumberedsec">Changing text and spanner styles for text dynamics</h3>

<p>The text used for crescendos and decrescendos can be
changed by modifying the context properties <code>crescendoText</code>
and <code>decrescendoText</code>.  The style of the spanner line can
be changed by modifying the <code>'style</code> property of
<code>DynamicTextSpanner</code>.  The default value is
<code>'hairpin</code>, and other possible values include
<code>'line</code>, <code>'dashed-line</code>, and
<code>'dotted-line</code>:

<pre class="verbatim">
\relative c'' {
  \set crescendoText = \markup { \italic { cresc. poco } }
  \set crescendoSpanner = #'text
  \override DynamicTextSpanner #'style = #'dotted-line
  a2\&lt; a
  a2 a
  a2 a
  a2 a\mf
}
</pre>
<p>
 <a href="../ab/lily-453c0505.ly">
  <img align="middle"
    border="0" src="../ab/lily-453c0505.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-the-default-text-font-family.ly"></a>

<h3 class="unnumberedsec">Changing the default text font family</h3>

<p>The default font families for text can be overridden with
<code>make-pango-font-tree</code>.

<pre class="verbatim">
\paper {
  % change for other default global staff size. 
  myStaffSize = #20
  %{
     run
         lilypond -dshow-available-fonts blabla
     to show all fonts available in the process log.  
  %}

  #(define fonts
    (make-pango-font-tree "Times New Roman"
                          "Nimbus Sans"
                          "Luxi Mono"
;;                        "Helvetica"
;;                        "Courier"
     (/ myStaffSize 20)))
}

\relative {
  c'^\markup {
    roman: foo \bold bla \italic bar \italic \bold baz 
  }
  c'_\markup {
    \override #'(font-family . sans)
    {
      sans: foo \bold bla \italic bar \italic \bold baz
    }
  }
  c'2^\markup {
    \override #'(font-family . typewriter)
    {
      mono: foo \bold bla \italic bar \italic \bold baz
    }
  }
}  

</pre>
<p>
 <a href="../a1/lily-e2be3d91.ly">
  <img align="middle"
    border="0" src="../a1/lily-e2be3d91.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing-the-staff-size.ly"></a>

<h3 class="unnumberedsec">Changing the staff size</h3>

<p>Though the simplest way to resize staves is to use
<code>#(set-global-staff-size xx)</code>, an individual staff's size can be
changed by scaling the properties <code>staff-space</code> and
<code>fontSize</code>.

<pre class="verbatim">
&lt;&lt;
  \new Staff \relative c'' {
    \dynamicDown
    c8\ff c c c c c c c
  }
  \new Staff \with {
    fontSize = #-3
    \override StaffSymbol #'staff-space = #(magstep -3)
  } {
    \clef bass
    c8 c c c c\f c c c
  }
>>
</pre>
<p>
 <a href="../33/lily-eb10503d.ly">
  <img align="middle"
    border="0" src="../33/lily-eb10503d.png" alt="[image of music]">
 </a>
</p>

   <p><a name="controlling-the-vertical-ordering-of-scripts.ly"></a>

<h3 class="unnumberedsec">Controlling the vertical ordering of scripts</h3>

<p>The vertical ordering of scripts is controlled with the
<code>script-priority</code> property. The lower this number, the closer it
will be put to the note. In this example, the <code>TextScript</code> (the
sharp symbol) first has the lowest priority, so it is put lowest in the
first example. In the second, the prall trill (the <code>Script</code>) has
the lowest, so it is on the inside. When two objects have the same
priority, the order in which they are entered determines which one
comes first.

<pre class="verbatim">
\relative c''' {
  \once \override TextScript #'script-priority = #-100
  a2^\prall^\markup { \sharp }
  
  \once \override Script #'script-priority = #-100
  a2^\prall^\markup { \sharp }
}
</pre>
<p>
 <a href="../df/lily-870d61d9.ly">
  <img align="middle"
    border="0" src="../df/lily-870d61d9.png" alt="[image of music]">
 </a>
</p>

   <p><a name="controlling-tuplet-bracket-visibility.ly"></a>

<h3 class="unnumberedsec">Controlling tuplet bracket visibility</h3>

<p>The default behavior of tuplet-bracket visibility is to print a bracket
unless there is a beam of the same length as the tuplet. To control the
visibility of tuplet brackets, set the property <code>TupletBracket
#'bracket-visibility</code> to either <code>##t</code> (always print a bracket),
<code>##f</code> (never print a bracket) or <code>#'if-no-beam</code> (only print a
bracket if there is no beam).

<pre class="verbatim">
mus = \relative c'' {
  \times 2/3 { c16[ d e } f8]
  \times 2/3 { c8 d e }
  \times 2/3 { c4 d e }
}

\new Voice \relative c'{
  &lt;&lt; \mus s4^"default" >>
  \override TupletBracket #'bracket-visibility = #'if-no-beam
  &lt;&lt; \mus s4^"'if-no-beam" >>
  \override TupletBracket #'bracket-visibility = ##t
  &lt;&lt; \mus s4^"#t" >>
  \override TupletBracket #'bracket-visibility = ##f
  &lt;&lt; \mus s4^"#f" >>
} 

</pre>
<p>
 <a href="../08/lily-6e556f99.ly">
  <img align="middle"
    border="0" src="../08/lily-6e556f99.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-simultaneous-rehearsal-marks.ly"></a>

<h3 class="unnumberedsec">Creating simultaneous rehearsal marks</h3>

<p>Unlike text scripts, rehearsal marks cannot be stacked at a particular point
in a score: only one <code>RehearsalMark</code> object is created.  Using an
invisible measure and bar line, an extra rehearsal mark can be added, giving
the appearance of two marks in the same column.

   <p>This method may also prove useful for placing rehearsal marks at both the
end of one system and the start of the following system.

<pre class="verbatim">
{
  \key a \major
  \set Score.markFormatter = #format-mark-box-letters
  \once \override Score.RehearsalMark #'outside-staff-priority = #5000
  \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
  \once \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
  \mark \markup { \bold { Senza denti } }
  
  % the hidden measure and bar line
  \once \override Score.TimeSignature #'stencil = ##f
  \time 1/16
  s16 \bar ""
  
  \time 4/4
  \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
  \once \override Score.RehearsalMark #'break-align-symbols = #'(bar-line)
  \mark \markup { \box \bold Intro }
  d'1
  \mark \default
  d'1
}
</pre>
<p>
 <a href="../3a/lily-6eac71b0.ly">
  <img align="middle"
    border="0" src="../3a/lily-6eac71b0.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-text-spanners.ly"></a>

<h3 class="unnumberedsec">Creating text spanners</h3>

<p>The <code>\startTextSpan</code> and <code>\stopTextSpan</code> commands allow the
creation of text spanners as easily as pedal indications or
octavations. Override some properties of the <code>TextSpanner</code> object
to modify its output.

<pre class="verbatim">
\relative c'' {
  \override TextSpanner  #'edge-text = #'("bla" . "blu")
  a \startTextSpan
  b c
  a \stopTextSpan
  
  \override TextSpanner  #'dash-period = #2
  \override TextSpanner  #'dash-fraction = #0.0
  a \startTextSpan
  b c
  a \stopTextSpan
  
  \revert TextSpanner #'style
  \override TextSpanner  #'style = #'dashed-line \override TextSpanner #'bound-details #'left #'text = \markup { \draw-line #'(0 . 1) }
 \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -2) }

  a \startTextSpan
  b c
  a \stopTextSpan
  
  \set Staff.middleCPosition = #-13
  \override TextSpanner  #'dash-period = #10
  \override TextSpanner  #'dash-fraction = #0.5
  \override TextSpanner  #'thickness = #10
  a \startTextSpan
  b c
  a \stopTextSpan
  \set Staff.middleCPosition = #-6
}
</pre>
<p>
 <a href="../97/lily-494f79c2.ly">
  <img align="middle"
    border="0" src="../97/lily-494f79c2.png" alt="[image of music]">
 </a>
</p>

   <p><a name="custodes.ly"></a>

<h3 class="unnumberedsec">Custodes</h3>

<p>Custodes may be engraved in various styles.

<pre class="verbatim">
\layout { ragged-right = ##t }

\new Staff \with { \consists "Custos_engraver" } \relative c' {
  \override Staff.Custos #'neutral-position = #4
  
  \override Staff.Custos #'style = #'hufnagel
  c1^"hufnagel" \break
  &lt;d a' f'>1
  
  \override Staff.Custos #'style = #'medicaea
  c1^"medicaea" \break
  &lt;d a' f'>1
  
  \override Staff.Custos #'style = #'vaticana
  c1^"vaticana" \break
  &lt;d a' f'>1
  
  \override Staff.Custos #'style = #'mensural
  c1^"mensural" \break
  &lt;d a' f'>1
}
</pre>
<p>
 <a href="../9c/lily-d7f7902b.ly">
  <img align="middle"
    border="0" src="../9c/lily-d7f7902b.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-);"
&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="../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">
&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="../b0/lily-97afdcd2.ly">
  <img align="middle"
    border="0" src="../b0/lily-97afdcd2.png" alt="[image of music]">
 </a>
</p>

   <p><a name="display-bracket-with-only-one-staff-in-a-system.ly"></a>

<h3 class="unnumberedsec">Display bracket with only one staff in a system</h3>

<p>If there is only one staff in one of the staff types
<code>ChoirStaff</code>, <code>InnerChoirStaff</code>, <code>InnerStaffGroup</code>
or <code>StaffGroup</code>, the bracket and the starting bar line will not
be displayed as standard behavior.  This can be changed by overriding
the relevant properties, as demonstrated in this example.

   <p>Note that in contexts such as <code>PianoStaff</code> and <code>GrandStaff</code>
where the systems begin with a brace instead of a bracket, another
property has to be set, as shown on the second system in the example.

<pre class="verbatim">
\markup \column {
  \score {
    \new StaffGroup &lt;&lt;
      % Must be lower than the actual number of staff lines
      \override StaffGroup.SystemStartBracket #'collapse-height = #1
      \override Score.SystemStartBar #'collapse-height = #1
      \new Staff {
        c'1
      }
    >>
    \layout { }
  }
  \score {
    \new PianoStaff &lt;&lt;
      \override PianoStaff.SystemStartBrace #'collapse-height = #1
      \override Score.SystemStartBar #'collapse-height = #1
      \new Staff {
        c'1
      }
    >>
    \layout { }
  }
}
</pre>
<p>
 <a href="../60/lily-892f5d56.ly">
  <img align="middle"
    border="0" src="../60/lily-892f5d56.png" alt="[image of music]">
 </a>
</p>

   <p><a name="drawing-boxes-around-grobs.ly"></a>

<h3 class="unnumberedsec">Drawing boxes around grobs</h3>

<p>The <code>print-function</code> can be overridden to draw a box around an
arbitrary grob.

<pre class="verbatim">
\relative c'' {
  \override TextScript #'stencil =
    #(make-stencil-boxer 0.1 0.3 ly:text-interface::print)
  c'4^"foo"

  \override Stem #'stencil =
    #(make-stencil-boxer 0.05 0.25 ly:stem::print)
  \override Score.RehearsalMark  #'stencil =
    #(make-stencil-boxer 0.15 0.3 ly:text-interface::print)
  b8
  
  \revert Stem #'stencil
  c4. c4 \mark "F" c1
}
</pre>
<p>
 <a href="../a4/lily-4cc83e34.ly">
  <img align="middle"
    border="0" src="../a4/lily-4cc83e34.png" alt="[image of music]">
 </a>
</p>

   <p><a name="drawing-circles-around-various-objects.ly"></a>

<h3 class="unnumberedsec">Drawing circles around various objects</h3>

<p>The <code>\circle</code> command allows you to draw circles around various objects,
for example fingering indications. However, some objects require
specific tweaks: rehearsal marks depend on the <code>Score.markFormatter</code>
context, bar numbers on the <code>Score.BarNumber</code> context, and so on.

   <p>You can tweak the printing of your circles by setting some properties
such as <code>#'thickness</code>, <code>#'circle-padding</code> or <code>#'font-size</code>.

<pre class="verbatim">
\relative c' {
  c1
  \set Score.markFormatter =
    #(lambda (mark context)
             (make-circle-markup (format-mark-numbers mark context)))
  \mark \default
  c2 d^\markup { \circle \finger 2 }
  \override Score.BarNumber #'break-visibility = #all-visible
  \override Score.BarNumber  #'stencil =
    #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
}
</pre>
<p>
 <a href="../82/lily-20c415ca.ly">
  <img align="middle"
    border="0" src="../82/lily-20c415ca.png" alt="[image of music]">
 </a>
</p>

   <p><a name="fine-tuning-pedal-brackets.ly"></a>

<h3 class="unnumberedsec">Fine-tuning pedal brackets</h3>

<p>For fine-tuning the appearance of a pedal bracket, the properties
<code>edge-width</code>, <code>edge-height</code>, and <code>shorten-pair</code> of
<code>PianoPedalBracket</code> objects can be modified.  For example, the
bracket may be extended to the right edge of the note head:

<pre class="verbatim">
\relative c'' {
  \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
  c4\sostenutoOn d e c,
  f4 g a2\sostenutoOff
}
</pre>
<p>
 <a href="../38/lily-ae6927a2.ly">
  <img align="middle"
    border="0" src="../38/lily-ae6927a2.png" alt="[image of music]">
 </a>
</p>

   <p><a name="forcing-horizontal-shift-of-notes.ly"></a>

<h3 class="unnumberedsec">Forcing horizontal shift of notes</h3>

<p>When the typesetting engine cannot cope, the <code>force-hshift</code>
property of the <code>NoteColumn</code> object can be used to override
typesetting decisions. The measure units used here are staff spaces.

<pre class="verbatim">
\relative c' &lt;&lt;
  {
    &lt;d g>2 &lt;d g>
  }
  \\
  { &lt;b f'>2
    \once \override NoteColumn #'force-hshift = #1.7
    &lt;b f'>2
  }
>>
</pre>
<p>
 <a href="../1b/lily-041be501.ly">
  <img align="middle"
    border="0" src="../1b/lily-041be501.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">
&lt;&lt;
  \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="horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly"></a>

<h3 class="unnumberedsec">Horizontally aligning custom dynamics (e.g. "sempre pp", "piu f", "subito p")</h3>

<p>Some dynamic expressions involve additional text, like "sempre pp". 
Since lilypond aligns all dynamics centered on the note, the \pp would
be displayed way after the note it applies to.

   <p>To correctly align the "sempre \pp" horizontally, so that it is
aligned as if it were only the \pp, there are several approaches:

   <p>* Simply use <code>\once\override DynamicText #'X-offset = #-9.2</code>
before the note with the dynamics to manually shift it to the correct
position. Drawback: This has to be done manually each time you use that
dynamic markup... * Add some padding (<code>#:hspace 7.1</code>) into the
definition of your custom dynamic mark, so that after lilypond
center-aligns it, it is already correctly aligned. Drawback: The
padding really takes up that space and does not allow any other markup
or dynamics to be shown in that position.

   <p>* Shift the dynamic script <code>\once\override ... #'X-offset = ..</code>. 
Drawback: <code>\once\override</code> is needed for every invocation!

   <p>* Set the dimensions of the additional text to 0 (using
<code>#:with-dimensions '(0 . 0) '(0 . 0)</code>). Drawback: To lilypond
"sempre" has no extent, so it might put other stuff there and create
collisions (which are not detected by the collision dection!). Also,
there seems to be some spacing, so it's not exactly the same alignment
as without the additional text

   <p>* Add an explicit shifting directly inside the scheme function for the
dynamic-script.

   <p>* Set an explicit alignment inside the dynamic-script. By default, this
won't have any effect, only if one sets X-offset! Drawback: One needs
to set <code>DynamicText #'X-offset</code>, which will apply to all dynamic
texts! Also, it is aligned at the right edge of the additional text,
not at the center of pp.

<pre class="verbatim">
\header { title = "Horizontally aligning custom dynamics" }
\layout { ragged-right = ##t }

% Solution 1: Using a simple markup with a particular halign value
% Drawback: It's a markup, not a dynamic command, so \dynamicDown etc. will have no effect
semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" }

% Solution 2: Using a dynamic script and shifting with \once\override ... #'X-offset = ..
% Drawback: \once\override needed for every invocation
semppK = #(make-dynamic-script (markup #:line( #:normal-text #:italic "sempre" #:dynamic "pp")))

% Solution 3: Padding the dynamic script so the center-alignment puts it to the correct position
% Drawback: the padding really reserves the space, nothing else can be there
semppT = #(
  make-dynamic-script (
    markup #:line (
      #:normal-text #:italic "sempre" #:dynamic "pp" #:hspace 7.1
    )
  )
)

% Solution 4: Dynamic, setting the dimensions of the additional text to 0
% Drawback: To lilypond "sempre" has no extent, so it might put other stuff there => collisions
% Drawback: Also, there seems to be some spacing, so it's not exactly the 
%           same alignment as without the additional text
semppM = #(make-dynamic-script (markup #:line( #:with-dimensions '(0 . 0) '(0 . 0) #:right-align #:normal-text #:italic "sempre" #:dynamic "pp")))

% Solution 5: Dynamic with explicit shifting inside the scheme function
semppG = #(make-dynamic-script
  (markup
    #:hspace 0 #:translate (cons -18.85 0 )
    #:line( #:normal-text #:italic "sempre" #:dynamic "pp"))
)

% Solution 6: Dynamic with explicit alignment. This has only effect, if one sets X-offset!
% Drawback: One needs to set DynamicText #'X-offset!
% Drawback: Aligned at the right edge of the additional text, not at the center of pp
semppMII = #(make-dynamic-script (markup #:line(#:right-align #:normal-text #:italic "sempre" #:dynamic "pp")))


\context StaffGroup &lt;&lt;
  \context Staff="s" &lt;&lt; \set Staff.instrumentName = "Normal"
       \relative c'' { \key es \major c4\pp c\p c c | c\ff c c\pp c } 
  >>
  \context Staff="sMarkup" &lt;&lt; \set Staff.instrumentName = \markup\column{"Normal" "Markup"}
       \relative c'' { \key es \major c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c} 
  >>
  \context Staff="sK" &lt;&lt; \set Staff.instrumentName = \markup\column{"Explicit" "shifting"}
       \relative c'' { \key es \major 
           \once \override DynamicText #'X-offset = #-9.2 c4\semppK c\p c c | 
           c\ff c \once \override DynamicText #'X-offset = #-9.2  c\semppK c } 
  >>
  \context Staff="sT" &lt;&lt; \set Staff.instrumentName = \markup\column{"Right" "padding"}
       \relative c'' { \key es \major c4\semppT c\p c c | c\ff c c\semppT c } 
  >>
  \context Staff="sM" &lt;&lt; \set Staff.instrumentName = \markup\column{"Setting" "dimension" "to zero"}
       \relative c'' { \key es \major c4\semppM c\p c c | c\ff c c\semppM c } 
  >>
  \context Staff="sG" &lt;&lt; \set Staff.instrumentName = \markup\column{"Shifting" "inside" "dynamics"}
       \relative c'' { \key es \major c4\semppG c\p c c | c\ff c c\semppG c} 
  >>
  \context Staff="sMII" &lt;&lt; \set Staff.instrumentName = \markup\column{"Alignment" "inside" "dynamics"}
    \relative c'' { \key es \major 
      \override DynamicText #'X-offset = #0  % Setting to ##f (false) gives the same resul
      c4\semppMII c\p c c | c\ff c c\semppMII c } 
    >>
>>

</pre>
<p>
 <a href="../b8/lily-c29942a1.ly">
  <img align="middle"
    border="0" src="../b8/lily-c29942a1.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
{
  &lt;&lt;
    \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
     &lt;&lt;
       { 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="inserting-a-caesura.ly"></a>

<h3 class="unnumberedsec">Inserting a caesura</h3>

<p>Caesura marks can be created by overriding the <code>'text</code>
property of the <code>BreathingSign</code> object.  A curved caesura
mark is also available.

<pre class="verbatim">
\relative c'' {
  \override BreathingSign #'text =
    #(make-musicglyph-markup "scripts.caesura.straight")
  c8 e4. \breathe g8. e16 c4

  \override BreathingSign #'text =
    #(make-musicglyph-markup "scripts.caesura.curved")
  g8 e'4. \breathe g8. e16 c4
}
</pre>
<p>
 <a href="../be/lily-8eab70c5.ly">
  <img align="middle"
    border="0" src="../be/lily-8eab70c5.png" alt="[image of music]">
 </a>
</p>

   <p><a name="making-an-object-invisible-with-the-transparent-property.ly"></a>

<h3 class="unnumberedsec">Making an object invisible with the transparent property</h3>

<p>Setting the <code>transparent</code> property will cause an object to be
printed in "invisible ink": the object is not printed, but all its
other behavior is retained.  The object still takes up space, it takes
part in collisions, and slurs, ties and beams can be attached to it.

   <p>This snippet demonstrates how to connect different voices using ties. 
Normally, ties only connect two notes in the same voice.  By
introducing a tie in a different voice, and blanking the first up-stem
in that voice, the tie appears to cross voices.  To prevent the blanked stem's
flag from interfering with tie positioning, the stem is extended.

<pre class="verbatim">
\relative c'' {
  \time 2/4
  &lt;&lt; {
    \once \override Stem #'transparent = ##t
    \once \override Stem #'length = #8
    b8 ~ b\noBeam
    \once \override Stem #'transparent = ##t
    \once \override Stem #'length = #8
    g8 ~ g\noBeam
  } \\ {
    b8 g g e
  } >>
}
</pre>
<p>
 <a href="../74/lily-ed1461a4.ly">
  <img align="middle"
    border="0" src="../74/lily-ed1461a4.png" alt="[image of music]">
 </a>
</p>

   <p><a name="manually-controlling-beam-positions.ly"></a>

<h3 class="unnumberedsec">Manually controlling beam positions</h3>

<p>Beam positions may be controlled manually, by overriding the
<code>positions</code> setting of the <code>Beam</code> grob.

<pre class="verbatim">
\relative c' {
  \time 2/4
  % from upper staffline (position 4) to center (position 0)
  \override Beam #'positions = #'(2 . 0)
  c8 c
  % from center to one above center (position 2)
  \override Beam #'positions = #'(0 . 1)
  c8 c
}

</pre>
<p>
 <a href="../5f/lily-7c61b35b.ly">
  <img align="middle"
    border="0" src="../5f/lily-7c61b35b.png" alt="[image of music]">
 </a>
</p>

   <p><a name="mensurstriche-layout-bar-lines-between-the-staves.ly"></a>

<h3 class="unnumberedsec">Mensurstriche layout (bar lines between the staves)</h3>

<p>The mensurstriche-layout where the bar lines do not show on the staves
but between staves can be achieved with a <code>StaffGroup</code> instead of
a <code>ChoirStaff</code>.  The bar line on staves is blanked out by setting
the <code>transparent</code> property.

<pre class="verbatim">
global = {
  \override Staff.BarLine #'transparent = ##t
  s1 s
  % the final bar line is not interrupted
  \revert Staff.BarLine #'transparent
  \bar "|."
}
\new StaffGroup \relative c'' {
  &lt;&lt;
    \new Staff { &lt;&lt; \global { c1 c } >> }
    \new Staff { &lt;&lt; \global { c c } >> }
  >>
}
</pre>
<p>
 <a href="../d4/lily-0139e5aa.ly">
  <img align="middle"
    border="0" src="../d4/lily-0139e5aa.png" alt="[image of music]">
 </a>
</p>

   <p><a name="nesting-staves.ly"></a>

<h3 class="unnumberedsec">Nesting staves</h3>

<p>The property <code>systemStartDelimiterHierarchy</code> can be used to make
more complex nested staff groups. The command <code>\set
StaffGroup.systemStartDelimiterHierarchy</code> takes an alphabetical list of
the number of staves produced. Before each staff a system start
delimiter can be given. It has to be enclosed in brackets and takes as
much staves as the brackets enclose. Elements in the list can be
omitted, but the first bracket takes always the complete number of
staves. The possibilities are <code>SystemStartBar</code>,
<code>SystemStartBracket</code>, <code>SystemStartBrace</code>, and
<code>SystemStartSquare</code>.

<pre class="verbatim">
\new StaffGroup
\relative c'' &lt;&lt;
  \set StaffGroup.systemStartDelimiterHierarchy
    = #'(SystemStartSquare (SystemStartBrace (SystemStartBracket a
                             (SystemStartSquare b)  ) c ) d)
  \new Staff { c1 }
  \new Staff { c1 }
  \new Staff { c1 }
  \new Staff { c1 }
  \new Staff { c1 }
>>
</pre>
<p>
 <a href="../c2/lily-70d9e59c.ly">
  <img align="middle"
    border="0" src="../c2/lily-70d9e59c.png" alt="[image of music]">
 </a>
</p>

   <p><a name="positioning-multi--measure-rests.ly"></a>

<h3 class="unnumberedsec">Positioning multi-measure rests</h3>

<p>Unlike ordinary rests, there is no predefined command
to change the vertical position on the staff of a multi-measure
rest symbol of either form by attaching it to a note.  However,
in polyphonic music multi-measure rests in odd-numbered and
even-numbered voices are vertically separated.  The positioning
of multi-measure rests can be controlled as follows:
<pre class="verbatim">
\relative c'' {
  % Multi-measure rests by default are set under the second line
  R1
  % They can be moved with an override
  \override MultiMeasureRest #'staff-position = #-2
  R1
  % A value of 0 is the default position;
  % the following trick moves the rest to the center line
  \override MultiMeasureRest #'staff-position = #-0.01
  R1
  % Multi-measure rests in odd-numbered voices are under the top line
  &lt;&lt; { R1 } \\ { a1 } >>
  % Multi-measure rests in even-numbered voices are under the bottom line
  &lt;&lt; { c1 } \\ { R1 } >>
  % They remain separated even in empty measures
  &lt;&lt; { R1 } \\ { R1 } >>
  % This brings them together even though there are two voices
  \compressFullBarRests
  &lt;&lt;
    \revert MultiMeasureRest #'staff-position
    { R1*3 }
    \\
    \revert MultiMeasureRest #'staff-position
    { R1*3 }
  >>
}
</pre>
<p>
 <a href="../73/lily-ebd099b8.ly">
  <img align="middle"
    border="0" src="../73/lily-ebd099b8.png" alt="[image of music]">
 </a>
</p>

   <p><a name="printing-a-repeat-sign-at-the-beginning-of-a-piece.ly"></a>

<h3 class="unnumberedsec">Printing a repeat sign at the beginning of a piece</h3>

<p>A <code>|:</code> bar line can be printed at the beginning of a piece, by
overriding the relevant property:

<pre class="verbatim">
\relative c'' {
  \once \override Score.BreakAlignment #'break-align-orders =
        #(make-vector 3 '(instrument-name
                          left-edge
                          ambitus
                          span-bar
                          breathing-sign
                          clef
                          key-signature
                          time-signature
                          staff-bar
                          custos
                          span-bar))
  \bar "|:"
  c1
  d1
  d4 e f g
}
</pre>
<p>
 <a href="../f9/lily-8304a96e.ly">
  <img align="middle"
    border="0" src="../f9/lily-8304a96e.png" alt="[image of music]">
 </a>
</p>

   <p><a name="printing-metronome-and-rehearsal-marks-below-the-staff.ly"></a>

<h3 class="unnumberedsec">Printing metronome and rehearsal marks below the staff</h3>

<p>By default, metronome and rehearsal marks are printed above the staff. 
To place them below the staff simply set the <code>direction</code> property
of <code>MetronomeMark</code> or <code>RehearsalMark</code> appropriately.

<pre class="verbatim">
\layout { ragged-right = ##f }

{
  % Metronome marks below the staff 
  \override Score.MetronomeMark #'direction = #DOWN
  \tempo 8. = 120
  c''1

  % Rehearsal marks below the staff
  \override Score.RehearsalMark #'direction = #DOWN
  \mark \default
  c''1
}
</pre>
<p>
 <a href="../4a/lily-cfdefdd1.ly">
  <img align="middle"
    border="0" src="../4a/lily-cfdefdd1.png" alt="[image of music]">
 </a>
</p>

   <p><a name="proportional-strict-notespacing.ly"></a>

<h3 class="unnumberedsec">Proportional strict notespacing</h3>

<p>If <code>strict-note-spacing</code> is set spacing of notes is not influenced
by bars or clefs within a system. Rather, they are placed just before
the note that occurs at the same time. This may cause collisions.

<pre class="verbatim">
\paper {
  ragged-right = ##t
}

\relative c'' &lt;&lt;
  \override Score.SpacingSpanner #'strict-note-spacing = ##t 
  \set Score.proportionalNotationDuration = #(ly:make-moment 1 16)
  \new Staff {
    c8[ c \clef alto c c \grace { d16 } c8 c] c4
    c2 \grace { c16[ c16] } c2
  }
  \new Staff {
    c2 \times 2/3 { c8 \clef bass cis,, c } c4
    c1
  }
>>
</pre>
<p>
 <a href="../7b/lily-72ebb147.ly">
  <img align="middle"
    border="0" src="../7b/lily-72ebb147.png" alt="[image of music]">
 </a>
</p>

   <p><a name="removing-the-first-empty-line.ly"></a>

<h3 class="unnumberedsec">Removing the first empty line</h3>

<p>The first empty staff can also be removed from the score by setting the
<code>VerticalAxisGroup</code> property <code>remove-first</code>. This can be done
globally inside the <code>\layout</code> block, or locally inside the
specific staff that should be removed.  In the latter case, you have to
specify the context (<code>Staff</code> applies only to the current staff) in
front of the property.

   <p>The lower staff of the second staff group is not removed, because the
setting applies only to the specific staff inside of which it is
written.

<pre class="verbatim">
\layout {
  \context { 
    \RemoveEmptyStaffContext 
    % To use the setting globally, uncomment the following line:
    % \override VerticalAxisGroup #'remove-first = ##t
  }
}
\new StaffGroup &lt;&lt;
  \new Staff \relative c' {
    e4 f g a \break
    c1
  }
  \new Staff {
    % To use the setting globally, comment this line,
    % uncomment the line in the \layout block above
    \override Staff.VerticalAxisGroup #'remove-first = ##t
    R1 \break
    R
  }
>>
\new StaffGroup &lt;&lt;
  \new Staff \relative c' {
    e4 f g a \break
    c1
  }
  \new Staff {
    R1 \break
    R
  }
>>
</pre>
<p>
 <a href="../e7/lily-3d411fb4.ly">
  <img align="middle"
    border="0" src="../e7/lily-3d411fb4.png" alt="[image of music]">
 </a>
</p>

   <p><a name="rest-styles.ly"></a>

<h3 class="unnumberedsec">Rest styles</h3>

<p>Rests may be used in various styles.

<pre class="verbatim">
\layout {
  indent = 0.0
  \context {
    \Staff
    \remove "Time_signature_engraver"
  }
}

\relative c {
  \set Score.timing = ##f
  \override Staff.Rest  #'style = #'mensural
  r\maxima^\markup \typewriter { mensural }
  r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
  \bar ""
  
  \override Staff.Rest  #'style = #'neomensural
  r\maxima^\markup \typewriter { neomensural }
  r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
  \bar ""
  
  \override Staff.Rest  #'style = #'classical
  r\maxima^\markup \typewriter { classical }
  r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
  \bar ""
  
  \override Staff.Rest  #'style = #'default
  r\maxima^\markup \typewriter { default }
  r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
}
</pre>
<p>
 <a href="../b4/lily-5bfcd48c.ly">
  <img align="middle"
    border="0" src="../b4/lily-5bfcd48c.png" alt="[image of music]">
 </a>
</p>

   <p><a name="rhythmic-slashes.ly"></a>

<h3 class="unnumberedsec">Rhythmic slashes</h3>

<p>In "simple" lead-sheets, sometimes no actual notes are written,
instead only "rhythmic patterns" and chords above the measures are
notated giving the structure of a song. Such a feature is for example
useful while creating/transcribing the structure of a song and also
when sharing lead sheets with guitarists or jazz musicians. The
standard support for this using <code>\repeat percent</code> is unsuitable
here since the first beat has to be an ordinary note or rest. This
example shows two solutions to this problem, by redefining ordinary
rests to be printed as slashes. (If the duration of each beat is not a
quarter note, replace the <code>r4</code> in the definitions with a rest of
the appropriate duration).

<pre class="verbatim">
% Macro to print single slash
rs = {
  \once \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
  \once \override Rest #'thickness = #'0.48
  \once \override Rest #'slope = #'1.7
  r4
}

% Function to print a specified number of slashes
comp = #(define-music-function (parser location count) ( integer?)
  #{
    \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
    \override Rest #'thickness = #'0.48
    \override Rest #'slope = #'1.7
    \repeat unfold $count { r4 }
    \revert Rest #'stencil
  #}
)

\score{
  \relative c' {
    c d e f |
    \rs \rs \rs \rs |
    \comp #4 |
  }
}
</pre>
<p>
 <a href="../65/lily-23b8cebf.ly">
  <img align="middle"
    border="0" src="../65/lily-23b8cebf.png" alt="[image of music]">
 </a>
</p>

   <p><a name="suppressing-warnings-for-clashing-note-columns.ly"></a>

<h3 class="unnumberedsec">Suppressing warnings for clashing note columns</h3>

<p>If notes from two voices with stems in the same direction are
placed at the same position, and both voices have no shift or the
same shift specified, the error message "warning: ignoring too
many clashing note columns" will appear when compiling the
LilyPond file.  This message can be suppressed by setting the
<code>'ignore-collision</code> property of the <code>NoteColumn</code> object
to <code>#t</code>.

<pre class="verbatim">
ignore = \override NoteColumn #'ignore-collision = ##t

\relative c' &lt;&lt;
  \ignore
  { \stemDown f2 g } \\
  { c2 c, }
>>
</pre>
<p>
 <a href="../28/lily-74c9287c.ly">
  <img align="middle"
    border="0" src="../28/lily-74c9287c.png" alt="[image of music]">
 </a>
</p>

   <p><a name="time-signature-in-parentheses.ly"></a>

<h3 class="unnumberedsec">Time signature in parentheses</h3>

<p>The time signature can be enclosed within parentheses.

<pre class="verbatim">
\relative c'' {
  \override Staff.TimeSignature #'stencil = #(lambda (grob)
    (bracketify-stencil (ly:time-signature::print grob) Y 0.1 0.2 0.1))
  \time 2/4
  a4 b8 c
}
</pre>
<p>
 <a href="../52/lily-bb42503d.ly">
  <img align="middle"
    border="0" src="../52/lily-bb42503d.png" alt="[image of music]">
 </a>
</p>

   <p><a name="tweaking-clef-properties.ly"></a>

<h3 class="unnumberedsec">Tweaking clef properties</h3>

<p>The command <code>\clef "treble_8"</code> is equivalent to setting
<code>clefGlyph</code>, <code>clefPosition</code> (which controls the vertical
position of the clef), <code>middleCPosition</code> and
<code>clefOctavation</code>. A clef is printed when any of the properties
except <code>middleCPosition</code> are changed.

   <p>Note that changing the glyph, the position of the clef, or the
octavation does not in itself change the position of subsequent notes
on the staff: the position of middle C must also be specified to do
this. The positional parameters are relative to the staff center line,
positive numbers displacing upwards, counting one for each line and
space. The <code>clefOctavation</code> value would normally be set to 7, -7,
15 or -15, but other values are valid.

   <p>When a clef change takes place at a line break the new clef symbol is
printed at both the end of the previous line and the beginning of the
new line by default. If the warning clef at the end of the previous
line is not required it can be suppressed by setting the <code>Staff</code>
property <code>explicitClefVisibility</code> to the value
<code>end-of-line-invisible</code>. The default behavior can be recovered
with  <code>\unset Staff.explicitClefVisibility</code>.

   <p>The following examples show the possibilities when setting these
properties manually. On the first line, the manual changes preserve the
standard relative positioning of clefs and notes, whereas on the second
line, they do not.

<pre class="verbatim">
{
  % The default treble clef
  c'1
  % The standard bass clef
  \set Staff.clefGlyph = #"clefs.F"
  \set Staff.clefPosition = #2
  \set Staff.middleCPosition = #6
  c'1
  % The baritone clef
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefPosition = #4
  \set Staff.middleCPosition = #4
  c'1
  % The standard choral tenor clef
  \set Staff.clefGlyph = #"clefs.G"
  \set Staff.clefPosition = #-2
  \set Staff.clefOctavation = #-7
  \set Staff.middleCPosition = #1
  c'1
  % A non-standard clef
  \set Staff.clefPosition = #0
  \set Staff.clefOctavation = #0
  \set Staff.middleCPosition = #-4
  c'1 \break

  % The following clef changes do not preserve
  % the normal relationship between notes and clefs:

  \set Staff.clefGlyph = #"clefs.F"
  \set Staff.clefPosition = #2
  c'1
  \set Staff.clefGlyph = #"clefs.G"
  c'1
  \set Staff.clefGlyph = #"clefs.C"
  c'1
  \set Staff.clefOctavation = #7
  c'1
  \set Staff.clefOctavation = #0
  \set Staff.clefPosition = #0
  c'1
  
  % Here we go back to the normal clef:

  \set Staff.middleCPosition = #0
  c'1
}
</pre>
<p>
 <a href="../60/lily-919dc097.ly">
  <img align="middle"
    border="0" src="../60/lily-919dc097.png" alt="[image of music]">
 </a>
</p>

   <p><a name="using-the--tweak-command-to-tweak-individual-grobs.ly"></a>

<h3 class="unnumberedsec">Using the <code>\tweak</code> command to tweak individual grobs</h3>

<p>With the <code>\tweak</code> command, every grob can be tuned directly.  Here
are some examples of available tweaks.

<pre class="verbatim">
\relative c' {
  \time 2/4
  \set fingeringOrientations = #'(right)
  &lt;
    \tweak #'font-size #3 c
    \tweak #'color #red  d-\tweak #'font-size #8 -4
    \tweak #'style #'cross g
    \tweak #'duration-log #2 a
  >2
}
</pre>
<p>
 <a href="../fc/lily-1163b2bd.ly">
  <img align="middle"
    border="0" src="../fc/lily-1163b2bd.png" alt="[image of music]">
 </a>
</p>

   <p><a name="vertically-aligned-dynamics-and-textscripts.ly"></a>

<h3 class="unnumberedsec">Vertically aligned dynamics and textscripts</h3>

<p>By setting the <code>Y-extent</code> property to a suitable value, all
<code>DynamicLineSpanner</code> objects (hairpins and dynamic texts) can be
aligned to a common reference point, regardless of their actual extent. 
This way, every element will be vertically aligned, thus producing a
more pleasing output.

   <p>The same idea is used to align the text scripts along their baseline.

<pre class="verbatim">
music = \relative c'' {
  c2\p^\markup { gorgeous } c\f^\markup { fantastic }
  c4\p c\f\> c c\!\p
}

{
  \music \break
  \override DynamicLineSpanner #'staff-padding = #2.0
  \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
  \override TextScript #'Y-extent = #'(-1.5 . 1.5)
  \music
}
</pre>
<p>
 <a href="../58/lily-531c047d.ly">
  <img align="middle"
    border="0" src="../58/lily-531c047d.png" alt="[image of music]">
 </a>
</p>

   <p><a name="vertically-aligning-ossias-and-lyrics.ly"></a>

<h3 class="unnumberedsec">Vertically aligning ossias and lyrics</h3>

<p>This snippet demonstrates the use of the context properties
<code>alignBelowContext</code> and <code>alignAboveContext</code> to control the
positioning of lyrics and ossias.

<pre class="verbatim">
\paper {
  ragged-right = ##t
}

\relative c' &lt;&lt;
  \new Staff = "1" { c4 c s2 }
  \new Staff = "2" { c4 c s2 }
  \new Staff = "3" { c4 c s2 }
  { \skip 2
    &lt;&lt;
      \lyrics {
        \set alignBelowContext = #"1"
        lyrics4 below
      }
      \new Staff \with {
        alignAboveContext = #"3"
        fontSize = #-2
        \override StaffSymbol #'staff-space = #(magstep -2)
        \remove "Time_signature_engraver"
      } {
        \times 4/6 {
          \override TextScript #'padding = #3
          c8^"ossia above" d e d e f
        }
      }
    >>
  }
>>
</pre>
<p>
 <a href="../52/lily-7de9f8d7.ly">
  <img align="middle"
    border="0" src="../52/lily-7de9f8d7.png" alt="[image of music]">
 </a>
</p>

   <!-- footer_tag --><br><hr>
<div class="node">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Paper-and-layout.html#Paper-and-layout">Paper and layout</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Contexts-and-engravers.html#Contexts-and-engravers">Contexts and engravers</a>,
Up:&nbsp;<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>