Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > f07b4b9fcbe6d8ab9260b52d15e551a6 > files > 8195

lilypond-doc-2.12.3-1.fc13.noarch.rpm

<!-- header_tag -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Copyright C 1999-2009 by the authors

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections.
A copy of the license is included in the section entitled "GNU
Free Documentation License".

 -->
<!-- Created on December 15, 2009 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>GNU LilyPond Notation Reference: 1.4.1 Long repeats</title>

<meta name="description" content="GNU LilyPond Notation Reference: 1.4.1 Long repeats">
<meta name="keywords" content="GNU LilyPond Notation Reference: 1.4.1 Long repeats">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#index" rel="start" title="GNU LilyPond &mdash; Notation Reference">
<link href="LilyPond-command-index.html#LilyPond-command-index" rel="index" title="F. LilyPond command index">
<link href="index_toc.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index_abt.html#SEC_About" rel="help" title="About This Document">
<link href="Repeats.html#Repeats" rel="up" title="1.4 Repeats">
<link href="LilyPond-index.html#LilyPond-index" rel="next" title="G. LilyPond index">
<link href="Repeats.html#Repeats" rel="previous" title="1.4 Repeats">
<link rel="stylesheet" type="text/css" title="Patrick McCarty's design" href="lilypond-mccarty.css">
<link rel="alternate stylesheet" type="text/css" href="lilypond.css" title="Andrew Hawryluk's design">
<link rel="alternate stylesheet" type="text/css" href="lilypond-blue.css" title="Kurt Kroon's blue design">
<!--[if lte IE 7]>
<link href="lilypond-ie-fixes.css" rel="stylesheet" type="text/css">
<![endif]-->


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">


<div id="main">
<a name="Long-repeats"></a>
<table class="nav_table">
<tr><td valign="middle" align="left" colspan="1">[<a href="Musical-notation.html#Musical-notation" title="Beginning of this chapter or previous chapter"> &lt;&lt; Musical notation&nbsp;</a>]</td><td valign="middle" align="center" colspan="3">[<a href="index.html#index" title="Cover (top) of document" rel="start">Top</a>][<a href="index_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LilyPond-command-index.html#LilyPond-command-index" title="Index" rel="index">Index</a>][<a href="index_abt.html#SEC_About" title="About (help)" rel="help"> ? </a>]</td><td valign="middle" align="right" colspan="1">[<a href="Specialist-notation.html#Specialist-notation" title="Next chapter">&nbsp;Specialist notation &gt;&gt; </a>]</td></tr><tr><td valign="middle" align="left" colspan="2">[<a href="Repeats.html#Repeats" title="Previous section in reading order" accesskey="p" rel="previous"> &lt; Repeats&nbsp;</a>]</td><td valign="middle" align="center" colspan="1">[<a href="Repeats.html#Repeats" title="Up section" accesskey="u" rel="up">&nbsp; Up :&nbsp;Repeats&nbsp;</a>]</td><td valign="middle" align="right" colspan="2">[<a href="#Normal-repeats" title="Next section in reading order" accesskey="n" rel="next">&nbsp;Normal repeats &gt; </a>]</td></tr></table>
<a name="Long-repeats"></a>
<h3 class="subsection">1.4.1 Long repeats</h3>

<p>This section discusses how to input long (usually multi-measure)
repeats.  The repeats can take two forms: repeats enclosed between
repeat signs; or written out repeats, used to input repetitious music.
Repeat signs can also be controlled manually.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Normal-repeats" accesskey="1">Normal repeats</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Manual-repeat-marks" accesskey="2">Manual repeat marks</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Written_002dout-repeats" accesskey="3">Written-out repeats</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<a name="index-volta"></a>
<a name="index-prima-volta"></a>
<a name="index-seconda-volta"></a>
<a name="index-volta_002c-prima"></a>
<a name="index-volta_002c-seconda"></a>
<a name="index-repeat_002c-normal"></a>
<a name="index-normal-repeat"></a>
<a name="index-repeat-with-alternate-endings"></a>
<a name="index-alternate-endings"></a>
<a name="index-_005crepeat"></a>
<a name="index-_005crepeat-1"></a>
<a name="index-_005calternative"></a>
<a name="index-_005calternative-1"></a>
<a name="index-_005cpartial-2"></a>
<a name="index-_005cpartial-3"></a>

