3 %%% Author: Nicolas Sceaux <nicolas.sceaux@free.fr>
6 #(define-public *paper-size* (make-parameter 'a4))
8 %%% Paper size options:
9 %%% letter: Letter book option
10 %%% hardcover: Hardcover 210x273 book option
14 (cons '("hardcover" . (cons (* 209.55 mm) (* 273.1 mm)))
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)
26 %% Margins, line width
30 #(define line-width (- paper-width (* 25 mm)))
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))
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)
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)
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"
70 %% By default, no annotation line for footnotes
71 \override FootnoteItem #'annotation-line = ##f
76 \accepts "StaffGroupNoBracket"
81 \description "Like StaffGroup, but without spanbar"
82 \remove "Span_bar_engraver"
83 \accepts "StaffGroupNoBracket"
84 \accepts "InnerStaffGroup"
85 \accepts "InnerChoirStaff"
89 \name StaffGroupNoBracket
90 \description "Like StaffGroup, but without brackets"
91 \remove "System_start_delimiter_engraver"
95 \consists "Instrument_name_engraver"
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
107 explicitKeySignatureVisibility =
108 #(if (eqv? #t (ly:get-option 'ancient-style))
109 end-of-line-invisible
111 explicitClefVisibility =
112 #(if (eqv? #t (ly:get-option 'ancient-style))
113 end-of-line-invisible
116 ignoreFiguredBassRest = ##f
117 figuredBassAlterationDirection = #RIGHT
118 \override BassFigureAlignment #'stacking-dir = #UP
119 \override BassFigureAlignmentPositioning #'direction = #DOWN
124 %% Give Figured Bass an horizontal extent so that RehearsalMarks
125 %% do not ignore it (otherwise, marks would be place between staff
127 \override BassFigureAlignment #'X-extent = #'(0 . 0)
129 RemoveEmptyStaffContext = \context {
131 \override VerticalAxisGroup #'remove-empty = ##t
132 \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
137 \description "Staff with small notes"
139 \override StaffSymbol #'staff-space = #(magstep -2)
144 \override StaffGrouper #'staff-staff-spacing #'stretchability = #1
149 \override Script #'avoid-slur = #'outside
154 \override Script #'avoid-slur = #'outside
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)
164 (assoc-get time-signature settings '())
167 (beam-exceptions time-signature settings)))))
168 #(set! default-time-signature-settings
170 '(2 . 2) '(end ((1 . 16) 4 4 4 4))
171 default-time-signature-settings))
174 #(define-music-function (location parser paper-sizes) (list?)
175 (if (memq (*paper-size*) paper-sizes)
176 (make-music 'EventChord
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)))
187 #(define-music-function (location parser paper-sizes) (list?)
188 (if (memq (*paper-size*) paper-sizes)
189 (make-music 'EventChord
191 'page-break-permission 'forbid
192 'elements (list (make-music 'PageBreakEvent
193 'break-permission '())))
194 (make-music 'Music 'void #t)))
197 #(define-music-function (location parser music) (ly:music?)
198 (if (eqv? (*paper-size*) 'a4)
200 (make-music 'Music 'void #t)))
202 #(define-music-function (location parser music) (ly:music?)
203 (if (eqv? (*paper-size*) 'letter)
205 (make-music 'Music 'void #t)))