Sophie

Sophie

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

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>Expressive marks - 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="Rhythms.html#Rhythms" title="Rhythms">
<link rel="next" href="Repeats.html#Repeats" title="Repeats">
<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="Expressive-marks"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Repeats.html#Repeats">Repeats</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Rhythms.html#Rhythms">Rhythms</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="unnumbered">Expressive marks</h2>

<p>These snippets illustrate the Notation Reference,
section <a href="../../../Documentation/user/lilypond/Expressive-marks.html#Expressive-marks">Expressive marks</a>.

   <p><a name="adding-beams,-slurs,-ties-etc.-when-using-tuplet-and-non-tuplet-rythms..ly"></a>

<h3 class="unnumberedsec">Adding beams, slurs, ties etc. when using tuplet and non-tuplet rythms.</h3>

<p>LilyPond syntax can involve many unusual placements for parentheses,
brackets etc., which might sometimes have to be interleaved. For
example, when entering a manual beam, the left square bracket has to be
placed after the starting note and its duration, not before. Similarly,
the right square bracket should directly follow the note which is to be
at the end of the requested beaming, even if this note happens to be
inside a tuplet section. This snippet demonstrates how to combine
manual beaming, manual slurs, ties and phrasing slurs with tuplet
sections (enclosed within curly braces).