<hr size="6">
<a name="Normal-repeats"></a>
<table class="nav_table">
<tr><td valign="middle" align="left" colspan="1">[<a href="Musical-notation.html#Musical-notation" title="Beginning of this chapter or previous chapter"> &lt;&lt; Musical notation&nbsp;</a>]</td><td valign="middle" align="center" colspan="3">[<a href="index.html#index" title="Cover (top) of document" rel="start">Top</a>][<a href="index_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LilyPond-command-index.html#LilyPond-command-index" title="Index" rel="index">Index</a>][<a href="index_abt.html#SEC_About" title="About (help)" rel="help"> ? </a>]</td><td valign="middle" align="right" colspan="1">[<a href="Specialist-notation.html#Specialist-notation" title="Next chapter">&nbsp;Specialist notation &gt;&gt; </a>]</td></tr><tr><td valign="middle" align="left" colspan="2">[<a href="#Long-repeats" title="Previous section in reading order" accesskey="p" rel="previous"> &lt; Long repeats&nbsp;</a>]</td><td valign="middle" align="center" colspan="1">[<a href="#Long-repeats" title="Up section" accesskey="u" rel="up">&nbsp; Up :&nbsp;Long repeats&nbsp;</a>]</td><td valign="middle" align="right" colspan="2">[<a href="#Manual-repeat-marks" title="Next section in reading order" accesskey="n" rel="next">&nbsp;Manual repeat marks &gt; </a>]</td></tr></table>
<a name="Normal-repeats"></a>
<h4 class="unnumberedsubsubsec">Normal repeats</h4>

<p>The syntax for a normal repeat is
</p>
<blockquote><pre class="example">\repeat volta <var>repeatcount</var> <var>musicexpr</var>
</pre></blockquote>

<p>where <var>musicexpr</var> is a music expression.  Alternate endings can be
produced using <code>\alternative</code>.  In order to delimit the alternate
endings, the group of alternatives must be enclosed in a set of
braces.  If there are more repeats than there are alternate endings,
the earliest repeats are given the first alternative.
</p>
<p>Normal repeats without alternate endings:
</p>
<blockquote><pre class="verbatim">\repeat volta 2 { c4 d e f }
c2 d
\repeat volta 2 { d4 e f g }
</pre><p>
 <a href="../da/lily-4a3ca0f2.ly">
  <img align="middle"
       border="0"
       src="../da/lily-4a3ca0f2.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<p>Normal repeats with alternate endings:
</p>
<blockquote><pre class="verbatim">\repeat volta 4 { c4 d e f }
\alternative {
  { d2 e }
  { f2 g }
}
c1
</pre><p>
 <a href="../84/lily-a3807773.ly">
  <img align="middle"
       border="0"
       src="../84/lily-a3807773.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>




<a name="index-repeat-with-upbeat"></a>
<a name="index-upbeat-in-a-repeat"></a>
<a name="index-anacrucis-in-a-repeat"></a>
<a name="index-repeat-with-anacrucis"></a>
<a name="index-repeat-with-pickup"></a>
<a name="index-pickup-in-a-repeat"></a>
<a name="index-_005cpartial-4"></a>
<a name="index-_005cpartial-5"></a>

<p>Repeats with upbeats can be entered in two ways:
</p>
<blockquote><pre class="verbatim">\partial 4
e |
\repeat volta 4 { c2 d | e2 f | }
\alternative {
  { g4 g g e }
  { a4 a a a | b2. }
}
</pre><p>
 <a href="../8b/lily-1b80480f.ly">
  <img align="middle"
       border="0"
       src="../8b/lily-1b80480f.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<p>or
</p>
<blockquote><pre class="verbatim">\partial 4
\repeat volta 4 { e4 | c2 d | e2 f | }
\alternative {
  { \partial 4*3 g4 g g }
  { a4 a a a | b2. }
}
</pre><p>
 <a href="../90/lily-1fc705d5.ly">
  <img align="middle"
       border="0"
       src="../90/lily-1fc705d5.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>




<a name="index-repeats-with-ties"></a>
<a name="index-alternative-endings-with-ties"></a>
<a name="index-ties-in-repeats"></a>
<a name="index-ties-in-alternative-endings"></a>
<a name="index-_005crepeatTie-2"></a>
<a name="index-_005crepeatTie-3"></a>

<p>Ties may be added to a second ending:
</p>
<blockquote><pre class="verbatim">c1
\repeat volta 2 { c4 d e f ~ }
\alternative {
  { f2 d }
  { f2\repeatTie f, }
}
</pre><p>
 <a href="../38/lily-cad9002d.ly">
  <img align="middle"
       border="0"
       src="../38/lily-cad9002d.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<a name="Selected-Snippets"></a>
<h4 class="subsubheading">Selected Snippets</h4>

<p><em> Shortening volta brackets</em>
</p>

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

