Sophie

Sophie

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

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>Within-staff objects - 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="Placement-of-objects.html#Placement-of-objects" title="Placement of objects">
<link rel="prev" href="Automatic-behavior.html#Automatic-behavior" title="Automatic behavior">
<link rel="next" href="Outside-staff-objects.html#Outside-staff-objects" title="Outside staff objects">
<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="Within-staff-objects"></a>
<a name="Within_002dstaff-objects"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Outside-staff-objects.html#Outside-staff-objects">Outside staff objects</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Automatic-behavior.html#Automatic-behavior">Automatic behavior</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Placement-of-objects.html#Placement-of-objects">Placement of objects</a>
<hr>
</div>

<h4 class="subsection">4.4.2 Within-staff objects</h4>

<p>We have already seen how the commands <code>\voiceXXX</code> affect
the direction of slurs, ties, fingering and
everything else which depends on the direction of the stems. 
These commands are essential when writing polyphonic music to
permit interweaving melodic lines to be distinguished. 
But occasionally it may be necessary to override this automatic
behavior.  This can be done for whole sections of music or even
for an individual note.  The property which controls this
behavior is the <code>direction</code> property of each layout object. 
We first explain what this does, and then introduce a number of
ready-made commands which avoid your having to code explicit
overrides for the more common modifications.

   <p>Some layout objects like slurs and ties curve, bend or point
either up or down; others like stems and flags also move to
right or left when they point up or down.  This is controlled
automatically when <code>direction</code> is set.

   <p>The following example shows in bar 1 the default behavior of
stems,
with those on high notes pointing down and those on low notes
pointing up, followed by four notes with all stems forced down,
four notes with all stems forced up, and finally four notes
reverted back to the default behavior.

   <blockquote>
<pre class="verbatim">     
     a4 g c a
     \override Stem #'direction = #DOWN
     a g c a
     \override Stem #'direction = #UP
     a g c a
     \revert Stem #'direction
     a g c a
</pre>
     <p>
 <a href="../01/lily-4281f5f4.ly">
  <img align="middle"
    border="0" src="../01/lily-4281f5f4.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Here we use the constants <code>DOWN</code> and <code>UP</code>. 
These have the values <code>-1</code> and <code>+1</code> respectively, and
these numerical values may be used instead.  The value <code>0</code>
may also be used in some cases.  It is simply treated as meaning
<code>UP</code> for stems, but for some objects it means &lsquo;center&rsquo;. 
There is a constant, <code>CENTER</code> which has the value <code>0</code>.

   <p>However, these explicit overrides are not usually used, as there
are simpler equivalent predefined commands available. 
Here is a table of the commonest.  The meaning of each is stated
where it is not obvious.

   <p><table summary=""><tr align="left"><th valign="top" width="20%">Down/Left
  </th><th valign="top" width="20%">Up/Right
  </th><th valign="top" width="25%">Revert
  </th><th valign="top" width="35%">Effect
<br></th></tr><tr align="left"><td valign="top" width="20%"><code>\arpeggioArrowDown</code>
  </td><td valign="top" width="20%"><code>\arpeggioArrowUp</code>
  </td><td valign="top" width="25%"><code>\arpeggioNormal</code>
  </td><td valign="top" width="35%">Arrow is at bottom, at top, or no arrow
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\dotsDown</code>
  </td><td valign="top" width="20%"><code>\dotsUp</code>
  </td><td valign="top" width="25%"><code>\dotsNeutral</code>
  </td><td valign="top" width="35%">Direction of movement to avoid staff lines
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\dynamicDown</code>
  </td><td valign="top" width="20%"><code>\dynamicUp</code>
  </td><td valign="top" width="25%"><code>\dynamicNeutral</code>
  </td><td valign="top" width="35%">
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\phrasingSlurDown</code>
  </td><td valign="top" width="20%"><code>\phrasingSlurUp</code>
  </td><td valign="top" width="25%"><code>\phrasingSlurNeutral</code>
  </td><td valign="top" width="35%">Note: distinct from slur commands
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\slurDown</code>
  </td><td valign="top" width="20%"><code>\slurUp</code>
  </td><td valign="top" width="25%"><code>\slurNeutral</code>
  </td><td valign="top" width="35%">
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\stemDown</code>
  </td><td valign="top" width="20%"><code>\stemUp</code>
  </td><td valign="top" width="25%"><code>\stemNeutral</code>
  </td><td valign="top" width="35%">
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\textSpannerDown</code>
  </td><td valign="top" width="20%"><code>\textSpannerUp</code>
  </td><td valign="top" width="25%"><code>\textSpannerNeutral</code>
  </td><td valign="top" width="35%">Text entered as spanner is below/above staff
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\tieDown</code>
  </td><td valign="top" width="20%"><code>\tieUp</code>
  </td><td valign="top" width="25%"><code>\tieNeutral</code>
  </td><td valign="top" width="35%">
