summaryrefslogtreecommitdiff
path: root/Documentation/automated-engraving/formatting-architecture.itexi
blob: 4e551e9d1595841ce9c5052557b8e2c8ac860b11 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
@ignore
    Translation of GIT committish: FILL-IN-HEAD-COMMITTISH

    When revising a translation, copy the HEAD committish of the
    version that you are working on.  See TRANSLATION for details.
@end ignore



@node formatting-architecture 

@unnumberedsec 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:

@itemize
@item
 Variables control layout decisions.  For example, many objects
have a @code{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).

@divClass{float-center}
@divEnd
@image{pictures/directions-updown,,,.png}

The process of formatting a score consists of reading and writing
object variables.



@item
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:

@divClass{float-center}
@divEnd
@image{pictures/thickness-tweaks,,,.png}

@item
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:

@divClass{float-center}
@divEnd
@image{pictures/mc-squared,,,.png}

@end itemize

@divClass{float-right}
@divEnd
Next:
 @ref{scoring-esthetics.html,Beautiful numbers}: how
LilyPond participates in the Miss World contests.

@bye