<blockquote><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="../dc/lily-3fc711a4.ly">
  <img align="middle"
       border="0"
       src="../dc/lily-3fc711a4.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<p><em> Adding volta brackets to additional staves</em>
</p>

<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 &quot;Volta multi staff&quot; snippet.
</p>

<blockquote><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 &quot;Volta_engraver&quot; } { c'2 g' e' a' }
  \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
&gt;&gt;

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




<a name="See-also-52"></a>
<h4 class="subsubheading">See also</h4>
<p>Music Glossary: <a name="index-repeat"></a>
<a href="../music-glossary/repeat.html#repeat">repeat</a>, <a name="index-volta-1"></a>
<a href="../music-glossary/volta.html#volta">volta</a>.
</p>
<p>Notation Reference: <a href="Bars.html#Bar-lines">Bar lines</a>, <a href="Modifying-context-plug_002dins.html#Modifying-context-plug_002dins">Modifying context plug-ins</a>.
</p>
<p>Snippets: <a href="../../../input/lsr/lilypond-snippets/Repeats.html#Repeats">Repeats</a>.
</p>
<p>Internals Reference: <a name="index-VoltaBracket"></a>
<a href="../lilypond-internals/VoltaBracket.html#VoltaBracket">VoltaBracket</a>,
<a name="index-RepeatedMusic"></a>
<a href="../lilypond-internals/RepeatedMusic.html#RepeatedMusic">RepeatedMusic</a>, <a name="index-VoltaRepeatedMusic"></a>
<a href="../lilypond-internals/VoltaRepeatedMusic.html#VoltaRepeatedMusic">VoltaRepeatedMusic</a>,
<a name="index-UnfoldedRepeatedMusic"></a>
<a href="../lilypond-internals/UnfoldedRepeatedMusic.html#UnfoldedRepeatedMusic">UnfoldedRepeatedMusic</a>.
</p>

<a name="Known-issues-and-warnings-31"></a>
<h4 class="subsubheading">Known issues and warnings</h4>

<a name="index-repeat_002c-ambiguous"></a>
<a name="index-nested-repeat"></a>
<a name="index-repeat_002c-nested"></a>
<a name="index-repeat-timing-information"></a>
<a name="index-repeat-and-measure-number"></a>
<a name="index-timing-information-and-repeats"></a>
<a name="index-measure-number-and-repeats"></a>
<a name="index-repeat-and-slur"></a>
<a name="index-slur-and-repeat"></a>

<p>A nested repeat like
</p>
<blockquote><pre class="example">\repeat &hellip;
\repeat &hellip;
\alternative
</pre></blockquote>

<p>is ambiguous, since it is is not clear to which <code>\repeat</code> the
<code>\alternative</code> belongs.  This ambiguity is resolved by always
having the <code>\alternative</code> belong to the inner <code>\repeat</code>.
For clarity, it is advisable to use braces in such situations.
</p>
<p>Timing information is not remembered at the start of an alternative,
so after a repeat timing information must be reset by hand; for
example, by setting <code>Score.measurePosition</code> or entering
<code>\partial</code>.  Similarly, slurs are also not repeated.
</p>


<hr size="6">
<a name="Manual-repeat-marks"></a>
<table class="nav_table">
<tr><td valign="middle" align="left" colspan="1">[<a href="Musical-notation.html#Musical-notation" title="Beginning of this chapter or previous chapter"> &lt;&lt; Musical notation&nbsp;</a>]</td><td valign="middle" align="center" colspan="3">[<a href="index.html#index" title="Cover (top) of document" rel="start">Top</a>][<a href="index_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LilyPond-command-index.html#LilyPond-command-index" title="Index" rel="index">Index</a>][<a href="index_abt.html#SEC_About" title="About (help)" rel="help"> ? </a>]</td><td valign="middle" align="right" colspan="1">[<a href="Specialist-notation.html#Specialist-notation" title="Next chapter">&nbsp;Specialist notation &gt;&gt; </a>]</td></tr><tr><td valign="middle" align="left" colspan="2">[<a href="#Normal-repeats" title="Previous section in reading order" accesskey="p" rel="previous"> &lt; Normal repeats&nbsp;</a>]</td><td valign="middle" align="center" colspan="1">[<a href="#Long-repeats" title="Up section" accesskey="u" rel="up">&nbsp; Up :&nbsp;Long repeats&nbsp;</a>]</td><td valign="middle" align="right" colspan="2">[<a href="#Written_002dout-repeats" title="Next section in reading order" accesskey="n" rel="next">&nbsp;Written-out repeats &gt; </a>]</td></tr></table>
<a name="Manual-repeat-marks"></a>
<h4 class="unnumberedsubsubsec">Manual repeat marks</h4>

