09.09.2013 Views

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Hoofdstuk 4: Tweaking output 88<br />

4 Tweaking output<br />

This chapter discusses how to modify output. <strong>LilyPond</strong> is extremely configurable; virtually every<br />

fragment of output may be changed.<br />

4.1 Tweaking basics<br />

4.1.1 Introduction to tweaks<br />

‘Tweaking’ is a <strong>LilyPond</strong> term for the various methods available to the user for modifying<br />

the actions taken during interpretation of the input file and modifying the appearance of the<br />

printed output. Some tweaks are very easy to use; others are more complex. But taken together<br />

the methods available for tweaking permit almost any desired appearance of the printed music<br />

to be achieved.<br />

In this section we cover the basic concepts required to understand tweaking. Later we give a<br />

variety of ready-made commands which can simply be copied to obtain the same effect in your<br />

own scores, and at the same time we show how these commands may be constructed so that you<br />

may learn how to develop your own tweaks.<br />

Before starting on this Chapter you may wish to review the section Sectie 3.3 [Contexts and<br />

engravers], pagina 59, as Contexts, Engravers, and the Properties contained within them are<br />

fundamental to understanding and constructing Tweaks.<br />

4.1.2 Objects and interfaces<br />

Tweaking involves modifying the internal operation and structures of the <strong>LilyPond</strong> program, so<br />

we must first introduce some terms which are used to describe those internal operations and<br />

structures.<br />

The term ‘Object’ is a generic term used to refer to the multitude of internal structures<br />

built by <strong>LilyPond</strong> during the processing of an input file. So when a command like \new Staff<br />

is encountered a new object of type Staff is constructed. That Staff object then holds all the<br />

properties associated with that particular staff, for example, its name and its key signature,<br />

together with details of the engravers which have been assigned to operate within that staff’s<br />

context. Similarly, there are objects to hold the properties of all other contexts, such as Voice<br />

objects, Score objects, Lyrics objects, as well as objects to represent all notational elements<br />

such as bar lines, note heads, ties, dynamics, etc. Every object has its own set of property values.<br />

Some types of object are given special names. Objects which represent items of notation on<br />

the printed output such as note heads, stems, slurs, ties, fingering, clefs, etc are called ‘Layout<br />

objects’, often known as ‘Graphical Objects’, or ‘Grobs’ for short. These are still objects in the<br />

generic sense above, and so they too all have properties associated with them, such as their<br />

position, size, color, etc.<br />

Some layout objects are still more specialized. Phrasing slurs, crescendo hairpins, ottava<br />

marks, and many other grobs are not localized in a single place – they have a starting point, an<br />

ending point, and maybe other properties concerned with their shape. Objects with an extended<br />

shape like these are called ‘Spanners’.<br />

It remains to explain what ‘Interfaces’ are. Many objects, even though they are quite different,<br />

share common features which need to be processed in the same way. For example, all grobs<br />

have a color, a size, a position, etc, and all these properties are processed in the same way<br />

during <strong>LilyPond</strong>’s interpretation of the input file. To simplify these internal operations these<br />

common actions and properties are grouped together in an object called a grob-interface.<br />

There are many other groupings of common properties like this, each one given a name ending<br />

in interface. In total there are over 100 such interfaces. We shall see later why this is of interest<br />

and use to the user.

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

Saved successfully!

Ooh no, something went wrong!