A flexible formatting architecture
Remember the music notation problem? Its solution left us with a bunch of objects. The formatting architecture is built on these objects. Each object carries variables:
- Variables control layout decisions. For example, many objects
have a direction variable that encodes the choice between up
and down (or left and right). Here you see two chords, with accents
and arpeggio. In the first chord, the objects have all directions down
(or left). The second chord has all directions up (right).
The process of formatting a score consists of reading and writing object variables.
- Some variables have a preset value. For example, the thickness of
many lines – a characteristic of typographical style – are preset
variables. Changing them gives a different typographical impression:
- Formatting rules are also preset variables: each object has
variables containing procedures. These procedure perform the actual
formatting, and by substituting different ones, we can change
behavior. In the following example, the rule that note head objects
use to draw their symbol is changed during the music fragment:
Next:
Beautiful numbers: how
LilyPond participates in the Miss World contests.