<a name="index-manual-repeat-mark"></a>
<a name="index-repeat_002c-manual"></a>
<a name="index-start-repeat"></a>
<a name="index-repeat_002c-start"></a>
<a name="index-end-repeat"></a>
<a name="index-repeat_002c-end"></a>
<a name="index-repeat-number_002c-changing"></a>
<a name="index-repeat-volta_002c-changing"></a>
<a name="index-volta-bracket"></a>
<a name="index-bracket_002c-volta"></a>
<a name="index-repeatCommands"></a>
<a name="index-repeatCommands-1"></a>
<a name="index-start_002drepeat"></a>
<a name="index-start_002drepeat-1"></a>

<table class="cartouche" border="1"><tr><td>
<p><b>Note:</b> These methods are only used for displaying unusual repeat
constructs, and may produce unexpected behavior.  In most cases,
repeats should be created using the standard <code>\repeat</code> command
or by printing the relevant bar lines.  For more information, see
<a href="Bars.html#Bar-lines">Bar lines</a>.
</p></td></tr></table>

<p>The property <code>repeatCommands</code> can be used to control the
layout of repeats.  Its value is a Scheme list of repeat commands.
</p>
<dl compact="compact">
<dt> <code>start-repeat</code></dt>
<dd><p>Print a <code>|:</code> bar line.
</p>
<blockquote><pre class="verbatim">c1
\set Score.repeatCommands = #'(start-repeat)
d4 e f g
c1
</pre><p>
 <a href="../25/lily-e517d921.ly">
  <img align="middle"
       border="0"
       src="../25/lily-e517d921.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<p>As per standard engraving practice, repeat signs are not printed
at the beginning of a piece.
</p>
</dd>
<dt> <code>end-repeat</code></dt>
<dd><p>Print a <code>:|</code> bar line:
</p>
<blockquote><pre class="verbatim">c1
d4 e f g
\set Score.repeatCommands = #'(end-repeat)
c1
</pre><p>
 <a href="../d6/lily-e0b7f80e.ly">
  <img align="middle"
       border="0"
       src="../d6/lily-e0b7f80e.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



</dd>
<dt> <code>(volta <var>number</var>) ... (volta #f)</code></dt>
<dd><p>Create a new volta with the specified number.  The volta bracket must
be explicitly terminated, or it will not be printed.
</p>
<blockquote><pre class="verbatim">f4 g a b
\set Score.repeatCommands = #'((volta &quot;2&quot;))
g4 a g a
\set Score.repeatCommands = #'((volta #f))
c1
</pre><p>
 <a href="../3b/lily-a1737d5f.ly">
  <img align="middle"
       border="0"
       src="../3b/lily-a1737d5f.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



</dd>
</dl>

<p>Multiple repeat commands may occur at the same point:
</p>
<blockquote><pre class="verbatim">f4 g a b
\set Score.repeatCommands = #'((volta &quot;2, 5&quot;) end-repeat)
g4 a g a
c1
\set Score.repeatCommands = #'((volta #f) (volta &quot;95&quot;) end-repeat)
b1
\set Score.repeatCommands = #'((volta #f))
</pre><p>
 <a href="../c5/lily-2b591cf4.ly">
  <img align="middle"
       border="0"
       src="../c5/lily-2b591cf4.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<a name="index-volta-bracket-with-text"></a>
<a name="index-text-in-volta-bracket"></a>

<p>Text can be included with the volta bracket.  The text can be a
number or numbers or markup text, see <a href="Formatting-text.html#Formatting-text">Formatting text</a>.  The
simplest way to use markup text is to define the markup first,
then include the markup in a Scheme list.
</p>
<blockquote><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 &quot;4.&quot;) end-repeat)
  f1
  \set Score.repeatCommands = #'((volta #f))
}
</pre><p>
 <a href="../a8/lily-5c32ed40.ly">
  <img align="middle"
       border="0"
       src="../a8/lily-5c32ed40.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>




<a name="Selected-Snippets-50"></a>
<h4 class="subsubheading">Selected Snippets</h4>

<p><em> Printing a repeat sign at the beginning of a piece</em>
</p>

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

<blockquote><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 &quot;|:&quot;
  c1
  d1
  d4 e f g
}

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