<pre class="verbatim">
{
  r16[ g16 \times 2/3 { r16 e'8] }
  g16( a \times 2/3 { b d e') }
  g8[( a \times 2/3 { b d') e']~ }
  \time 2/4
  \times 4/5 { e'32\( a b d' e' } a'4.\)
}
</pre>
<p>
 <a href="../bb/lily-e9acede9.ly">
  <img align="middle"
    border="0" src="../bb/lily-e9acede9.png" alt="[image of music]">
 </a>
</p>

   <p><a name="adding-parentheses-around-an-expressive-mark-or-chordal-note.ly"></a>

<h3 class="unnumberedsec">Adding parentheses around an expressive mark or chordal note</h3>

<p>The <code>\parenthesize</code> function is a special tweak that encloses
objects in parentheses.  The associated grob is
<code>Score.ParenthesesItem</code>.

<pre class="verbatim">
\relative c' {
  c2-\parenthesize ->
  \override ParenthesesItem #'padding = #0.1
  \override ParenthesesItem #'font-size = #-4
  &lt;d \parenthesize fis a>2 
}

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

   <p><a name="adjusting-the-shape-of-falls-and-doits.ly"></a>

<h3 class="unnumberedsec">Adjusting the shape of falls and doits</h3>

<p>The <code>shortest-duration-space</code> property may have to be tweaked to
adjust the shape of falls and doits.

<pre class="verbatim">
\relative c'' {
  \override Score.SpacingSpanner #'shortest-duration-space = #4.0
  c2-\bendAfter #+5
  c2-\bendAfter #-3
  c2-\bendAfter #+8
  c2-\bendAfter #-6
}
</pre>
<p>
 <a href="../ef/lily-61f71c03.ly">
  <img align="middle"
    border="0" src="../ef/lily-61f71c03.png" alt="[image of music]">
 </a>
</p>

   <p><a name="broken-crescendo-hairpin.ly"></a>

<h3 class="unnumberedsec">Broken crescendo hairpin</h3>

<p>In order to make parts of a crescendo hairpin invisible, the following
method is used: A white rectangle is drawn on top of the respective
part of the crescendo hairpin, making it invisible.  The rectangle is
defined as postscript code within a text markup.

   <p>To fine-tune the position and size of the markup, the number
preceding <code>setgray</code> in the postscript definition can be set to a
value less than one, making it grey.  The two numbers before <code>scale</code>
in the postscript code are responsible for the width and height of the
rectangle, the two numbers before <code>translate</code> change the x- and
y-origin of the rectangle.

   <p>Make sure to put the hairpin in a lower layer than the text markup to
draw the rectangle over the hairpin.

<pre class="verbatim">
\relative c' {
  &lt;&lt; {
    \dynamicUp
    \override DynamicLineSpanner #'staff-padding = #4
    r2 r16 c'8.\pp r4
  }
  \\
  {
    \override DynamicLineSpanner #'layer = #0
    des,2\mf\&lt; ~
    \override TextScript #'layer = #2
    des16_\markup {
      \postscript #"1.9 -8 translate 5 4 scale 1 setgray 0 0 moveto 0 1
        lineto 1 1 lineto 1 0 lineto 0 0 lineto fill"
    }
    r8. des4 ~ des16->\sff
  } >>
}
</pre>
<p>
 <a href="../06/lily-4c3ef3b4.ly">
  <img align="middle"
    border="0" src="../06/lily-4c3ef3b4.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="center-text-below-hairpin-dynamics.ly"></a>

<h3 class="unnumberedsec">Center text below hairpin dynamics</h3>

<p>This example provides a function to typeset a hairpin (de)crescendo
with some additional text below it, such as "molto" or "poco". The
example also illustrates how to modify the way an object is normally
printed, using some Scheme code.

<pre class="verbatim">
hairpinWithCenteredText = #(define-music-function (parser location text) (markup?)
#{
  \override Voice.Hairpin #'stencil = #(lambda (grob)
  (ly:stencil-aligned-to
   (ly:stencil-combine-at-edge
    (ly:stencil-aligned-to (ly:hairpin::print grob) X CENTER)
    Y DOWN
    (ly:stencil-aligned-to (ly:text-interface::print grob) X CENTER))
   X LEFT))
  \override Voice.Hairpin #'text = $text
#})

hairpinMolto = \hairpinWithCenteredText \markup { \italic molto }
hairpinMore = \hairpinWithCenteredText \markup { \bigger moltissimo }

\layout { ragged-right = ##f }

{
  \hairpinMolto c'2\&lt; c'\f
  \hairpinMore  c'2\&lt; c'\f
}
</pre>
<p>
 <a href="../2f/lily-18ead2c8.ly">
  <img align="middle"
    border="0" src="../2f/lily-18ead2c8.png" alt="[image of music]">
 </a>
</p>

   <p><a name="changing--flageolet-mark-size.ly"></a>

<h3 class="unnumberedsec">Changing \flageolet mark size</h3>

<p>To make the <code>\flageolet</code> circle smaller use the following Scheme
function.

<pre class="verbatim">
smallFlageolet = #(let ((m (make-music 'ArticulationEvent
                          'articulation-type "flageolet")))
       (set! (ly:music-property m 'tweaks)
             (acons 'font-size -3
                    (ly:music-property m 'tweaks)))
       m)

\layout { ragged-right = ##f }

\relative c'' {
  d4^\flageolet_\markup { default size } d_\flageolet
  c4^\smallFlageolet_\markup { smaller } c_\smallFlageolet
}
</pre>
<p>
 <a href="../f0/lily-49d06399.ly">
  <img align="middle"
    border="0" src="../f0/lily-49d06399.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-appearance-of-a-slur-from-solid-to-dotted-or-dashed.ly"></a>

<h3 class="unnumberedsec">Changing the appearance of a slur from solid to dotted or dashed</h3>

<p>The appearance of slurs may be changed from solid to dotted or dashed.

<pre class="verbatim">
\relative c' {
  c4( d e c)
  \slurDotted
  c4( d e c)
  \slurSolid
  c4( d e c)
  \slurDashed
  c4( d e c)
  \slurSolid
  c4( d e c)
}

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

   <p><a name="changing-the-breath-mark-symbol.ly"></a>

<h3 class="unnumberedsec">Changing the breath mark symbol</h3>

<p>The glyph of the breath mark can be tuned by overriding the text
property of the <code>BreathingSign</code> layout object with any markup
text.

<pre class="verbatim">
\relative c'' {
  c2
  \override BreathingSign #'text = \markup { \musicglyph #"scripts.rvarcomma" }
  \breathe
  d2
}
</pre>
<p>
 <a href="../a1/lily-b3d5cc04.ly">
  <img align="middle"
    border="0" src="../a1/lily-b3d5cc04.png" alt="[image of music]">
 </a>
</p>

   <p><a name="combining-dynamics-with-markup-texts.ly"></a>

<h3 class="unnumberedsec">Combining dynamics with markup texts</h3>

<p>Some dynamics may involve text indications (such as "più forte" or
"piano subito"). They can be produced using a <code>\markup</code> block.

<pre class="verbatim">
piuF = \markup { \italic più \dynamic f }
\layout { ragged-right = ##f }
\relative c'' {
  c2\f c-\piuF
}

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

   <p><a name="contemporary-glissando.ly"></a>

<h3 class="unnumberedsec">Contemporary glissando</h3>

<p>A contemporary glissando without a final note can be typeset using a
hidden note and cadenza timing.

<pre class="verbatim">
\relative c'' {
  \time 3/4
  \override Glissando #'style = #'zigzag
  c4 c
  \cadenzaOn
  c4\glissando
  \hideNotes
  c,,4 
  \unHideNotes
  \cadenzaOff
  \bar "|"
}
</pre>
<p>
 <a href="../a3/lily-c6856418.ly">
  <img align="middle"
    border="0" src="../a3/lily-c6856418.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="creating-arpeggios-across-notes-in-different-voices.ly"></a>

<h3 class="unnumberedsec">Creating arpeggios across notes in different voices</h3>

<p>An arpeggio can be drawn across notes in different voices on the same
staff if the <code>Span_arpeggio_engraver</code> is moved to the <code>Staff</code>
context:

<pre class="verbatim">
\new Staff \with {
  \consists "Span_arpeggio_engraver"
}
\relative c' {
  \set Staff.connectArpeggios = ##t
  &lt;&lt;
    { &lt;e' g>4\arpeggio &lt;d f> &lt;d f>2 } \\
    { &lt;d, f>2\arpeggio &lt;g b>2 }
  >>
}
</pre>
<p>
 <a href="../6f/lily-bf2f4de9.ly">
  <img align="middle"
    border="0" src="../6f/lily-bf2f4de9.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-cross-staff-arpeggios-in-a-piano-staff.ly"></a>

<h3 class="unnumberedsec">Creating cross-staff arpeggios in a piano staff</h3>

<p>In a <code>PianoStaff</code>, it is possible to let an arpeggio cross between
the staves by setting the property <code>PianoStaff.connectArpeggios</code>.

<pre class="verbatim">
\new PianoStaff \relative c'' &lt;&lt;
  \set PianoStaff.connectArpeggios = ##t
  \new Staff {
    &lt;c e g c>4\arpeggio
    &lt;g c e g>4\arpeggio
    &lt;e g c e>4\arpeggio
    &lt;c e g c>4\arpeggio
  }
  \new Staff {
    \clef bass
    \repeat unfold 4 {
      &lt;c,, e g c>4\arpeggio
    }
  }
>>
</pre>
<p>
 <a href="../92/lily-a3903623.ly">
  <img align="middle"
    border="0" src="../92/lily-a3903623.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-cross-staff-arpeggios-in-other-contexts.ly"></a>

<h3 class="unnumberedsec">Creating cross-staff arpeggios in other contexts</h3>

<p>Cross-staff arpeggios can be created in contexts other than
<code>PianoStaff</code> if the <code>Span_arpeggio_engraver</code> is included in
the <code>Score</code> context.

<pre class="verbatim">
\score {
  \new StaffGroup {
    \set Score.connectArpeggios = ##t
    &lt;&lt;
      \new Voice \relative c' {
        &lt;c e>2\arpeggio
        &lt;d f>2\arpeggio
        &lt;c e>1\arpeggio
      }
      \new Voice  \relative c {
        \clef bass
         &lt;c g'>2\arpeggio
         &lt;b g'>2\arpeggio
         &lt;c g'>1\arpeggio
      }
    >>
  }
  \layout {
    \context {
      \Score
      \consists "Span_arpeggio_engraver"
    }
  }
}
</pre>
<p>
 <a href="../84/lily-4a6ef4de.ly">
  <img align="middle"
    border="0" src="../84/lily-4a6ef4de.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-real-parenthesized-dynamics.ly"></a>

<h3 class="unnumberedsec">Creating "real" parenthesized dynamics</h3>

<p>Although the easiest way to add parentheses to a dynamic mark is to use
a <code>\markup</code> block, this method has a downside: the created
objects will behave like text markups, and not like dynamics.

   <p>However, it is possible to create a similar object using the equivalent
Scheme code (as described in "Markup programmer interface"), combined
with the <code>make-dynamic-script</code> function. This way, the markup will
be regarded as a dynamic, and therefore will remain compatible with
commands such as <code>\dynamicUp</code> or <code>\dynamicDown</code>.

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

parenF = #(make-dynamic-script (markup #:line (#:normal-text #:italic
           #:fontsize 2 "(" #:hspace -0.8 #:dynamic "f" #:normal-text
           #:italic #:fontsize 2 ")"
          )))
\relative c'' {
  c4\parenF c c \dynamicUp c\parenF
}
</pre>
<p>
 <a href="../71/lily-7346f215.ly">
  <img align="middle"
    border="0" src="../71/lily-7346f215.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-slurs-across-voices.ly"></a>

<h3 class="unnumberedsec">Creating slurs across voices</h3>

<p>In some situations, it may be necessary to create slurs between notes
from different voices.

   <p>The solution is to add invisible notes to one of the voices, using
<code>\hideNotes</code>.

   <p>This example is measure 235 of the Ciaconna from Bach's 2nd Partita for
solo violin, BWV 1004.

<pre class="verbatim">
\relative c' {
  &lt;&lt; {
    d16( a') s a s a[ s a] s a[ s a]
  }
  \\
  {
    \slurUp
    bes,16[ s e](
    \hideNotes a)
    \unHideNotes f[(
    \hideNotes a)
    \unHideNotes fis](
    \hideNotes a)
    \unHideNotes g[(
    \hideNotes a)
    \unHideNotes gis](
    \hideNotes a)
  } >>
}
</pre>
<p>
 <a href="../ce/lily-e9383e5e.ly">
  <img align="middle"
    border="0" src="../ce/lily-e9383e5e.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="hiding-the-extender-line-for-text-dynamics.ly"></a>

<h3 class="unnumberedsec">Hiding the extender line for text dynamics</h3>

<p>Text style dynamic changes (such as cresc. and dim.) are printed with a
dashed line showing their extent.  This line can be suppressed in the
following way:

<pre class="verbatim">
\relative c'' {
  \override DynamicTextSpanner #'dash-period = #-1.0
  \crescTextCresc
  c1\&lt; | d | b | c\!
}
</pre>
<p>
 <a href="../39/lily-50e84808.ly">
  <img align="middle"
    border="0" src="../39/lily-50e84808.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="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="laissez-vibrer-ties.ly"></a>

<h3 class="unnumberedsec">Laissez vibrer ties</h3>

<p>Laissez vibrer ties have a fixed size. Their formatting can be tuned
using <code>'tie-configuration</code>.

<pre class="verbatim">
\relative c' {
  &lt;c e g>4\laissezVibrer r &lt;c f g>\laissezVibrer r
  &lt;c d f g>4\laissezVibrer r &lt;c d f g>4.\laissezVibrer r8

  &lt;c d e f>4\laissezVibrer r
  \override LaissezVibrerTieColumn #'tie-configuration
     = #`((-7 . ,DOWN)
          (-5 . ,DOWN)
          (-3 . ,UP)
          (-1 . ,UP))
  &lt;c d e f>4\laissezVibrer r
}
</pre>
<p>
 <a href="../fd/lily-61b8d987.ly">
  <img align="middle"
    border="0" src="../fd/lily-61b8d987.png" alt="[image of music]">
 </a>
</p>

   <p><a name="line-arrows.ly"></a>

<h3 class="unnumberedsec">Line arrows</h3>

<p>Arrows can be applied to text-spanners and line-spanners
(such as the Glissando).
<pre class="verbatim">
\relative c'' {
  \override TextSpanner #'bound-padding = #1.0
  \override TextSpanner #'dash-fraction = #'()
  \override TextSpanner #'bound-details #'right #'arrow = ##t
  \override TextSpanner #'bound-details #'left #'text = #"fof"
  \override TextSpanner #'bound-details #'right #'text = #"gag"
  \override TextSpanner #'bound-details #'right #'padding = #0.6

  \override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #CENTER
  \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER
  
  \override Glissando #'bound-details #'right #'arrow = ##t
  \override Glissando #'arrow-length = #0.5
  \override Glissando #'arrow-width = #0.25
  
  a8\startTextSpan gis a4 b\glissando b,
  g'4 c\stopTextSpan c2
}
</pre>
<p>
 <a href="../68/lily-9bd8f91e.ly">
  <img align="middle"
    border="0" src="../68/lily-9bd8f91e.png" alt="[image of music]">
 </a>
</p>

   <p><a name="modifying-default-values-for-articulation-shorthand-notation.ly"></a>

<h3 class="unnumberedsec">Modifying default values for articulation shorthand notation</h3>

<p>The shorthands are defined in &lsquo;<samp><span class="samp">ly/script-init.ly</span></samp>&rsquo;, where the
variables <code>dashHat</code>, <code>dashPlus</code>, <code>dashDash</code>,
<code>dashBar</code>, <code>dashLarger</code>, <code>dashDot</code>, and
<code>dashUnderscore</code> are assigned default values.  The default values
for the shorthands can be modified. For example, to associate the
<code>-+</code> (<code>dashPlus</code>) shorthand with the trill symbol instead of
the default + symbol, assign the value <code>trill</code> to the variable
<code>dashPlus</code>:

<pre class="verbatim">
\relative c'' { c1-+ }
dashPlus = "trill"
\relative c'' { c1-+ }
</pre>
<p>
 <a href="../64/lily-497603cb.ly">
  <img align="middle"
    border="0" src="../64/lily-497603cb.png" alt="[image of music]">
 </a>
</p>

   <p><a name="piano-template-with-centered-dynamics.ly"></a>

<h3 class="unnumberedsec">Piano template with centered dynamics</h3>

<p>Many piano scores have the dynamics centered between the two staves. 
This requires a bit of tweaking to implement, but since the template is
right here, you don't have to do the tweaking yourself.

<pre class="verbatim">
upper = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a4 b c d
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  
  a2 c
}

