Mon Violon

Style a5

style_a5.ly
	\version "2.14.2"
			#(ly:set-option 'point-and-click #f)
			#(set! paper-alist (cons '("15x21" . (cons (* 156 mm) (* 216 mm))) paper-alist)) %dont 2x3mm fond perdu
			#(set-default-paper-size "15x21")
			%Taille cherchée après massicotage : 8 x 10 in => 20,3 x 25,4 cm | équivalent sur A5 : 14.4 x 18 cm
			#(set-global-staff-size 13.3)
			
			\paper {
			   #(define fonts
			   (set-global-fonts
			   #:music "improviso"
			   #:brace "improviso"
			   #:factor (/ staff-height pt 20)
			   ))
			   
			   print-all-headers = ##t
			   bookTitleMarkup = ##f
			   two-sided = ##f
			   top-margin = 28.6\mm %dont 3mm fond perdu
			   bottom-margin = 28.6\mm %dont 3mm fond perdu
			   left-margin = 20.1\mm %dont 3mm fond perdu
			   right-margin = 20.1\mm %dont 3mm fond perdu
			   first-page-number = #-1
			   indent = 5\mm
			   
			   tocActMarkup = \markup \large \column {
			      \hspace #1
			      \fill-line { \null \italic \fromproperty #'toc:text \null }
			      \hspace #1
			      }
			   }
			
			tocAct =
			#(define-music-function (parser location text) (markup?)
			(add-toc-item! 'tocActMarkup text))
			
			\layout {
			   \context {
			      \Score
			      \remove "Bar_number_engraver"
			      \remove "Metronome_mark_engraver"
			      }
			   }
			
			% Créer 6/4 composé de 4/4 + 2/8
			rideeSix = \markup {
			   \override #'(baseline-skip . 2) \number {
			      \column { "4" "4" }
			      \vcenter "+"
			      \bracket \column { "2" "4" }
			      }
			   }
			
			%%%%% en-tête %%%%%
			
			\header {
			   title = "Cahier de repertoire"
			   style = "Folk"
			   tagline = ""
			%\markup { \column {
			%  \small \fill-line {"Le bœuf trad, un aide-mémoire pour le musicien de bal : www.monviolon.org"}
			%\teeny {
			%\fill-line {"This work is licensed under the Creative Commons Attribution"}
			%\fill-line {"Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 3.0 France License."}
			%\fill-line {"To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/fr/."}
			%}
			%}
			   }
			
			tocchapitre = #(define-markup-command (parser location titre) (string?)
			(interpret-markup layout props (markup #:smallCaps))
			)
			
			% Preparation de la couverture
			% Infos générales
			EditionI = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons -0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_01.eps"
			   }}
			EditionII = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_02.eps"
			   }}
			EditionIII = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_03.eps"
			   }}
			EditionIV = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_04.eps"
			   }}
			EditionV = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_05.eps"
			   }}
			EditionVI = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_06.eps"
			   }}
			EditionVII = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_07.eps"
			   }}
			EditionVIII = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_08.eps"
			   }}
			EditionIX = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_09.eps"
			   }}
			EditionX = \markup { \with-dimensions #(cons 0 0) #(cons 0 0) {
			   \translate #(cons 0 2)
			   \epsfile #X #26 #"../styles/boeuf_trad_10.eps"
			   }}
			
			
			#(define-markup-list-command (paragraph layout props args) (markup-list?)
			(interpret-markup-list layout props
			(make-justified-lines-markup-list (cons (make-hspace-markup 2) args))))
			
			#(define-markup-command (double-box layout props text) (markup?)
			#:properties ((inter-box-padding 0.4)
			(box-padding 0.6))
			"Dessine un double encadrement autour du texte."
			(interpret-markup layout props
			#{\markup \override #`(box-padding . ,inter-box-padding) \box
			   \override #`(box-padding . ,box-padding) \box
			   { #text } #}))
			   
			%Pour les tables
			   #(define-markup-command (refTitre layout props text) (markup?)
			   (interpret-markup layout props
			   #{\markup \sans \bold { #text }#}))
			   
			   #(define-markup-command (alphabet layout props text) (markup?)
			   (interpret-markup layout props
			   #{\markup \fill-line {\override #'(font-name . "Prida61") \abs-fontsize #30 { #text }}#}))
			   
			   #(define-markup-command (edt layout props text) (markup?)
			   (interpret-markup layout props
			   #{\markup \sans \fontsize #-2 { #text }#}))
			   
			%espace vertical : copie de vspace mais variant selon feuille de style (ici désactivé)
			% pour activer :
			% (let ((amount (* amount 3.0)))
			% (ly:make-stencil "" empty-interval (cons 0 amount)))
			   #(define-markup-command (vspaceopt layout props amount) (number?)
			   "Espace vertical (vspace perso, désactivable dans feuille de style)"
			   (ly:make-stencil "" empty-interval (cons 0 0))
			   )
			   
			   
			   sacem = \markup {\abs-fontsize #6 {\null \with-color #(x11-color "grey70") \triangle ##t " "}}
			   nondep = \markup {\abs-fontsize #6 {\null \with-color #(x11-color "grey70") \triangle ##f " "}}
			   public = \markup {\abs-fontsize #6 {\null \with-color #(x11-color "grey70") \translate #'(0.8 . 0.7) \draw-circle #0.6 #0.2 ##f " "}}
			   cc = \markup {\abs-fontsize #6 {\null \with-color #(x11-color "grey70") \translate #'(0 . 1.2) \rotate #180 \raise #'-1.2 \sans "©" " "}}
			   libre = \markup {\abs-fontsize #6 {\null \hspace #0.1 \with-color #(x11-color "grey70") \translate #'(0 . 0.7) \musicglyph #"timesig.neomensural94" " "}}
			   saipas = \markup {\abs-fontsize #6 {\null \hspace #0.5 \with-color #(x11-color "grey70") \sans "?" \hspace #0.3 " "}}
			   
			%Style pour la biblio :
			   enr = \markup {\hspace #1 \epsfile #X #1.8 #"../styles/ico_enr.eps"}
			   pub = \markup {\hspace #1 \epsfile #X #1.5 #"../styles/ico_pub.eps"}
			   col = \markup {\hspace #1 \epsfile #X #2 #"../styles/ico_col.eps"}
			   gam = \markup {\hspace #1 \epsfile #X #2 #"../styles/ico_gam.eps"}
			   altName = \markup {\hspace #1 \raise #0.5 \box +}
			   altNames = \markup {\hspace #1 \raise #0.5 \box +}
			   rq = \markup {\hspace #1 \line {\underline Rq :}}
			   
			   decale= \markup \hspace #2
			   
			% pas d'espace vertical pour ce style (livrets)
			   vspaceWeb = \markup {" "}
			   
			%% Hack pour le glyphe clé de sol:
			   my-clef =
			   #(ly:make-stencil
			   `(path 0.01
			   `(
			   moveto  86 -224
			   curveto  83 -221  82 -217 81 -192
			   curveto  81  -183  80  -171  80  -165
			   curveto  79  -151  77  -125 76  -111
			   lineto  76  -100
			   lineto  63 -100
			   curveto  49 -100 40 -97  31 -91
			   curveto  23  -86 19 -81 13 -72
			   curveto  8 -63 6 -57  4  -47
			   curveto  -1  -24  2 20 9 50
			   curveto  27 117  61  191  85 237
			   curveto  101 270 105  279  106  284
			   curveto  108  296  115  318  119  326
			   curveto  123  333 124  335  127  336
			   curveto  135  340 142  330  140  318
			   curveto  139  311 130  291  124  280
			   lineto  120 271
			   lineto  116  247
			   curveto  110 198  100 96  96  37
			   curveto  95 20.08142898  93.80076898  1.85643361  93 -4
			   curveto  92  -16 91 -76  92  -76
			   curveto  92  -76  95 -75  98  -73
			   curveto  110 -67  129  -47 138  -33
			   curveto  139 -31 142 -24 144  -18
			   curveto  152 4  150  29  140  29
			   curveto  133  29  126 20  126  11
			   curveto  126 4  128  2  132 2
			   curveto  139  2  143 -3 142  -9
			   curveto  140  -16  126  -16  118  -9
			   curveto  115  -6  111 2  111  8
			   curveto  110 13  112  21  116 29
			   curveto  120 36  133  45 140  45
			   curveto  148  45  158  37  161 29
			   curveto  166 16  166 -3  159  -21
			   curveto  154 -36  153 -39  144  -51
			   curveto  132 -67  115  -82  101  -89
			   lineto  91  -94
			   lineto  91  -100
			   curveto  91 -107 93  -131  96 -164
			   curveto  97  -174  98  -191 98  -202
			   lineto  98  -223
			   lineto  96  -225
			   curveto  92  -228  90  -228  87  -225
			   closepath
			   moveto  72 -84
			   lineto  75 -83
			   lineto  76 -54
			   curveto  76 -38 77 -12  78  3
			   curveto  79 18 81  40 82 52
			   curveto  84 88 93  185 97 215
			   curveto  98 222  98  228  98 229
			   curveto  98 231  92  218  80 193
			   curveto  60  151  44  110 34 79
			   curveto  21  39  18  24  18 -11
			   curveto  17  -42 19  -53  28  -68
			   curveto  35  -78  43  -83  56  -84
			   curveto  62  -85  66  -85  72 -84
			   closepath
			   )
			   'round 'round #t)
			   (cons 0 160)
			   (cons 0 0)
			   )
			   
			   \layout {
			      \context {
			         \Score
			         \override Clef.stencil =
			         #(lambda (grob)
			         (let* ((sz (ly:grob-property grob 'font-size 0))
			         (mlt (magstep sz))
			         (glyph (ly:grob-property grob 'glyph-name)))
			         (cond
			         ((equal? glyph "clefs.G")
			         (ly:stencil-scale my-clef (* 0.015 mlt) (* 0.015 mlt)))
			         ((equal? glyph "clefs.G_change")
			         (ly:stencil-scale my-clef (* .008 mlt) (* .008 mlt)))
			         (else (ly:clef::print grob)))))
			         
			         \override ChordName #'color = \customColor
			         }
			      
			      
			%\override Score.Hairpin.thickness = #2
			%\override Score.Stem.thickness = #2
			%\override Score.TupletBracket.thickness = #2
			      \override Score.VoltaBracket.thickness = #2
			%\override Score.SystemStartBar.thickness = #4
			%\override StaffGroup.SystemStartBracket.padding = #0.25
			%\override ChoirStaff.SystemStartBracket.padding = #0.25
			%\override Staff.Tie.thickness = #3
			%\override Staff.Tie.line-thickness = #2
			%\override Staff.Slur.thickness = #3
			%\override Staff.PhrasingSlur.thickness = #3
			      \override Staff.BarLine.hair-thickness = #1.5
			      \override Staff.BarLine.thick-thickness = #5
			%\override Staff.MultiMeasureRest.hair-thickness = #3
			%\override Staff.MultiMeasureRestNumber.font-size = #2
			%\override LyricHyphen.thickness = #3
			%\override LyricExtender.thickness = #3
			%\override PianoPedalBracket.thickness = #2
			      
			      }