LilyPond Beginnershandleiding
LilyPond Beginnershandleiding
LilyPond Beginnershandleiding
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Hoofdstuk 3: Fundamentele concepten 66<br />
Setting context properties with \with<br />
The default value of context properties may be set at the time the context is created. Sometimes<br />
this is a clearer way of setting a property value if it is to remain fixed for the duration of the<br />
context. When a context is created with a \new command it may be followed immediately by<br />
a \with { .. } block in which the default property values are set. For example, if we wish to<br />
suppress the printing of extra naturals for the duration of a staff we would write:<br />
like this:<br />
\new Staff \with { extraNatural = ##f }<br />
><br />
<br />
<br />
<br />
<br />
<br />
Properties set in this way may still be changed dynamically using \set and returned to the<br />
default value set in the \with block with \unset.<br />
So if the fontSize property is set in a \with clause it sets the default value of the font size. If<br />
it is later changed with \set, this new default value may be restored with the \unset fontSize<br />
command.<br />
Setting context properties with \context<br />
The values of context properties may be set in all contexts of a particular type, such as all<br />
Staff contexts, with a single command. The context type is identified by using its type name,<br />
like Staff, prefixed by a back-slash: \Staff. The statement which sets the property value is<br />
the same as that in a \with block, introduced above. It is placed in a \context block within<br />
a \layout block. Each \context block will affect all contexts of the type specified throughout<br />
the \score or \book block in which the \layout block appears. Here is a example to show the<br />
format:<br />
\score {<br />
\new Staff {<br />
\relative c'' {<br />
cisis4 e d cis<br />
}<br />
}<br />
\layout {<br />
\context {