dynamics = {
  s2\fff\> s4 s\!\pp
}

pedal = {
  s2\sustainOn s\sustainOff
}

\score {
  \new PianoStaff &lt;&lt;
    \new Staff = "upper" \upper
    \new Dynamics = "dynamics" \dynamics
    \new Staff = "lower" &lt;&lt;
      \clef bass
      \lower
    >>
    \new Dynamics = "pedal" \pedal
  >>
  \layout {
    \context {
      \type "Engraver_group"
      \name Dynamics
      % So that \cresc works, for example.
      \alias Voice
      \consists "Output_property_engraver"
      
      \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
      \override DynamicLineSpanner #'Y-offset = #0
      pedalSustainStrings = #'("Ped." "*Ped." "*")
      pedalUnaCordaStrings = #'("una corda" "" "tre corde")
      
      \consists "Piano_pedal_engraver"
      \consists "Script_engraver"
      \consists "Dynamic_engraver"
      \consists "Text_engraver"
      
      \override TextScript #'font-size = #2
      \override TextScript #'font-shape = #'italic
      
      \consists "Skip_event_swallow_translator"
      
      \consists "Axis_group_engraver"
    }
    \context {
      \PianoStaff
      \accepts Dynamics
    }
  }
}
\score {
  \new PianoStaff &lt;&lt;
    \new Staff = "upper" &lt;&lt; \upper \dynamics \pedal >>
    \new Staff = "lower" &lt;&lt; \lower \dynamics \pedal >>
  >>
  \midi { }
}
</pre>
<p>
 <a href="../81/lily-165c7953.ly">
  <img align="middle"
    border="0" src="../81/lily-165c7953.png" alt="[image of music]">
 </a>
