Sophie

Sophie

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

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

<h2 class="unnumbered">Repeats</h2>

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

   <p><a name="adding-volta-brackets-to-additional-staves.ly"></a>

<h3 class="unnumberedsec">Adding volta brackets to additional staves</h3>

<p>The <code>Volta_engraver</code> by default resides in the <code>Score</code>
context, and brackets for the repeat are thus normally only printed
over the topmost staff. This can be adjusted by adding the
<code>Volta_engraver</code> to the <code>Staff</code> context where the brackets
should appear; see also the "Volta multi staff" snippet.

<pre class="verbatim">
&lt;&lt;
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
  \new Staff \with { \consists "Volta_engraver" } { c'2 g' e' a' }
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
>>
</pre>
<p>
 <a href="../d7/lily-983569f3.ly">
  <img align="middle"
    border="0" src="../d7/lily-983569f3.png" alt="[image of music]">
 </a>
</p>

   <p><a name="isolated-percent-repeats.ly"></a>

<h3 class="unnumberedsec">Isolated percent repeats</h3>

<p>Isolated percents can also be printed.  This is done by entering a
multi-measure rest with a different print function:

<pre class="verbatim">
\relative c'' {
  \override MultiMeasureRest #'stencil
     = #ly:multi-measure-rest::percent
  R1
}
</pre>
<p>
 <a href="../7e/lily-ddfcefb7.ly">
  <img align="middle"
    border="0" src="../7e/lily-ddfcefb7.png" alt="[image of music]">
 </a>
</p>

   <p><a name="measure-counter.ly"></a>

<h3 class="unnumberedsec">Measure counter</h3>

<p>This snippet provides a workaround for emitting measure counters using
transparent percent repeats.

<pre class="verbatim">
&lt;&lt;
  \context Voice = "foo" {
    \clef bass
    c4 r g r
    c4 r g r
    c4 r g r
    c4 r g r
  }
  \context Voice = "foo" {
    \set countPercentRepeats = ##t
    \override PercentRepeat #'transparent = ##t
    \override PercentRepeatCounter #'staff-padding = #1
    \repeat percent 4 { s1 }
  }
>>
</pre>
<p>
 <a href="../a1/lily-804e41ff.ly">
  <img align="middle"
    border="0" src="../a1/lily-804e41ff.png" alt="[image of music]">
 </a>
</p>

   <p><a name="percent-repeat-counter.ly"></a>

<h3 class="unnumberedsec">Percent repeat counter</h3>

<p>Measure repeats of more than two repeats can get a counter when the
convenient property is switched, as shown in this example:

<pre class="verbatim">
\relative c'' {
  \set countPercentRepeats = ##t
  \repeat percent 4 { c1 }
}
</pre>
<p>
 <a href="../e2/lily-98b0e9d3.ly">
  <img align="middle"
    border="0" src="../e2/lily-98b0e9d3.png" alt="[image of music]">
 </a>
</p>

   <p><a name="positioning-segno-and-coda-with-line-break.ly"></a>

<h3 class="unnumberedsec">Positioning segno and coda (with line break)</h3>

<p>If you want to place an exiting segno sign and add text like "D.S. al
Coda" next to it where usually the staff lines are you can use this
snippet. The coda will resume in a new line. There is a variation
documented in this snippet, where the coda will remain on the same
line.