<br></td></tr><tr align="left"><td valign="top" width="20%"><code>\tupletDown</code>
  </td><td valign="top" width="20%"><code>\tupletUp</code>
  </td><td valign="top" width="25%"><code>\tupletNeutral</code>
  </td><td valign="top" width="35%">Tuplets are below/above notes
   <br></td></tr></table>

   <p>Note that these predefined commands may <strong>not</strong> be
preceded by <code>\once</code>.  If you wish to limit the
effect to a single note you must either use the equivalent
<code>\once \override</code> command or use the predefined command
followed after the affected note by the corresponding
<code>\xxxNeutral</code> command.

<h4 class="subheading">Fingering</h4>

<p><a name="index-fingering_002c-placement-391"></a>
The placement of fingering is also affected by the value
of its <code>direction</code> property, but there are special
commands which allow the fingering of individual notes
of chords to be controlled, with the fingering being placed
above, below, to the left or to the right of each note.

   <p>First, here's the effect of <code>direction</code> on fingering,
the first bar shows the default, then the effect of specifying
<code>DOWN</code> and <code>UP</code>:

   <blockquote>
<pre class="verbatim">     
     c-5 a-3 f-1 c'-5
     \override Fingering #'direction = #DOWN
     c-5 a-3 f-1 c'-5
     \override Fingering #'direction = #UP
     c-5 a-3 f-1 c'-5
</pre>
     <p>
 <a href="../8f/lily-34a9bb3f.ly">
  <img align="middle"
    border="0" src="../8f/lily-34a9bb3f.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>This is how to control fingering on single notes, but the
<code>direction</code>
property is ignored for chords.  Instead, by default, the
fingering is automatically placed both above and below the
notes of a chord, as shown:

   <blockquote>
<pre class="verbatim">     
     &lt;c-5 g-3>
     &lt;c-5 g-3 e-2>
     &lt;c-5 g-3 e-2 c-1>
</pre>
     <p>
 <a href="../30/lily-4d6b56e4.ly">
  <img align="middle"
    border="0" src="../30/lily-4d6b56e4.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <p>Greater control over the placement of fingering of the
individual notes in a chord is possible by using
the <code>\set fingeringOrientations</code> command.  The format of
this command is

<pre class="example"><code>\set fingeringOrientations = #'([up] [left/right] [down])</code>
</pre>
   <p class="noindent"><code>\set</code> is used because <code>fingeringOrientations</code> is a
property of the <code>Voice</code> context, created and used by the
<code>New_fingering_engraver</code>.

   <p>The property may be set to a list of one to three values. 
It controls whether fingerings may be placed above (if
<code>up</code> appears in the list), below (if <code>down</code> appears),
to the left (if <code>left</code> appears, or to the right
(if <code>right</code> appears).  Conversely, if a location is not
listed, no fingering is placed there.  LilyPond takes these
constraints and works out the best placement for the fingering
of the notes of the following chords.  Note that <code>left</code> and
<code>right</code> are mutually exclusive &ndash; fingering may be placed
only on one side or the other, not both.

   <p>To control the placement of the fingering of a single note
using this command it is necessary to write it as a single
note chord by placing angle brackets round it.

   <p>Here are a few examples:

   <blockquote>
<pre class="verbatim">     
     \set fingeringOrientations = #'(left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(up left down)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(up left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(right)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
</pre>
     <p>
 <a href="../8c/lily-3d6a3c45.ly">
  <img align="middle"
    border="0" src="../8c/lily-3d6a3c45.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

<p class="noindent">If the fingering seems a little crowded the <code>font-size</code>
could be reduced.  The default value can be seen from the
<code>Fingering</code> object in the IR to be <code>-5</code>, so let's
try <code>-7</code>:

   <blockquote>
<pre class="verbatim">     
     \override Fingering #'font-size = #-7
     \set fingeringOrientations = #'(left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(up left down)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(up left)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
     \set fingeringOrientations = #'(right)
     &lt;f-2>
     &lt; c-1  e-2 g-3 b-5 > 4
</pre>
     <p>
 <a href="../c0/lily-04bbc904.ly">
  <img align="middle"
    border="0" src="../c0/lily-04bbc904.png" alt="[image of music]">
 </a>
</p>

   </blockquote>

   <!-- footer_tag --><br><hr>
<div class="node">
<p>
<a name="Within_002dstaff-objects"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Outside-staff-objects.html#Outside-staff-objects">Outside staff objects</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Automatic-behavior.html#Automatic-behavior">Automatic behavior</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Placement-of-objects.html#Placement-of-objects">Placement of objects</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="Within_002dstaff-objects.es.html">espaƱol</a>.
 <BR>
 
</P>
</BODY></html>