</p>

   <p><a name="printing-hairpins-using-al-niente-notation.ly"></a>

<h3 class="unnumberedsec">Printing hairpins using al niente notation</h3>

<p>Hairpins may be printed with a circled tip (al niente notation) by
setting the <code>circled-tip</code> property of the <code>Hairpin</code> object to
<code>#t</code>.

<pre class="verbatim">
\relative c'' {
  \override Hairpin #'circled-tip = ##t
  c2\&lt; c\!
  c4\> c\&lt; c2\!
}
</pre>
<p>
 <a href="../f7/lily-5bf21882.ly">
  <img align="middle"
    border="0" src="../f7/lily-5bf21882.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="setting-hairpin-behavior-at-bar-lines.ly"></a>

<h3 class="unnumberedsec">Setting hairpin behavior at bar lines</h3>

<p>If the note which ends a hairpin falls on a downbeat,
the hairpin stops at the bar line immediately preceding.  This behavior
can be controlled by overriding the <code>to-barline</code> property.

<pre class="verbatim">
\relative c'' {
  e4\&lt; e2.
  e1\!
  \override Hairpin #'to-barline = ##f
  e4\&lt; e2.
  e1\!
}
</pre>
<p>
 <a href="../b1/lily-0f325864.ly">
  <img align="middle"
    border="0" src="../b1/lily-0f325864.png" alt="[image of music]">
 </a>
