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
37 #(define (compute-indent amount)
38 (let ((indent (* amount mm)))
39 (if (or (eqv? #t (ly:get-option 'ancient-style))
40 (eqv? #t (ly:get-option 'non-incipit)))
41 (begin ;(format #t "~% indent: ~a" indent)
43 (+ indent (* incipit-width mm)))))
45 smallindent = #(compute-indent 10)
46 noindent = #(compute-indent 0)
47 largeindent = #(compute-indent 25)
48 hugeindent = #(compute-indent 35)
54 \override BarNumber #'padding = #2
55 \override InstrumentName #'font-size = #1.0
56 \override InstrumentName #'space-alist = #'((left-edge extra-space . 2.0))
57 \accepts "StaffGroupNoBar"
59 %% By default, no annotation line for footnotes
60 \override FootnoteItem #'annotation-line = ##f
65 \accepts "StaffGroupNoBracket"
70 \description "Like StaffGroup, but without spanbar"
71 \remove "Span_bar_engraver"
72 \accepts "StaffGroupNoBracket"
73 \accepts "InnerStaffGroup"
74 \accepts "InnerChoirStaff"
78 \name StaffGroupNoBracket
79 \description "Like StaffGroup, but without brackets"
80 \remove "System_start_delimiter_engraver"
84 \consists "Instrument_name_engraver"
89 \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
90 %% ancient-style: no time signature or key signature
92 \override TimeSignature #'break-visibility =
93 #(if (eqv? #t (ly:get-option 'ancient-style))
96 explicitKeySignatureVisibility =
97 #(if (eqv? #t (ly:get-option 'ancient-style))
100 explicitClefVisibility =
101 #(if (eqv? #t (ly:get-option 'ancient-style))
102 end-of-line-invisible
105 ignoreFiguredBassRest = ##f
106 figuredBassAlterationDirection = #RIGHT
107 \override BassFigureAlignment #'stacking-dir = #UP
108 \override BassFigureAlignmentPositioning #'direction = #DOWN
113 %% Give Figured Bass an horizontal extent so that RehearsalMarks
114 %% do not ignore it (otherwise, marks would be place between staff
116 \override BassFigureAlignment #'X-extent = #'(0 . 0)
118 RemoveEmptyStaffContext = \context {
120 \override VerticalAxisGroup #'remove-empty = ##t
121 \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
126 \description "Staff with small notes"
128 \override StaffSymbol #'staff-space = #(magstep -2)
133 \override StaffGrouper #'staff-staff-spacing #'stretchability = #1
138 \override Script #'avoid-slur = #'outside
139 \override NoteHead.style = #'baroque
144 \override Script #'avoid-slur = #'outside
148 %% override beaming behavior
149 %% in 2/2, group 16th notes by 4 (not by 8)
150 #(define-public (add-beam-exception time-signature beam-exception settings)
154 (assoc-get time-signature settings '())
157 (beam-exceptions time-signature settings)))))
158 #(set! default-time-signature-settings
160 '(2 . 2) '(end ((1 . 16) 4 4 4 4))
161 default-time-signature-settings))
164 #(define-music-function (location parser paper-sizes) (list?)
165 (if (memq (*paper-size*) paper-sizes)
166 (make-music 'EventChord
168 'line-break-permission 'force
169 'page-break-permission 'force
170 'elements (list (make-music 'LineBreakEvent
171 'break-permission 'force)
172 (make-music 'PageBreakEvent
173 'break-permission 'force)))
174 (make-music 'Music 'void #t)))
177 #(define-music-function (location parser paper-sizes) (list?)
178 (if (memq (*paper-size*) paper-sizes)
179 (make-music 'EventChord
181 'page-break-permission 'forbid
182 'elements (list (make-music 'PageBreakEvent
183 'break-permission '())))
184 (make-music 'Music 'void #t)))
187 #(define-music-function (location parser music) (ly:music?)
188 (if (eqv? (*paper-size*) 'a4)
190 (make-music 'Music 'void #t)))
192 #(define-music-function (location parser music) (ly:music?)
193 (if (eqv? (*paper-size*) 'letter)
195 (make-music 'Music 'void #t)))