<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- header_tag --> <html lang="en"> <head> <title>Properties of layout 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.fr.html#Top"> <link rel="up" href="The-Internals-Reference-manual.fr.html#The-Internals-Reference-manual" title="The Internals Reference manual"> <link rel="next" href="Properties-found-in-interfaces.fr.html#Properties-found-in-interfaces" title="Properties found in interfaces"> <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="Properties-of-layout-objects"></a> Next: <a rel="next" accesskey="n" href="Properties-found-in-interfaces.fr.html#Properties-found-in-interfaces">Properties found in interfaces</a>, Up: <a rel="up" accesskey="u" href="The-Internals-Reference-manual.fr.html#The-Internals-Reference-manual">The Internals Reference manual</a> <hr> </div> <h4 class="subsection">4.2.1 Properties of layout objects</h4> <p><a name="index-properties-of-layout-objects-353"></a><a name="index-properties-of-grobs-354"></a><a name="index-grobs_002c-properties-of-355"></a><a name="index-layout-objects_002c-properties-of-356"></a> Suppose you have a slur in a score which, to your mind, appears too thin and you'd like to draw it a little heavier. How do you go about doing this? You know from the statements earlier about the flexibility of LilyPond that such a thing should be possible, and you would probably guess that an <code>\override</code> command would be needed. But is there a heaviness property for a slur, and if there is, how might it be modified? This is where the Internals Reference manual comes in. It contains all the information you might need to construct this and all other <code>\override</code> commands. <p>Before we look at the Internals Reference a word of warning. This is a <strong>reference</strong> document, which means there is little or no explanation contained within it: its purpose is to present information precisely and concisely. This means it might look daunting at first sight. Don't worry! The guidance and explanation presented here will enable you to extract the information from the Internals Reference for yourself with just a little practice. <p><a name="index-override-example-357"></a><a name="index-Internals-Reference_002c-example-of-using-358"></a> Let's use a concrete example with a simple fragment of real music: <blockquote> <pre class="verbatim"> { \time 6/8 { r4 b8 b[( g]) g | g[( e]) e d[( f]) a | a g } \addlyrics { The man who feels love's sweet e -- mo -- tion } } </pre> <p> <a href="../67/lily-9ef082e1.ly"> <img align="middle" border="0" src="../67/lily-9ef082e1.png" alt="[image of music]"> </a> </p> </blockquote> <p>Suppose now that we decide we would like the slurs to be a little heavier. Is this possible? The slur is certainly a layout object, so the question is, ‘Is there a property belonging to a slur which controls the heaviness?’ To answer this we must look in the Internals Reference, or IR for short. <p>The IR for the version of LilyPond you are using may be found on the LilyPond website at <a href="http://lilypond.org">http://lilypond.org</a>. Go to the documentation page and click on the Internals Reference link. For learning purposes you should use the standard HTML version, not the ‘one big page’ or the PDF. For the next few paragraphs to make sense you will need to actually do this as you read. <p>Under the heading <strong>Top</strong> you will see five links. Select the link to the <em>Backend</em>, which is where information about layout objects is to be found. There, under the heading <strong>Backend</strong>, select the link to <em>All layout objects</em>. The page that appears lists all the layout objects used in your version of LilyPond, in alphabetic order. Select the link to Slur, and the properties of Slurs are listed. <p>An alternative way of finding this page is from the Notation Reference. On one of the pages that deals with slurs you may find a link to the Internals Reference. This link will take you directly to this page, but if you have an idea about the name of the layout object to be tweaked, it is easier to go straight to the IR and search there. <p>This Slur page in the IR tells us first that Slur objects are created by the Slur_engraver. Then it lists the standard settings. Note these are <strong>not</strong> in alphabetic order. Browse down them looking for a property that might control the heaviness of slurs, and you should find <pre class="example"><code>thickness</code> (number) <code>1.2</code> Line thickness, generally measured in <code>line-thickness</code> </pre> <p>This looks a good bet to change the heaviness. It tells us that the value of <code>thickness</code> is a simple <em>number</em>, that the default value is 1.2, and that the units are in another property called <code>line-thickness</code>. <p>As we said earlier, there are few to no explanations in the IR, but we already have enough information to try changing the slur thickness. We see that the name of the layout object is <code>Slur</code>, that the name of the property to change is <code>thickness</code> and that the new value should be a number somewhat larger than 1.2 if we are to make slurs thicker. <p>We can now construct the <code>\override</code> command by simply substituting the values we have found for the names, omitting the context. Let's use a very large value for the thickness at first, so we can be sure the command is working. We get: <pre class="example">\override Slur #'thickness = #5.0 </pre> <p>Don't forget the <code>#'</code> preceding the property name and and <code>#</code> preceding the new value! <p>The final question is, ‘Where should this command be placed?’ While you are unsure and learning, the best answer is, ‘Within the music, before the first slur and close to it.’ Let's do that: <blockquote> <pre class="verbatim"> { \time 6/8 { % Increase thickness of all following slurs from 1.2 to 5.0 \override Slur #'thickness = #5.0 r4 b8 b[( g]) g | g[( e]) e d[( f]) a | a g } \addlyrics { The man who feels love's sweet e -- mo -- tion } } </pre> <p> <a href="../0d/lily-65bfbd2e.ly"> <img align="middle" border="0" src="../0d/lily-65bfbd2e.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">and we see that the slur is indeed heavier. <p>So this is the basic way of constructing <code>\override</code> commands. There are a few more complications that we shall meet in later sections, but you now know all the essentials required to make up your own – but you will still need some practice. This is provided in the examples which follow. <h4 class="subheading">Finding the context</h4> <p><a name="index-context_002c-finding-359"></a> But first, what if we had needed to specify the Context? What should it be? We could guess that slurs are in the Voice context, as they are clearly closely associated with individual lines of music, but can we be sure? To find out, go back to the top of the IR page describing the Slur, where it says ‘Slur objects are created by: Slur engraver’. So slurs will be created in whichever context the <code>Slur_engraver</code> is in. Follow the link to the <code>Slur_engraver</code> page. At the very bottom it tells us that <code>Slur_engraver</code> is part of five Voice contexts, including the standard voice context, <code>Voice</code>, so our guess was correct. And because <code>Voice</code> is one of the lowest level contexts which is implied unambiguously by the fact that we are entering notes, we can omit it in this location. <h4 class="subheading">Overriding once only</h4> <p><a name="index-overriding-once-only-360"></a><a name="index-once-override-361"></a><a name="index-g_t_005conce-362"></a><a name="index-g_t_005conce-363"></a> <p>As you can see, <em>all</em> the slurs are thicker in the final example above. But what if we wanted just the first slur to be thicker? This is achieved with the <code>\once</code> command. Placed immediately before the <code>\override</code> command it causes it to change only the slur which begins on the <strong>immediately following</strong> note. If the immediately following note does not begin a slur the command has no effect at all – it is not remembered until a slur is encountered, it is simply discarded. So the command with <code>\once</code> must be repositioned as follows: <blockquote> <pre class="verbatim"> { \time 6/8 { r4 b8 % Increase thickness of immediately following slur only \once \override Slur #'thickness = #5.0 b[( g]) g | g[( e]) e d[( f]) a | a g } \addlyrics { The man who feels love's sweet e -- mo -- tion } } </pre> <p> <a href="../79/lily-e3e2db37.ly"> <img align="middle" border="0" src="../79/lily-e3e2db37.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">Now only the first slur is made heavier. <p>The <code>\once</code> command can also be used before the <code>\set</code> command. <h4 class="subheading">Reverting</h4> <p><a name="index-revert-364"></a><a name="index-default-properties_002c-reverting-365"></a><a name="index-g_t_005crevert-366"></a><a name="index-g_t_005crevert-367"></a> <p>Finally, what if we wanted just the first two slurs to be heavier? Well, we could use two commands, each preceded by <code>\once</code> placed immediately before each of the notes where the slurs begin: <blockquote> <pre class="verbatim"> { \time 6/8 { r4 b8 % Increase thickness of immediately following slur only \once \override Slur #'thickness = #5.0 b[( g]) g | % Increase thickness of immediately following slur only \once \override Slur #'thickness = #5.0 g[( e]) e d[( f]) a | a g } \addlyrics { The man who feels love's sweet e -- mo -- tion } } </pre> <p> <a href="../6d/lily-6e0309f7.ly"> <img align="middle" border="0" src="../6d/lily-6e0309f7.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">or we could omit the <code>\once</code> command and use the <code>\revert</code> command to return the <code>thickness</code> property to its default value after the second slur: <blockquote> <pre class="verbatim"> { \time 6/8 { r4 b8 % Increase thickness of all following slurs from 1.2 to 5.0 \override Slur #'thickness = #5.0 b[( g]) g | g[( e]) % Revert thickness of all following slurs to default of 1.2 \revert Slur #'thickness e d[( f]) a | a g } \addlyrics { The man who feels love's sweet e -- mo -- tion } } </pre> <p> <a href="../dc/lily-4f0d3500.ly"> <img align="middle" border="0" src="../dc/lily-4f0d3500.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">The <code>\revert</code> command can be used to return any property changed with <code>\override</code> back to its default value. You may use whichever method best suits what you want to do. <p>That concludes our introduction to the IR, and the basic method of tweaking. Several examples follow in the later sections of this Chapter, partly to introduce you to some of the additional features of the IR, and partly to give you more practice in extracting information from it. These examples will contain progressively fewer words of guidance and explanation. <!-- footer_tag --><br><hr> <div class="node"> <p> Next: <a rel="next" accesskey="n" href="Properties-found-in-interfaces.fr.html#Properties-found-in-interfaces">Properties found in interfaces</a>, Up: <a rel="up" accesskey="u" href="The-Internals-Reference-manual.fr.html#The-Internals-Reference-manual">The Internals Reference manual</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="Properties-of-layout-objects.es.html">español</a>. <BR> </P> </BODY></html>