<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- header_tag --> <html lang="en"> <head> <title>Single-staff polyphony - 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.fr.html#Top"> <link rel="up" href="Multiple-voices.fr.html#Multiple-voices" title="Multiple voices"> <link rel="next" href="Voice-styles.fr.html#Voice-styles" title="Voice styles"> <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="Single-staff-polyphony"></a> <a name="Single_002dstaff-polyphony"></a> Next: <a rel="next" accesskey="n" href="Voice-styles.fr.html#Voice-styles">Voice styles</a>, Up: <a rel="up" accesskey="u" href="Multiple-voices.fr.html#Multiple-voices">Multiple voices</a> <hr> </div> <h5 class="unnumberedsubsubsec">Single-staff polyphony</h5> <p>The basic structure of code needed to achieve multiple, independent voices in a single staff is illustrated in the following example: <blockquote> <pre class="verbatim"> \new Staff << \new Voice = "first" { \voiceOne r8 r16 g e8. f16 g8[ c,] f e16 d } \new Voice= "second" { \voiceTwo d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. } >> </pre> <p> <a href="../4a/lily-e9b2cca6.ly"> <img align="middle" border="0" src="../4a/lily-e9b2cca6.png" alt="[image of music]"> </a> </p> </blockquote> <p>Here, voices are instantiated explicitly and are given a name. The <code>\voiceOne</code> ... <code>\voiceFour</code> commands set up the voices so that first and third voices get stems up, second and fourth voices get stems down, third and fourth voice note heads are horizontally shifted, and rests in the respective voices are automatically moved to avoid collisions. Using the <code>\oneVoice</code> command, all the voice settings are put back to the neutral directions typical of a single-voice passage. <p>We can make a voice to be in the same <code>Voice</code> context before and after a temporary polyphonic passage. For example, the following construct keeps a voice alive throughout the polyphonic section. Said voice is the first one inside of the two-voice section, and the extra voice is the second one. <pre class="example"><< { \voiceOne ... } \new Voice { \voiceTwo ... } >> \oneVoice </pre> <p>Using the name given when created, this allows lyrics to be assigned to one consistent voice. <blockquote> <pre class="verbatim"> << \new Voice = "melody" { a4 << { \voiceOne g f } \new Voice { \voiceTwo e d } >> \oneVoice e } \new Lyrics \lyricsto "melody" { This is my song. } >> </pre> <p> <a href="../0e/lily-f1c4727c.ly"> <img align="middle" border="0" src="../0e/lily-f1c4727c.png" alt="[image of music]"> </a> </p> </blockquote> <p>Here, the \voiceOne and \voiceTwo commands help to make clear what settings does each voice receive. <p>The <code><<{...} \\ {...}>></code> construction, where the two (or more) voices are separated by double backslashes, can be used as a simplified method to print multiple voices in a single staff. Our first example could be typeset as follows: <blockquote> <pre class="verbatim"> << { r8 r16 g e8. f16 g8[ c,] f e16 d } \\ { d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. } >> </pre> <p> <a href="../ad/lily-6bbabbfb.ly"> <img align="middle" border="0" src="../ad/lily-6bbabbfb.png" alt="[image of music]"> </a> </p> </blockquote> <p>This syntax is simpler and can be used where it does not matter that temporary voices are created and then discarded. These implicitly created voices are given the settings equivalent to the effect of the <code>\voiceOne</code> ... <code>\voiceFour</code> commands, in the order in which they appear in the code. In the following example, the intermediate voice has stems up, therefore we enter it in the third place, so it becomes voice three which has the stems up as desired. <blockquote> <pre class="verbatim"> << { r8 g g g g f16 es f8 d } \\ { es,8 r es r d r d r } \\ { d'8 s c s bes s a s } >> </pre> <p> <a href="../f9/lily-b2537a54.ly"> <img align="middle" border="0" src="../f9/lily-b2537a54.png" alt="[image of music]"> </a> </p> </blockquote> <p>Spacer rests are often used to avoid too many rests, as seen in the example above. <p>In all but simplest works it is advisable to create explicit <code>Voice</code> contexts using the <code>\new</code> and <code>\context</code> commands as it is explained in <a name="index-Contexts-and-engravers-1233"></a><a href="../lilypond-learning/Contexts-and-engravers.fr.html#Contexts-and-engravers">Contexts and engravers</a> and <a name="index-Explicitly-instantiating-voices-1234"></a><a href="../lilypond-learning/Explicitly-instantiating-voices.fr.html#Explicitly-instantiating-voices">Explicitly instantiating voices</a>. <p>In the special case that we want to typeset parallel pieces of music that have the same rhythm, we can combine them into a single <code>Voice</code> context, thus forming chords. To achieve this, enclose them in a simple simultaneous music construction and make it to be an explicit voice: <blockquote> <pre class="verbatim"> \new Voice << { e4 f8 d e16 f g8 d4 } { c4 d8 b c16 d e8 b4 } >> </pre> <p> <a href="../23/lily-de56d6e4.ly"> <img align="middle" border="0" src="../23/lily-de56d6e4.png" alt="[image of music]"> </a> </p> </blockquote> <p>This method leads to strange beamings and warnings if the pieces of music do not have the same rhythm. <p class="noindent"> <h5 class="subsubheading">Predefined commands</h5> <p><a name="index-g_t_005cvoiceOne-1235"></a><a name="index-g_t_005cvoiceOne-1236"></a> <code>\voiceOne</code>, <a name="index-g_t_005cvoiceTwo-1237"></a><a name="index-g_t_005cvoiceTwo-1238"></a> <code>\voiceTwo</code>, <a name="index-g_t_005cvoiceThree-1239"></a><a name="index-g_t_005cvoiceThree-1240"></a> <code>\voiceThree</code>, <a name="index-g_t_005cvoiceFour-1241"></a><a name="index-g_t_005cvoiceFour-1242"></a> <code>\voiceFour</code>, <a name="index-g_t_005coneVoice-1243"></a><a name="index-g_t_005coneVoice-1244"></a> <code>\oneVoice</code>. <p class="noindent"> <h5 class="subsubheading">See also</h5> <p class="indent"> <p>Learning Manual: <a name="index-Voices-contain-music-1245"></a><a href="../lilypond-learning/Voices-contain-music.fr.html#Voices-contain-music">Voices contain music</a>, <a name="index-Explicitly-instantiating-voices-1246"></a><a href="../lilypond-learning/Explicitly-instantiating-voices.fr.html#Explicitly-instantiating-voices">Explicitly instantiating voices</a>. <p>Notation Reference: <a href="Percussion-staves.fr.html#Percussion-staves">Percussion staves</a>, <a href="Invisible-rests.fr.html#Invisible-rests">Invisible rests</a>. <p>Snippets: <a href="../../../input/lsr/lilypond-snippets/Simultaneous-notes.html#Simultaneous-notes">Simultaneous notes</a>. <!-- footer_tag --><br><hr> <div class="node"> <p> <a name="Single_002dstaff-polyphony"></a> Next: <a rel="next" accesskey="n" href="Voice-styles.fr.html#Voice-styles">Voice styles</a>, Up: <a rel="up" accesskey="u" href="Multiple-voices.fr.html#Multiple-voices">Multiple voices</a> </div> <div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;"> <p> <font size="-1"> Cette page documente LilyPond-2.11.57 (branche de développement). <br> <address> Rapportez toute anomalie en français à <a href="mailto:lilypond-user-fr@gnu.org">lilypond-user-fr@gnu.org</a> ou en anglais à <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> Vos <a href="http://lilypond.org/web/devel/participating/documentation-adding">suggestions à propos de la documentation</a> sont les bienvenues. </font> </p> </div> <P> Autres langues : <a href="Single_002dstaff-polyphony.es.html">español</a>. <BR> </P> </BODY></html>