</p>

   <p><a name="setting-the-minimum-length-of-hairpins.ly"></a>

<h3 class="unnumberedsec">Setting the minimum length of hairpins</h3>

<p>If hairpins are too short, they can be lengthened by modifying the
<code>minimum-length</code> property of the <code>Hairpin</code> object.

<pre class="verbatim">
\relative c'' {
  c4\&lt; c\! d\> e\!
  \override Hairpin #'minimum-length = #5
  &lt;&lt; f1 { s4 s\&lt; s\> s\! } >>
}
</pre>
<p>
 <a href="../26/lily-05e97732.ly">
  <img align="middle"
    border="0" src="../26/lily-05e97732.png" alt="[image of music]">
 </a>
</p>

   <p><a name="using-double-slurs-for-legato-chords.ly"></a>

<h3 class="unnumberedsec">Using double slurs for legato chords</h3>

<p>Some composers write two slurs when they want legato chords.  This can
be achieved by setting <code>doubleSlurs</code>.

<pre class="verbatim">
\relative c' {
  \set doubleSlurs = ##t
  &lt;c e>4( &lt;d f> &lt;c e> &lt;d f>)
}
</pre>
<p>
 <a href="../01/lily-f47ba35f.ly">
  <img align="middle"
    border="0" src="../01/lily-f47ba35f.png" alt="[image of music]">
 </a>
</p>

   <p><a name="vertically-aligning-dynamics-across-multiple-notes.ly"></a>

<h3 class="unnumberedsec">Vertically aligning dynamics across multiple notes</h3>

<p>Dynamics that occur at, begin on, or end on the same note will be
vertically aligned.  To ensure that dynamics are aligned when they do
not occur on the same note, increase the <code>staff-padding</code> property
of the <code>DynamicLineSpanner</code> object.

<pre class="verbatim">
\relative c' {
  \override DynamicLineSpanner #'staff-padding = #4
  c2\p f\mf
  g2\&lt; b4\> c\!
}
</pre>
<p>
 <a href="../77/lily-2903ec6d.ly">
  <img align="middle"
    border="0" src="../77/lily-2903ec6d.png" alt="[image of music]">
 </a>
</p>

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