<a name="See-also-90"></a>
<h4 class="subsubheading">See also</h4>
<p>Notation Reference:
<a href="Bars.html#Bar-lines">Bar lines</a>,
<a href="Formatting-text.html#Formatting-text">Formatting text</a>.
</p>
<p>Snippets:
<a href="../../../input/lsr/lilypond-snippets/Repeats.html#Repeats">Repeats</a>.
</p>
<p>Internals Reference:
<a name="index-VoltaBracket-1"></a>
<a href="../lilypond-internals/VoltaBracket.html#VoltaBracket">VoltaBracket</a>,
<a name="index-RepeatedMusic-1"></a>
<a href="../lilypond-internals/RepeatedMusic.html#RepeatedMusic">RepeatedMusic</a>,
<a name="index-VoltaRepeatedMusic-1"></a>
<a href="../lilypond-internals/VoltaRepeatedMusic.html#VoltaRepeatedMusic">VoltaRepeatedMusic</a>.
</p>

<hr size="6">
<a name="Written_002dout-repeats"></a>
<table class="nav_table">
<tr><td valign="middle" align="left" colspan="1">[<a href="Musical-notation.html#Musical-notation" title="Beginning of this chapter or previous chapter"> &lt;&lt; Musical notation&nbsp;</a>]</td><td valign="middle" align="center" colspan="3">[<a href="index.html#index" title="Cover (top) of document" rel="start">Top</a>][<a href="index_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LilyPond-command-index.html#LilyPond-command-index" title="Index" rel="index">Index</a>][<a href="index_abt.html#SEC_About" title="About (help)" rel="help"> ? </a>]</td><td valign="middle" align="right" colspan="1">[<a href="Specialist-notation.html#Specialist-notation" title="Next chapter">&nbsp;Specialist notation &gt;&gt; </a>]</td></tr><tr><td valign="middle" align="left" colspan="2">[<a href="#Manual-repeat-marks" title="Previous section in reading order" accesskey="p" rel="previous"> &lt; Manual repeat marks&nbsp;</a>]</td><td valign="middle" align="center" colspan="1">[<a href="#Long-repeats" title="Up section" accesskey="u" rel="up">&nbsp; Up :&nbsp;Long repeats&nbsp;</a>]</td><td valign="middle" align="right" colspan="2">[<a href="Short-repeats.html#Short-repeats" title="Next section in reading order" accesskey="n" rel="next">&nbsp;Short repeats &gt; </a>]</td></tr></table>
<a name="Written_002dout-repeats"></a>
<h4 class="unnumberedsubsubsec">Written-out repeats</h4>

<a name="index-written_002dout-repeats"></a>
<a name="index-repetitious-music"></a>
<a name="index-repeats_002c-written_002dout"></a>
<a name="index-repeat_002c-unfold"></a>
<a name="index-unfold-music"></a>
<a name="index-unfold-repeat"></a>
<a name="index-unfold-repeat-with-alternate-endings"></a>
<a name="index-unfold-music-with-alternate-endings"></a>
<a name="index-alternate-ending-in-written_002dout-repeats"></a>
<a name="index-unfold"></a>
<a name="index-unfold-1"></a>

<p>By using the <code>unfold</code> command, repeats can be used to simplify
the writing out of repetitious music.  The syntax is
</p>
<blockquote><pre class="example">\repeat unfold <var>repeatcount</var> <var>musicexpr</var>
</pre></blockquote>

<p>where <var>musicexpr</var> is a music expression and <var>repeatcount</var> is
the number of times <var>musicexpr</var> is repeated.
</p>
<blockquote><pre class="verbatim">c1
\repeat unfold 2 { c4 d e f }
c1
</pre><p>
 <a href="../e7/lily-70f829d8.ly">
  <img align="middle"
       border="0"
       src="../e7/lily-70f829d8.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>



