Le Triomphe de l'Amour n°1-14.
[nenuvar.git] / common / common.ily
blob4188ce73e0898964df09cc587bf6d188e8f1a892
1 \version "2.17.16"
3 #(use-modules (srfi srfi-39))
4 #(define-public *staff-size*
5   (make-parameter (let ((module (ly:output-def-scope
6                                  (ly:parser-lookup (eval 'parser (current-module))
7                                                    '$defaultpaper))))
8                     (/ (module-ref module 'staff-height)
9                        (eval 'pt module)))))
11 \layout {
12   incipit-width = #(* (*staff-size*)
13                       (if (defined? 'reference-incipit-width)
14                           reference-incipit-width
15                           (* (/ 15.0 20.0) mm)))
18 \include "common/includes.ily"
19 \include "common/clef-key.ily"
20 \include "common/titling.ily"
21 \include "common/toc-columns.ily"
22 \include "common/music-commands.ily"
23 \include "common/baroque.ily"
24 \include "common/marks.ily"
25 \include "common/staff.ily"
26 \include "common/layout.ily"
27 \include "common/reduction.ily"
29 %%% Title page
30 %%%
31 \header {
32   maintainer = "Nicolas Sceaux"
33   maintainerEmail = "nicolas.sceaux@gmail.com"
34   maintainerWeb = "http://nicolas.sceaux.free.fr"
35   copyright = \markup\copyright
36   license = "Licensed under the Creative Commons Attribution-ShareAlike 4.0 License"
37   shortcopyright = \markup { \copyright — \license }
38   longcopyright = \markup\column {
39     \vspace #1
40     \fill-line { \copyright }
41     \fill-line { \license }
42   }
43   
44   tagline = \markup { 
45     \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7)
46     \box\column {
47       \fill-line {
48         \line {
49           \copyright
50           \concat {
51             \with-url #"http://nicolas.sceaux.free.fr" \smaller "<nicolas.sceaux@gmail.com>"
52             .
53           }
54         }
55       }
56       \fill-line {
57         \line {
58           Sheet music from
59           \with-url #"http://nicolas.sceaux.free.fr"
60           \typewriter\smaller http://nicolas.sceaux.free.fr
61           typeset using \with-url #"http://lilypond.org" LilyPond
62           $(string-append "version " (lilypond-version))
63           on \concat { \today . }
64         }
65       }
66       \fill-line {
67         \line {
68           \italic Free to download, with the \italic freedom
69           to distribute, modify and perform.
70         }
71       }
72       \smaller\fill-line {
73         \line {
74           Licensed under the Creative Commons Attribution-ShareAlike 4.0 License,
75           for details see: \hspace #-0.5 
76           \with-url #"http://creativecommons.org/licenses/by-sa/4.0"
77           http://creativecommons.org/licenses/by-sa/4.0
78         }
79       }
80     }
81   }
84 #(define-markup-command (nenuvar-footer layout props side)
85      (number?)
86    (interpret-markup
87     layout props
88     (cond ((and (= 1 (chain-assoc-get 'page:page-number props -1))
89                 (not (and (chain-assoc-get 'page:is-bookpart-last-page
90                                            props #f)
91                           (chain-assoc-get 'page:is-last-bookpart
92                                            props #f))))
93            ;; Book first page
94            #{ \markup\fill-line {
95   \abs-fontsize #10 \fromproperty #'header:longcopyright } #})
96           ((and (chain-assoc-get 'page:is-bookpart-last-page props #f)
97                 (chain-assoc-get 'page:is-last-bookpart props #f))
98            ;; book last page
99            #{ \markup\fill-line {
100   \abs-fontsize #8 \fromproperty #'header:tagline } #})
101           ((= side LEFT)
102            ;; even pages
103            #{ \markup\fill-line {
104   \null \abs-fontsize #6 \fromproperty #'header:shortcopyright } #})
105           (else
106            ;; odd pages
107            #{ \markup\fill-line {
108   \abs-fontsize #6 \fromproperty #'header:shortcopyright \null } #}))))
110 \paper {
111   nenuvarBookTitleMarkup = \markup \when-property #'header:title \abs-fontsize #12 \column {
112     \null \null \null \null \null \null
113     \fill-line { \fontsize #6 \italic \fromproperty #'header:composer }
114     \when-property #'header:poet \column { \null \null \null }
115     \fill-line { \fontsize #6 \italic \fromproperty #'header:poet }
116     \null \null \null \null \null \null
117     \fontsize #12 \fill-line {
118                  \apply-fromproperty #make-smallCaps-markup #'header:title }
119     \null \null \null \null \null \null
120     \fill-line { \postscript #(format #f "~a 0 moveto ~a 0 rlineto stroke"
121                                (/ -400 (*staff-size*))
122                                (/ 800 (*staff-size*)))
123                              }
124     \null \null \null \null \null \null
125     \fill-line { \fontsize #4 \fromproperty #'header:date }
126     \null
127     \on-the-fly #(lambda (layout props arg)
128                    (if (*part*)
129                        (interpret-markup layout props
130                          (markup #:column (#:null #:null
131                                            #:fill-line (#:fontsize 4 (*part-name*)))))
132                        empty-stencil))
133     \null \null \null \null
134     \fill-line { \fontsize #2 \fromproperty #'header:editions }
135     \fill-line { \fontsize #2 \fromproperty #'header:arrangement }
136   }
137   bookTitleMarkup = \nenuvarBookTitleMarkup
138   shortBookTitleMarkup =  \markup {
139     \override #'(baseline-skip . 3.5) \column {
140       \huge \larger \bold \fill-line { \larger \fromproperty #'header:title }
141       \fill-line {
142         \fromproperty #'header:poet
143         \on-the-fly #(lambda (layout props arg)
144                       (if (*part*)
145                        (interpret-markup layout props (markup (*part-name*)))
146                        empty-stencil)) \null
147         \fromproperty #'header:composer
148       }
149       \fill-line {
150         \null
151         \fromproperty #'header:date
152       }
153     }
154   }
155   scoreTitleMarkup = #f
157   oddFooterMarkup = \markup\nenuvar-footer #RIGHT
158   evenFooterMarkup = \markup\nenuvar-footer #LEFT
160   tocTitle = "TABLE DES MATIÈRES"
164 %%% The following hack make regular rests hara-kiri-able
166 #(let* ((rest-def (assoc 'Rest all-grob-descriptions))
167         (meta-def (assoc 'meta (cdr rest-def)))
168         (interfaces-def (assoc 'interfaces (cdr meta-def)))
169         (interfaces (filter (lambda (interface)
170                               (not (eqv? interface 'rhythmic-grob-interface)))
171                             (cdr interfaces-def))))
172   (set-cdr! interfaces-def interfaces))