Sophie

Sophie

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

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>Soprano and cello - GNU LilyPond Learning Manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="GNU LilyPond Learning Manual">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Extending-the-templates.html#Extending-the-templates" title="Extending the templates">
<link rel="next" href="Four_002dpart-SATB-vocal-score.html#Four_002dpart-SATB-vocal-score" title="Four-part SATB vocal score">
<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="Soprano-and-cello"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Four_002dpart-SATB-vocal-score.html#Four_002dpart-SATB-vocal-score">Four-part SATB vocal score</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Extending-the-templates.html#Extending-the-templates">Extending the templates</a>
<hr>
</div>

<h4 class="subsection">3.4.1 Soprano and cello</h4>

<p><a name="index-template_002c-modifying-323"></a>
Start off with the template that seems closest to what you want to end
up with.  Let's say that you want to write something for soprano and
cello.  In this case, we would start with &lsquo;Notes and lyrics&rsquo; (for the
soprano part).

<pre class="example">\version "2.11.57"<!-- /@w -->
melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4
  a4 b c d
}

text = \lyricmode {
  Aaa Bee Cee Dee
}

\score {
  &lt;&lt;
    \new Voice = "one" {
      \autoBeamOff
      \melody
    }
    \new Lyrics \lyricsto "one" \text
  &gt;&gt;
  \layout { }
  \midi { }
}
</pre>
   <p>Now we want to add a cello part.  Let's look at the &lsquo;Notes only&rsquo; example:

<pre class="example">\version "2.11.57"<!-- /@w -->
melody = \relative c' {
  \clef treble
  \key c \major
  \time 4/4
  a4 b c d
}

\score {
  \new Staff \melody
  \layout { }
  \midi { }
}
</pre>
   <p>We don't need two <code>\version</code> commands.  We'll need the
<code>melody</code> section.  We don't want two <code>\score</code> sections
&ndash; if we had two <code>\score</code>s, we'd get the two parts separately. 
We want them together, as a duet.  Within the <code>\score</code>
section, we don't need two <code>\layout</code> or <code>\midi</code>.

   <p>If we simply cut and paste the <code>melody</code> section, we would
end up with two <code>melody</code> definitions.  This would not generate
an error, but the second one would be used for both melodies. 
So let's rename them to make them distinct.  We'll call the
section for the soprano <code>sopranoMusic</code> and the section for
the cello <code>celloMusic</code>.  While we're doing this, let's rename
<code>text</code> to be <code>sopranoLyrics</code>.  Remember to rename both
instances of all these names &ndash; both the initial definition (the
<code>melody = \relative c' { </code> part) and the name's use (in the
<code>\score</code> section).

   <p>While we're doing this, let's change the cello part's staff &ndash;
celli normally use bass clef.  We'll also give the cello some
different notes.

<pre class="example">\version "2.11.57"<!-- /@w -->
sopranoMusic = \relative c' {
  \clef treble
  \key c \major
  \time 4/4
  a4 b c d
}

sopranoLyrics = \lyricmode {
  Aaa Bee Cee Dee
}

celloMusic = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  d4 g fis8 e d4
}

\score {
  &lt;&lt;
    \new Voice = "one" {
      \autoBeamOff
      \sopranoMusic
    }
    \new Lyrics \lyricsto "one" \sopranoLyrics
  &gt;&gt;
  \layout { }
  \midi { }
}
</pre>
   <p>This is looking promising, but the cello part won't appear in the
score &ndash; we haven't used it in the <code>\score</code> section.  If we
want the cello part to appear under the soprano part, we need to add

<pre class="example">\new Staff \celloMusic
</pre>
   <p class="noindent">underneath the soprano stuff.  We also need to add <code>&lt;&lt;</code> and
<code>&gt;&gt;</code> around the music &ndash; that tells LilyPond that there's
more than one thing (in this case, two <code>Staves</code>) happening
at once.  The <code>\score</code> looks like this now:

<!-- Indentation in this example is deliberately poor -->
<pre class="example">\score {
  &lt;&lt;
  &lt;&lt;
    \new Voice = "one" {
      \autoBeamOff
      \sopranoMusic
    }
    \new Lyrics \lyricsto "one" \sopranoLyrics
  &gt;&gt;
  \new Staff \celloMusic
  &gt;&gt;
  \layout { }
  \midi { }
}
</pre>
   <p class="noindent">This looks a bit messy; the indentation is messed up now.  That is
easily fixed.  Here's the complete soprano and cello template.

   <blockquote>
     <pre class="example">     \version "2.11.57"<!-- /@w -->
</pre>
     <pre class="verbatim">     
     sopranoMusic = \relative c' {
       \clef treble
       \key c \major
       \time 4/4
       a4 b c d
     }
     
     sopranoLyrics = \lyricmode {
       Aaa Bee Cee Dee
     }
     
     celloMusic = \relative c {
       \clef bass
       \key c \major
       \time 4/4
       d4 g fis8 e d4
     }
     
     \score {
       &lt;&lt;
         &lt;&lt;
           \new Voice = "one" {
             \autoBeamOff
             \sopranoMusic
           }
           \new Lyrics \lyricsto "one" \sopranoLyrics
         >>
         \new Staff \celloMusic
       >>
       \layout { }
       \midi { }
     }
</pre>
     <p>
 <a href="../42/lily-3c1bb0d1.ly">
  <img align="middle"
    border="0" src="../42/lily-3c1bb0d1.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

<p class="noindent">

<h5 class="subsubheading">See also</h5>

   <p class="indent">

   <p>The starting templates can be found in the &lsquo;Templates&rsquo; appendix,
see <a href="Single-staff.html#Single-staff">Single staff</a>.

   <!-- footer_tag --><br><hr>
<div class="node">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Four_002dpart-SATB-vocal-score.html#Four_002dpart-SATB-vocal-score">Four-part SATB vocal score</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Extending-the-templates.html#Extending-the-templates">Extending the templates</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="Soprano-and-cello.fr.html">français</a>, <a href="Soprano-and-cello.es.html">español</a>.
 <BR>
 
</P>
</BODY></html>