<p>Unfold repeats can be made with alternate endings.  If there are
more repeats than there are alternate endings, the first
alternative ending is applied to the earliest endings.
</p>
<blockquote><pre class="verbatim">c1
\repeat unfold 2 { g4 f e d }
  \alternative {
    { cis2 g' }
    { cis,2 b }
  }
c1
</pre><p>
 <a href="../2f/lily-c242a7bc.ly">
  <img align="middle"
       border="0"
       src="../2f/lily-c242a7bc.png"
       alt="[image of music]">
 </a>
</p>
</blockquote>




<a name="See-also-173"></a>
<h4 class="subsubheading">See also</h4>
<p>Snippets: <a href="../../../input/lsr/lilypond-snippets/Repeats.html#Repeats">Repeats</a>.
</p>
<p>Internals Reference: <a name="index-RepeatedMusic-2"></a>
<a href="../lilypond-internals/RepeatedMusic.html#RepeatedMusic">RepeatedMusic</a>,
<a name="index-UnfoldedRepeatedMusic-1"></a>
<a href="../lilypond-internals/UnfoldedRepeatedMusic.html#UnfoldedRepeatedMusic">UnfoldedRepeatedMusic</a>.
</p>

<hr size="6">
<table class="nav_table">
<tr><td valign="middle" align="left" colspan="1">[<a href="Musical-notation.html#Musical-notation" title="Beginning of this chapter or previous chapter"> &lt;&lt; Musical notation&nbsp;</a>]</td><td valign="middle" align="center" colspan="3">[<a href="index.html#index" title="Cover (top) of document" rel="start">Top</a>][<a href="index_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LilyPond-command-index.html#LilyPond-command-index" title="Index" rel="index">Index</a>][<a href="index_abt.html#SEC_About" title="About (help)" rel="help"> ? </a>]</td><td valign="middle" align="right" colspan="1">[<a href="Specialist-notation.html#Specialist-notation" title="Next chapter">&nbsp;Specialist notation &gt;&gt; </a>]</td></tr><tr><td valign="middle" align="left" colspan="2">[<a href="#Manual-repeat-marks" title="Previous section in reading order" accesskey="p" rel="previous"> &lt; Manual repeat marks&nbsp;</a>]</td><td valign="middle" align="center" colspan="1">[<a href="#Long-repeats" title="Up section" accesskey="u" rel="up">&nbsp; Up :&nbsp;Long repeats&nbsp;</a>]</td><td valign="middle" align="right" colspan="2">[<a href="Short-repeats.html#Short-repeats" title="Next section in reading order" accesskey="n" rel="next">&nbsp;Short repeats &gt; </a>]</td></tr></table>
<!-- footer_tag -->
<div class="footer">
<p class="footer_version">
This page is for LilyPond-2.12.3 (stable-branch).
</p>
<p class="footer_report">
Your <a href="http://lilypond.org/web/devel/participating/documentation-adding">suggestions for the documentation</a> are welcome, please report errors to our <a href="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs">bug list</a>.
</p>
</div>


<p id="languages">
 Other languages: <a href="Long-repeats.fr.html">français</a>, <a href="Long-repeats.es.html">español</a>, <a href="Long-repeats.de.html">deutsch</a>.
 <br>
 
</p>

<!-- FOOTER -->

<!-- end div#main here -->
</div>



<div id="tocframe">
<p class="toc_uplink"><a href="../index.html" 
         title="Documentation Index">&lt;&lt; Back to Documentation Index</a></p>
<h4 class="toc_header"> <a href="index.html#index" title="Start of the manual">Notation Reference</a></h4>
<div class="contents">
<ul class="toc">
  <li class="toc_current"><a name="toc-Musical-notation-1" href="Musical-notation.html#Musical-notation">1. Musical notation</a>
  <ul class="toc">
    <li><a name="toc-Pitches-1" href="Pitches.html#Pitches">1.1 Pitches</a>    </li>
    <li><a name="toc-Rhythms-1" href="Rhythms.html#Rhythms">1.2 Rhythms</a>    </li>
    <li><a name="toc-Expressive-marks-1" href="Expressive-marks.html#Expressive-marks">1.3 Expressive marks</a>    </li>
    <li class="toc_current"><a name="toc-Repeats-1" href="Repeats.html#Repeats">1.4 Repeats</a>
    <ul class="toc">
      <li class="toc_current"><a name="toc-Long-repeats-1" href="Long-repeats.html#Long-repeats">1.4.1 Long repeats</a>
      <ul class="toc">
        <li><a name="toc-Normal-repeats-1" href="Long-repeats.html#Normal-repeats">Normal repeats</a>        </li>
        <li><a name="toc-Manual-repeat-marks-1" href="Long-repeats.html#Manual-repeat-marks">Manual repeat marks</a>        </li>
        <li><a name="toc-Written_002dout-repeats-1" href="Long-repeats.html#Written_002dout-repeats">Written-out repeats</a>        </li>
      </ul>
      </li>
      <li><a name="toc-Short-repeats-1" href="Short-repeats.html#Short-repeats">1.4.2 Short repeats</a>      </li>
    </ul>
    </li>
    <li><a name="toc-Simultaneous-notes-1" href="Simultaneous-notes.html#Simultaneous-notes">1.5 Simultaneous notes</a>    </li>
    <li><a name="toc-Staff-notation-1" href="Staff-notation.html#Staff-notation">1.6 Staff notation</a>    </li>
    <li><a name="toc-Editorial-annotations-1" href="Editorial-annotations.html#Editorial-annotations">1.7 Editorial annotations</a>    </li>
    <li><a name="toc-Text-1" href="Text.html#Text">1.8 Text</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Specialist-notation-1" href="Specialist-notation.html#Specialist-notation">2. Specialist notation</a>
  <ul class="toc">
    <li><a name="toc-Vocal-music-1" href="Vocal-music.html#Vocal-music">2.1 Vocal music</a>    </li>
    <li><a name="toc-Keyboard-and-other-multi_002dstaff-instruments-1" href="Keyboard-and-other-multi_002dstaff-instruments.html#Keyboard-and-other-multi_002dstaff-instruments">2.2 Keyboard and other multi-staff instruments</a>    </li>
    <li><a name="toc-Unfretted-string-instruments-1" href="Unfretted-string-instruments.html#Unfretted-string-instruments">2.3 Unfretted string instruments</a>    </li>
    <li><a name="toc-Fretted-string-instruments-1" href="Fretted-string-instruments.html#Fretted-string-instruments">2.4 Fretted string instruments</a>    </li>
    <li><a name="toc-Percussion-1" href="Percussion.html#Percussion">2.5 Percussion</a>    </li>
    <li><a name="toc-Wind-instruments-1" href="Wind-instruments.html#Wind-instruments">2.6 Wind instruments</a>    </li>
    <li><a name="toc-Chord-notation-1" href="Chord-notation.html#Chord-notation">2.7 Chord notation</a>    </li>
    <li><a name="toc-Ancient-notation-1" href="Ancient-notation.html#Ancient-notation">2.8 Ancient notation</a>    </li>
    <li><a name="toc-World-music-1" href="World-music.html#World-music">2.9 World music</a>    </li>
  </ul>
  </li>
  <li><a name="toc-General-input-and-output-1" href="General-input-and-output.html#General-input-and-output">3. General input and output</a>
  <ul class="toc">
    <li><a name="toc-Input-structure-1" href="Input-structure.html#Input-structure">3.1 Input structure</a>    </li>
    <li><a name="toc-Titles-and-headers-1" href="Titles-and-headers.html#Titles-and-headers">3.2 Titles and headers</a>    </li>
    <li><a name="toc-Working-with-input-files-1" href="Working-with-input-files.html#Working-with-input-files">3.3 Working with input files</a>    </li>
    <li><a name="toc-Controlling-output-1" href="Controlling-output.html#Controlling-output">3.4 Controlling output</a>    </li>
    <li><a name="toc-MIDI-output-1" href="MIDI-output.html#MIDI-output">3.5 MIDI output</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Spacing-issues-1" href="Spacing-issues.html#Spacing-issues">4. Spacing issues</a>
  <ul class="toc">
    <li><a name="toc-Paper-and-pages-1" href="Paper-and-pages.html#Paper-and-pages">4.1 Paper and pages</a>    </li>
    <li><a name="toc-Music-layout-1" href="Music-layout.html#Music-layout">4.2 Music layout</a>    </li>
    <li><a name="toc-Breaks-1" href="Breaks.html#Breaks">4.3 Breaks</a>    </li>
    <li><a name="toc-Vertical-spacing-1" href="Vertical-spacing.html#Vertical-spacing">4.4 Vertical spacing</a>    </li>
    <li><a name="toc-Horizontal-spacing-1" href="Horizontal-spacing.html#Horizontal-spacing">4.5 Horizontal spacing</a>    </li>
    <li><a name="toc-Fitting-music-onto-fewer-pages-1" href="Fitting-music-onto-fewer-pages.html#Fitting-music-onto-fewer-pages">4.6 Fitting music onto fewer pages</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Changing-defaults-1" href="Changing-defaults.html#Changing-defaults">5. Changing defaults</a>
  <ul class="toc">
    <li><a name="toc-Interpretation-contexts-1" href="Interpretation-contexts.html#Interpretation-contexts">5.1 Interpretation contexts</a>    </li>
    <li><a name="toc-Explaining-the-Internals-Reference-1" href="Explaining-the-Internals-Reference.html#Explaining-the-Internals-Reference">5.2 Explaining the Internals Reference</a>    </li>
    <li><a name="toc-Modifying-properties-1" href="Modifying-properties.html#Modifying-properties">5.3 Modifying properties</a>    </li>
    <li><a name="toc-Useful-concepts-and-properties-1" href="Useful-concepts-and-properties.html#Useful-concepts-and-properties">5.4 Useful concepts and properties</a>    </li>
    <li><a name="toc-Advanced-tweaks-1" href="Advanced-tweaks.html#Advanced-tweaks">5.5 Advanced tweaks</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Interfaces-for-programmers-1" href="Interfaces-for-programmers.html#Interfaces-for-programmers">6. Interfaces for programmers</a>
  <ul class="toc">
    <li><a name="toc-Music-functions-1" href="Music-functions.html#Music-functions">6.1 Music functions</a>    </li>
    <li><a name="toc-Programmer-interfaces-1" href="Programmer-interfaces.html#Programmer-interfaces">6.2 Programmer interfaces</a>    </li>
    <li><a name="toc-Building-complicated-functions-1" href="Building-complicated-functions.html#Building-complicated-functions">6.3 Building complicated functions</a>    </li>
    <li><a name="toc-Markup-programmer-interface-1" href="Markup-programmer-interface.html#Markup-programmer-interface">6.4 Markup programmer interface</a>    </li>
    <li><a name="toc-Contexts-for-programmers-1" href="Contexts-for-programmers.html#Contexts-for-programmers">6.5 Contexts for programmers</a>    </li>
    <li><a name="toc-Scheme-procedures-as-properties-1" href="Scheme-procedures-as-properties.html#Scheme-procedures-as-properties">6.6 Scheme procedures as properties</a>    </li>
    <li><a name="toc-Using-Scheme-code-instead-of-_005ctweak-1" href="Using-Scheme-code-instead-of-_005ctweak.html#Using-Scheme-code-instead-of-_005ctweak">6.7 Using Scheme code instead of <code>\tweak</code></a>    </li>
    <li><a name="toc-Difficult-tweaks-1" href="Difficult-tweaks.html#Difficult-tweaks">6.8 Difficult tweaks</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Literature-list-1" href="Literature-list.html#Literature-list">A. Literature list</a>  </li>
  <li><a name="toc-Notation-manual-tables-1" href="Notation-manual-tables.html#Notation-manual-tables">B. Notation manual tables</a>
  <ul class="toc">
    <li><a name="toc-Chord-name-chart-1" href="Chord-name-chart.html#Chord-name-chart">B.1 Chord name chart</a>    </li>
    <li><a name="toc-Common-chord-modifiers-1" href="Common-chord-modifiers.html#Common-chord-modifiers">B.2 Common chord modifiers</a>    </li>
    <li><a name="toc-Predefined-fretboard-diagrams-1" href="Predefined-fretboard-diagrams.html#Predefined-fretboard-diagrams">B.3 Predefined fretboard diagrams</a>    </li>
    <li><a name="toc-MIDI-instruments-1" href="MIDI-instruments.html#MIDI-instruments">B.4 MIDI instruments</a>    </li>
    <li><a name="toc-List-of-colors-1" href="List-of-colors.html#List-of-colors">B.5 List of colors</a>    </li>
    <li><a name="toc-The-Feta-font-1" href="The-Feta-font.html#The-Feta-font">B.6 The Feta font</a>    </li>
    <li><a name="toc-Note-head-styles-1" href="Note-head-styles.html#Note-head-styles">B.7 Note head styles</a>    </li>
    <li><a name="toc-Text-markup-commands-1" href="Text-markup-commands.html#Text-markup-commands">B.8 Text markup commands</a>    </li>
    <li><a name="toc-Text-markup-list-commands-1" href="Text-markup-list-commands.html#Text-markup-list-commands">B.9 Text markup list commands</a>    </li>
    <li><a name="toc-List-of-articulations-1" href="List-of-articulations.html#List-of-articulations">B.10 List of articulations</a>    </li>
    <li><a name="toc-Percussion-notes-1" href="Percussion-notes.html#Percussion-notes">B.11 Percussion notes</a>    </li>
    <li><a name="toc-All-context-properties-1" href="All-context-properties.html#All-context-properties">B.12 All context properties</a>    </li>
    <li><a name="toc-Layout-properties-1" href="Layout-properties.html#Layout-properties">B.13 Layout properties</a>    </li>
    <li><a name="toc-Identifiers-1" href="Identifiers.html#Identifiers">B.14 Identifiers</a>    </li>
    <li><a name="toc-Scheme-functions-1" href="Scheme-functions.html#Scheme-functions">B.15 Scheme functions</a>    </li>
  </ul>
  </li>
  <li><a name="toc-Cheat-sheet-1" href="Cheat-sheet.html#Cheat-sheet">C. Cheat sheet</a>  </li>
  <li><a name="toc-LilyPond-grammar-1" href="LilyPond-grammar.html#LilyPond-grammar">D. LilyPond grammar</a>  </li>
  <li><a name="toc-GNU-Free-Documentation-License-1" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License">E. GNU Free Documentation License</a>  </li>
  <li><a name="toc-LilyPond-command-index-1" href="LilyPond-command-index.html#LilyPond-command-index">F. LilyPond command index</a>  </li>
  <li><a name="toc-LilyPond-index-1" href="LilyPond-index.html#LilyPond-index">G. LilyPond index</a>  </li>
</ul>
</div>
</div>

</body>
</html>