Les Horace : acte 1 scène 1 [1-2] (fin)
[nenuvar.git] / common / layout.ily
blobff9191cbdf75d45b519800dbdb1bb64a1a24258a
1 %%% layout.ily
2 %%%
3 %%% Author: Nicolas Sceaux <nicolas.sceaux@free.fr>
4 %%%
5 %% Paper size
6 #(define-public *paper-size* (make-parameter 'a4))
8 %%% Paper size options:
9 %%% letter: Letter book option
10 %%% hardcover: Hardcover 210x273 book option
11 %%% otherwise: A4
13 #(set! paper-alist
14    (cons '("hardcover" . (cons (* 209.55 mm) (* 273.1 mm)))
15          paper-alist))
17 #(cond ((ly:get-option 'letter) (*paper-size* 'letter))
18        ((ly:get-option 'hardcover) (*paper-size* 'hardcover))
19        (else (*paper-size* 'a4)))
21 #(set-default-paper-size (symbol->string (*paper-size*)))
23 #(ly:set-option 'point-and-click #f)
25 \paper {
26   %% Margins, line width
27   two-sided = ##t
28   inner-margin = 15\mm
29   outer-margin = 10\mm
30   #(define line-width (- paper-width (* 25 mm)))
32   ragged-bottom = ##f
33   ragged-last-bottom = ##f
35   %% Note: these are not scaled; they are in staff-spaces.
36   top-markup-spacing    = #'((basic-distance . 0)  (padding . 1) (minimum-distance . 0))
37   score-markup-spacing  = #'((basic-distance . 14) (padding . 1) (minimum-distance . 8))
38   markup-markup-spacing = #'((basic-distance . 1)  (padding . 0.5))
39   markup-system-spacing = #'((basic-distance . 6)  (padding . 1) (minimum-distance . 2))
41   top-system-spacing    = #'((basic-distance . 1)  (padding . 1) (minimum-distance . 0))
42   system-system-spacing = #'((basic-distance . 12) (padding . 1) (minimum-distance . 8))
43   last-bottom-spacing   = #'((basic-distance . 1)  (padding . 1) (minimum-distance . 0) (stretchability . 5))
44   score-system-spacing  = #'((basic-distance . 16) (padding . 1) (minimum-distance . 8))
47 \layout {
48   #(define (compute-indent amount)
49     (let ((indent (* amount mm)))
50       (if (or (eqv? #t (ly:get-option 'ancient-style))
51               (eqv? #t (ly:get-option 'non-incipit)))
52           (begin ;(format #t "~% indent: ~a" indent)
53            indent)
54           (+ indent (* incipit-width mm)))))
56   smallindent = #(compute-indent 10)
57   noindent = #(compute-indent 0)
58   largeindent = #(compute-indent 25)
59   hugeindent = #(compute-indent 35)
60   indent = \smallindent
62   \context {
63     \Score
64     \name Score
65     \override BarNumber #'padding = #2 
66     \override InstrumentName #'font-size = #1.0
67     \override InstrumentName #'space-alist = #'((left-edge extra-space . 2.0))
68     \accepts "StaffGroupNoBar"
69     skipBars = ##t
70     %% By default, no annotation line for footnotes
71     \override FootnoteItem #'annotation-line = ##f
72   }
73   \context {
74     \StaffGroup
75     \name StaffGroup
76     \accepts "StaffGroupNoBracket"
77   }
78   \context {
79     \StaffGroup
80     \name StaffGroupNoBar
81     \description "Like StaffGroup, but without spanbar"
82     \remove "Span_bar_engraver"
83     \accepts "StaffGroupNoBracket"
84     \accepts "InnerStaffGroup"
85     \accepts "InnerChoirStaff"
86   }
87   \context {
88     \StaffGroup
89     \name StaffGroupNoBracket
90     \description "Like StaffGroup, but without brackets"
91     \remove "System_start_delimiter_engraver"
92   }
93   \context {
94     \ChoirStaff
95     \consists "Instrument_name_engraver"
96   }
97   \context {
98     \Staff
99     \name Staff
100     \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
101     %% ancient-style: no time signature or key signature
102     %% at an end of line.
103     \override TimeSignature #'break-visibility =
104     #(if (eqv? #t (ly:get-option 'ancient-style))
105          end-of-line-invisible
106          all-visible)
107     explicitKeySignatureVisibility =
108     #(if (eqv? #t (ly:get-option 'ancient-style))
109          end-of-line-invisible
110          all-visible)
111     explicitClefVisibility =
112     #(if (eqv? #t (ly:get-option 'ancient-style))
113          end-of-line-invisible
114          all-visible)
115     %% Figured bass
116     ignoreFiguredBassRest = ##f
117     figuredBassAlterationDirection = #RIGHT
118     \override BassFigureAlignment #'stacking-dir = #UP
119     \override BassFigureAlignmentPositioning #'direction = #DOWN
120   }
121   \context {
122     \FiguredBass
123     \name FiguredBass
124     %% Give Figured Bass an horizontal extent so that RehearsalMarks
125     %% do not ignore it (otherwise, marks would be place between staff
126     %% and figured bass)
127     \override BassFigureAlignment #'X-extent = #'(0 . 0)
128   }
129   RemoveEmptyStaffContext = \context {
130     \Staff
131     \override VerticalAxisGroup #'remove-empty = ##t
132     \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
133   }
134   \context {
135     \Staff
136     \name SmallStaff
137     \description "Staff with small notes"
138     fontSize = #-2
139     \override StaffSymbol #'staff-space = #(magstep -2)
140   }
141   \context {
142     \PianoStaff
143     \name PianoStaff
144     \override StaffGrouper #'staff-staff-spacing #'stretchability = #1
145   }
146   \context {
147     \Voice
148     \name Voice
149     \override Script #'avoid-slur = #'outside
150   }
151   \context {
152     \CueVoice
153     \name CueVoice
154     \override Script #'avoid-slur = #'outside
155   }
158 %% override beaming behavior
159 %% in 2/2, group 16th notes by 4 (not by 8)
160 #(define-public (add-beam-exception time-signature beam-exception settings)
161    (assoc-set! settings
162                time-signature
163                (assoc-set!
164                 (assoc-get time-signature settings '())
165                 'beamExceptions
166                 (cons beam-exception
167                       (beam-exceptions time-signature settings)))))
168 #(set! default-time-signature-settings
169        (add-beam-exception
170         '(2 . 2) '(end ((1 . 16) 4 4 4 4))
171         default-time-signature-settings))
173 pageBreakCond =
174 #(define-music-function (location parser paper-sizes) (list?)
175    (if (memq (*paper-size*) paper-sizes)
176        (make-music 'EventChord
177          'page-marker #t
178          'line-break-permission 'force
179          'page-break-permission 'force
180          'elements (list (make-music 'LineBreakEvent
181                            'break-permission 'force)
182                          (make-music 'PageBreakEvent
183                            'break-permission 'force)))
184        (make-music 'Music 'void #t)))
186 noPageBreakCond =
187 #(define-music-function (location parser paper-sizes) (list?)
188    (if (memq (*paper-size*) paper-sizes)
189        (make-music 'EventChord
190          'page-marker #t
191          'page-break-permission 'forbid
192          'elements (list (make-music 'PageBreakEvent
193                            'break-permission '())))
194        (make-music 'Music 'void #t)))
196 whenAfour =
197 #(define-music-function (location parser music) (ly:music?)
198    (if (eqv? (*paper-size*) 'a4)
199        music
200        (make-music 'Music 'void #t)))
201 whenLetter =
202 #(define-music-function (location parser music) (ly:music?)
203    (if (eqv? (*paper-size*) 'letter)
204        music
205        (make-music 'Music 'void #t)))