<pre class="verbatim">
{ 
  \clef treble
  \key g \major
  \time 4/4
  \relative c'' {
    \repeat unfold 2 {
      | c4 c c c
    }
    
    % Set segno sign as rehearsal mark and adjust size if needed
    % \once \override Score.RehearsalMark #'font-size = #3
    \mark \markup { \musicglyph #"scripts.segno" }
    \repeat unfold 2 {
      | c4 c c c
    }
    
    % Set coda sign as rehearsal mark and adjust size if needed
    \once \override Score.RehearsalMark #'font-size = #4
    \mark \markup { \musicglyph #"scripts.coda" }
    \repeat unfold 2 {
      | c4 c c c
    }
    
    % Should Coda be on anew line?
    % Coda NOT on new line: use \nobreak
    % Coda on new line: DON'T use \nobreak
    % \noBreak
    
    \bar "||"
    
    % Set segno sign as rehearsal mark and adjust size if needed
    \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
    % \once \override Score.RehearsalMark #'font-size = #3
    \mark \markup { \musicglyph #"scripts.segno" }
    
    % Here begins the trickery! 
    % \cadenzaOn will suppress the bar count and \stopStaff removes the staff lines.
    \cadenzaOn 
      \stopStaff 
        % Some examples of possible text-displays 
        
        % text line-aligned
        % ==================
        % Move text to the desired position
        % \once \override TextScript #'extra-offset = #'( 2 . -3.5 )
        % | s1*0^\markup { D.S. al Coda } }
        
        % text center-aligned
        % ====================
        % Move text to the desired position
        % \once \override TextScript #'extra-offset = #'( 6 . -5.0 )
        % | s1*0^\markup { \center-column { D.S. "al Coda" } }
        
        % text and symbols center-aligned
        % ===============================
        % Move text to the desired position and tweak spacing for optimum text alignment
        %\once \override TextScript #'extra-offset = #'( 8 . -5.5 )
        \once \override TextScript #'word-space = #1.5
        \once \override TextScript #'X-offset = #8
        \once \override TextScript #'Y-offset = #1.5
        | s1*0^\markup { \center-column { "D.S. al Coda" \line { \musicglyph #"scripts.coda" \musicglyph #"scripts.tenuto" \musicglyph #"scripts.coda"} } }
        
        % Increasing the unfold counter will expand the staff-free space
        \repeat unfold 4 {
          s4 s4 s4 s4
          \bar ""
        }
        % Resume bar count and show staff lines again
     \startStaff
   \cadenzaOff
   
   % Should Coda be on new line?
   % Coda NOT on new line: DON'T use \break
   % Coda on new line: use \break
   \break 
   
   % Show up, you clef and key!
   \once \override Staff.KeySignature #'break-visibility = #end-of-line-invisible
   \once \override Staff.Clef #'break-visibility = #end-of-line-invisible

   % Set coda sign as rehearsal mark and adjust size and position
   
   % Put the coda sign ontop of the (treble-)clef dependend on coda's line-position
      
     % Coda NOT on new line, use this:
     % \once \override Score.RehearsalMark #'extra-offset = #'( -2 . 1.75 )
     
     % Coda on new line, use this:
     \once \override Score.RehearsalMark #'extra-offset = #'( -8.42 . 1.75 )
   
   \once \override Score.RehearsalMark #'font-size = #5
   \mark \markup { \musicglyph #"scripts.coda" }

   % The coda
   \repeat unfold 5 {
      | c4 c c c
    }
    \bar"|."
  }
}
</pre>
<p>
 <a href="../69/lily-bfc347e7.ly">
  <img align="middle"
    border="0" src="../69/lily-bfc347e7.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="shortening-volta-brackets.ly"></a>

<h3 class="unnumberedsec">Shortening volta brackets</h3>

<p>By default, the volta brackets will be drawn over all of the
alternative music, but it is possible to shorten them by setting
<code>voltaSpannerDuration</code>.  In the next example, the bracket only
lasts one measure, which is a duration of 3/4.

<pre class="verbatim">
\relative c'' {
  \time 3/4
  c4 c c
  \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
  \repeat volta 5 { d4 d d }
  \alternative {
    {
      e4 e e
      f4 f f
    }
    { g4 g g }
  }
}
</pre>
<p>
 <a href="../50/lily-33a976e8.ly">
  <img align="middle"
    border="0" src="../50/lily-33a976e8.png" alt="[image of music]">
 </a>
</p>

   <p><a name="volta-below-chords.ly"></a>

<h3 class="unnumberedsec">Volta under chords</h3>

<p>By adding the <code>Volta_engraver</code> to the relevant
staff, volte can be put under chords.
<pre class="verbatim">
\score {
  &lt;&lt;
    \chords {
      c1
      c1
    }
    \new Staff \with { \consists "Volta_engraver" } {
      \repeat volta 2 { c'1 }
      \alternative { c' }
    }
  >>
  \layout {
    \context {
      \Score
      \remove "Volta_engraver"
    }
  }
}
</pre>
<p>
 <a href="../22/lily-5adaa60e.ly">
  <img align="middle"
    border="0" src="../22/lily-5adaa60e.png" alt="[image of music]">
 </a>
</p>

   <p><a name="volta-multi-staff.ly"></a>

<h3 class="unnumberedsec">Volta multi-staff</h3>

<p>By adding the <code>Volta_engraver</code> to the relevant
staff, volte can be put over staves other than the topmost
one in a score.
<pre class="verbatim">
voltaMusic = \relative c'' {
  \repeat volta 2 {
    c1
  }
  \alternative {
    d1
    e
  }
}

&lt;&lt;
  \new StaffGroup &lt;&lt;
    \context Staff \voltaMusic
    \new Staff \voltaMusic
  >>
  \new StaffGroup &lt;&lt;
    \new Staff \with { \consists "Volta_engraver" }
      \voltaMusic
    \new Staff \voltaMusic
  >>
>>
</pre>
<p>
 <a href="../63/lily-2dcbf660.ly">
  <img align="middle"
    border="0" src="../63/lily-2dcbf660.png" alt="[image of music]">
 </a>
</p>

   <p><a name="volta-text-markup-using-repeatcommands.ly"></a>

<h3 class="unnumberedsec">Volta text markup using <code>repeatCommands</code></h3>

<p>Though volte are best specified using
<code>\repeat volta</code>, the context property <code>repeatCommands</code>
must be used in cases where the volta text needs more advanced
formatting with <code>\markup</code>.

   <p>Since <code>repeatCommands</code> takes a list, the simplest method of
including markup is to use an identifier for the text and embed
it in the command list using the Scheme syntax
<code>#(list&nbsp;(list&nbsp;'volta&nbsp;textIdentifier))</code><!-- /@w -->. Start- and end-repeat commands
can be added as separate list elements:
<pre class="verbatim">
voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }

\relative c'' {
  c1
  \set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'start-repeat)
  c4 b d e
  \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
  f1
  \set Score.repeatCommands = #'((volta #f))
}
</pre>
<p>
 <a href="../51/lily-aa967734.ly">
  <img align="middle"
    border="0" src="../51/lily-aa967734.png" alt="[image of music]">
 </a>
</p>

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