29.11.2012 Views

mpdolce - LilyPond

mpdolce - LilyPond

mpdolce - LilyPond

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3: Fundamental concepts 62<br />

Rest engraver Engraves rests<br />

Staff symbol engraver Engraves the five (by default) lines of the staff<br />

Stem engraver Creates stems and single-stem tremolos<br />

Time signature engraver Creates time signatures<br />

We shall see later how the output of <strong>LilyPond</strong> can be changed by modifying the action of<br />

Engravers.<br />

See also<br />

Internals reference: Section “Engravers and Performers” in Internals Reference.<br />

3.3.4 Modifying context properties<br />

Contexts are responsible for holding the values of a number of context properties. Many of them<br />

can be changed to influence the interpretation of the input and so change the appearance of the<br />

output. They are changed by the \set command. This takes the form<br />

\set ContextName.propertyName = #value<br />

Where the ContextName is usually Score, Staff or Voice. It may be omitted, in which case<br />

Voice is assumed.<br />

The names of context properties consist of words joined together with no hyphens or underscores,<br />

all except the first having a capital letter. Here are a few examples of some commonly<br />

used ones. There are many more.<br />

propertyName Type Function Example<br />

Value<br />

extraNatural Boolean If true, set extra natural signs before<br />

accidentals<br />

#t, #f<br />

currentBarNumber Integer Set the current bar number 50<br />

doubleSlurs Boolean If true, print slurs both above and below<br />

notes<br />

#t, #f<br />

instrumentName Text Set the name to be placed at the start of<br />

the staff<br />

"Cello I"<br />

fontSize Real Increase or decrease the font size 2.4<br />

stanza Text Set the text to print before the start of<br />

a verse<br />

"2"<br />

where a Boolean is either True (#t) or False (#f), an Integer is a positive whole number, a Real<br />

is a positive or negative decimal number, and text is enclosed in double apostrophes. Note the<br />

occurrence of hash signs, (#), in two different places – as part of the Boolean value before the t<br />

or f, and before value in the \set statement. So when a Boolean is being entered you need to<br />

code two hash signs, e.g., ##t.<br />

Before we can set any of these properties we need to know in which context they operate.<br />

Sometimes this is obvious, but occasionally it can be tricky. If the wrong context is specified,<br />

no error message is produced, but the expected action will not take place. For example, the<br />

instrumentName clearly lives in the Staff context, since it is the staff that is to be named. In<br />

this example the first staff is labelled, but not the second, because we omitted the context name.<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!