<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- header_tag --> <html lang="en"> <head> <title>Quoting other voices - GNU LilyPond Notation Reference</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="description" content="GNU LilyPond Notation Reference"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Writing-parts.html#Writing-parts" title="Writing parts"> <link rel="prev" href="Instrument-names.html#Instrument-names" title="Instrument names"> <link rel="next" href="Formatting-cue-notes.html#Formatting-cue-notes" title="Formatting cue notes"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1999--2007 by the authors Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections. A copy of the license is included in the section entitled ``GNU Free Documentation License''. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } hr { border:0; height:1; color: #000000; background-color: #000000; } /* hr { border: none; height: 1px; color: #666666; background-color: #666666; } body { border-left: 1px solid #666666; border-right: 1px solid #666666; color: #332d28; margin-right: auto; margin-left: auto; width: 60em; list-style-type: square; font-family: Arial,Helvetica,sans-serif; padding-right: 1em; padding-left: 1em; } a { border-bottom: 1px dashed #344242; text-decoration: none; color: #344242; } a:link { text-decoration: none; } a:visited { border-bottom: 1px dashed #666666; color: #666666; } a:active { border-bottom: 1px solid #00cccc; color: #00cccc; } a:hover { border-bottom: 1px solid #1d7b85; color: #1d7b85; } blockquote { border: 1px solid #cccccc; padding: 3px; width: 40em; } .node { border-left: 1px solid #666666; margin: -0.5em 0px 1em; padding: 2px 1px 0px; font-style: italic; } .node a { border: none; text-decoration: underline; font-style: normal; font-weight: bold; } .verbatim { font-family: "Courier New",Courier,monospace; } .unnumberedsubsubsec { font-size: large; color: #1d7b85; } .subsubheading { font-size: large; color: #3b220d; } .contents { border: 1px dashed #339999; margin: 3px 2em; list-style-type: square; padding-right: 1em; width: 40em; background-color: #fcfff9; } .contents a { border-bottom: 1px dashed #423d34; text-decoration: none; color: #423d34; } .contents a:visited { border-bottom: 1px dashed #666666; color: #666666; } .contents a:active { border-bottom: 1px solid #f0d86d; color: #f0d86d; } .contents a:hover { border-bottom: 1px solid #3b220d; color: #3b220d; } .menu { border-left: 1px dashed #339999; margin: 3px 2em 1em; list-style-type: square; padding-left: 1.4em; width: 40em; } .unnumbered { } h2 { font-size: x-large; color: #1d7b85; } */ --></style> </head> <BODY BGCOLOR=WHITE TEXT=BLACK> <div class="node"> <p> <a name="Quoting-other-voices"></a> Next: <a rel="next" accesskey="n" href="Formatting-cue-notes.html#Formatting-cue-notes">Formatting cue notes</a>, Previous: <a rel="previous" accesskey="p" href="Instrument-names.html#Instrument-names">Instrument names</a>, Up: <a rel="up" accesskey="u" href="Writing-parts.html#Writing-parts">Writing parts</a> <hr> </div> <h5 class="unnumberedsubsubsec">Quoting other voices</h5> <p><a name="index-cues-1458"></a><a name="index-quoting-other-voices-1459"></a><a name="index-fragments-1460"></a><a name="index-cue-notes-1461"></a> Quotations allow fragments of other parts to be inserted directly into a music expression. Before a part can be quoted, the <code>\addQuote</code> command must be used to initialize the quoted fragment. This command must be used in the toplevel scope. The first argument is an identifying string, and the second is a music expression: <pre class="example">flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute } </pre> <p>The <code>\quoteDuring</code> command may then be used to indicate when the quotation should take place. The corresponding measures from the quotation are inserted into the music expression. The syntax is similar to <code>\addQuote</code>: <blockquote> <pre class="verbatim"> flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute } \relative c' { c4 cis \quoteDuring #"flute" { s2 } } </pre> <p> <a href="../3c/lily-1ac935c7.ly"> <img align="middle" border="0" src="../3c/lily-1ac935c7.png" alt="[image of music]"> </a> </p> </blockquote> <p>If the music expression used for <code>\quoteDuring</code> contains anything but a spacer rest or multi-measure rest, a polyphonic situation is created, which is often not desirable: <blockquote> <pre class="verbatim"> flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute } \relative c' { c4 cis \quoteDuring #"flute" { c4 b } } </pre> <p> <a href="../6e/lily-b49d1957.ly"> <img align="middle" border="0" src="../6e/lily-b49d1957.png" alt="[image of music]"> </a> </p> </blockquote> <p>Quotations recognize instrument transposition settings for both the source and target instruments if they are specified using the <code>\transposition</code> command: <blockquote> <pre class="verbatim"> clarinet = \relative c' { \transposition bes f4 fis g gis } \addQuote "clarinet" { \clarinet } \relative c' { c4 cis \quoteDuring #"clarinet" { s2 } } </pre> <p> <a href="../19/lily-6bdf214f.ly"> <img align="middle" border="0" src="../19/lily-6bdf214f.png" alt="[image of music]"> </a> </p> </blockquote> <!-- add to snippets, possibly. It might already be there. -pm --> <!-- The type of events that are present in the quoted music can be --> <!-- trimmed with the @code{quotedEventTypes} property. The default --> <!-- value is @code{(note-event rest-event)}, which means that only --> <!-- notes and rests of the quoted voice end up in the --> <!-- @code{\quoteDuring}. Setting --> <!-- @example --> <!-- \set Staff.quotedEventTypes = --> <!-- #'(note-event articulation-event dynamic-event) --> <!-- @end example --> <!-- @noindent --> <!-- will quote notes (but no rests), together with scripts and --> <!-- dynamics. --> <p class="noindent"> <h5 class="subsubheading">Selected Snippets</h5> <p><em>Quoting another voice with transposition</em> <p>Quotations take into account the transposition of both source and target. In this example, all instruments play sounding middle C; the target is an instrument in F. The target part may be transposed using <code>\transpose</code>. In this case, all the pitches (including the quoted ones) are transposed. <blockquote> <pre class="verbatim"> \addQuote clarinet { \transposition bes \repeat unfold 8 { d'16 d' d'8 } } \addQuote sax { \transposition es' \repeat unfold 16 { a8 } } quoteTest = { % french horn \transposition f g'4 << \quoteDuring #"clarinet" { \skip 4 } s4^"clar." >> << \quoteDuring #"sax" { \skip 4 } s4^"sax." >> g'4 } { \set Staff.instrumentName = \markup \center-column { Horn \line { in F } } \quoteTest \transpose c' d' << \quoteTest s4_"up a tone" >> } </pre> <p> <a href="../93/lily-20cb2965.ly"> <img align="middle" border="0" src="../93/lily-20cb2965.png" alt="[image of music]"> </a> </p> </blockquote> <p><em>Quoting another voice</em> <p>With <code>\quote</code>, fragments of previously entered music may be quoted. <code>quotedEventTypes</code> will determines which items are quoted. In this example, a 16th rest is not quoted, since <code>rest-event</code> is not in <code>quotedEventTypes</code>. <blockquote> <pre class="verbatim"> quoteMe = \relative c' { fis4 r16 a8.-> b4-\ff c } \addQuote quoteMe \quoteMe original = \relative c'' { c8 d s2 \once \override NoteColumn #'ignore-collision = ##t es8 gis8 } << \new Staff { \set Staff.instrumentName = #"quoteMe" \quoteMe } \new Staff { \set Staff.instrumentName = #"orig" \original } \new Staff \relative c'' << \set Staff.instrumentName = #"orig+quote" \set Staff.quotedEventTypes = #'(note-event articulation-event) \original \new Voice { s4 \set fontSize = #-4 \override Stem #'length-fraction = #(magstep -4) \quoteDuring #"quoteMe" { \skip 2. } } >> >> </pre> <p> <a href="../63/lily-03f58cef.ly"> <img align="middle" border="0" src="../63/lily-03f58cef.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent"> <h5 class="subsubheading">See also</h5> <p class="indent"> <p>Notation Reference: <a href="Instrument-transpositions.html#Instrument-transpositions">Instrument transpositions</a>. <p>Snippets: <a href="../../../input/lsr/lilypond-snippets/Staff-notation.html#Staff-notation">Staff notation</a>. <p>Internals Reference: <a name="index-QuoteMusic-1462"></a><a href="../lilypond-internals/QuoteMusic.html#QuoteMusic">QuoteMusic</a>, <a name="index-Voice-1463"></a><a href="../lilypond-internals/Voice.html#Voice">Voice</a>. <p class="noindent"> <h5 class="subsubheading">Known issues and warnings</h5> <p>Only the contents of the first <code>Voice</code> occurring in an <code>\addQuote</code> command will be considered for quotation, so <var>music</var> cannot contain <code>\new</code> and <code>\context Voice</code> statements that would switch to a different Voice. <p>Quoting grace notes is broken and can even cause LilyPond to crash. <p>Quoting nested triplets may result in poor notation. <p>In earlier versions of LilyPond (pre 2.11), <code>addQuote</code> was written entirely in lower-case letters: <code>\addquote</code>. <!-- footer_tag --><br><hr> <div class="node"> <p> Next: <a rel="next" accesskey="n" href="Formatting-cue-notes.html#Formatting-cue-notes">Formatting cue notes</a>, Previous: <a rel="previous" accesskey="p" href="Instrument-names.html#Instrument-names">Instrument names</a>, Up: <a rel="up" accesskey="u" href="Writing-parts.html#Writing-parts">Writing parts</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> <P> Other languages: <a href="Quoting-other-voices.fr.html">français</a>, <a href="Quoting-other-voices.es.html">español</a>. <BR> </P> </BODY></html>