27.03.2013 Views

LilyPond Snippets

LilyPond Snippets

LilyPond Snippets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Contexts and engravers 282<br />

Contexts and engravers<br />

These snippets illustrate Section “Changing defaults” in Notation Reference.<br />

See also Section “Contexts and engravers” in Learning Manual.<br />

Adding a figured bass above or below the notes<br />

When writing a figured bass, here’s a way to specify if you want your figures to be placed<br />

above or below the bass notes, by defining the BassFigureAlignmentPositioning #'direction<br />

property (exclusively in a Staff context). Choices are #UP (or #1), #CENTER (or #0) and #DOWN<br />

(or #-1).<br />

As you can see here, this property can be changed as many times as you wish. Use \once<br />

\override if you don’t want the tweak to apply to the whole score.<br />

bass = {<br />

\clef bass<br />

g4 b, c d<br />

e d8 c d2<br />

}<br />

continuo = \figuremode {<br />

4 8<br />

\once \override Staff.BassFigureAlignmentPositioning #'direction = #CENTER<br />

8 4<br />

\override Staff.BassFigureAlignmentPositioning #'direction = #UP<br />

4 <br />

\set Staff.useBassFigureExtenders = ##t<br />

\override Staff.BassFigureAlignmentPositioning #'direction = #DOWN<br />

4. 8 4<br />

}<br />

\score {<br />

><br />

}<br />

6<br />

<br />

<br />

5<br />

<br />

6<br />

4 <br />

Adding an extra staff at a line break<br />

When adding a new staff at a line break, some extra space is unfortunately added at the end of<br />

the line before the break (to fit in a key signature change, which will never be printed anyway).<br />

The workaround is to add a setting of Staff.explicitKeySignatureVisibility as is shown<br />

in the example. In versions 2.10 and earlier, a similar setting for the time signatures is also<br />

required (see the example).<br />

\score {<br />

\new StaffGroup \relative c'' {

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

Saved successfully!

Ooh no, something went wrong!