]> git.donarmstrong.com Git - lilypond.git/blob - ly/property-init.ly
Doc-es: various updates.
[lilypond.git] / ly / property-init.ly
1 % property-init.ly
2
3 \version "2.19.22"
4
5 %% for dashed slurs, phrasing slurs, and ties
6 #(define (make-simple-dash-definition dash-fraction dash-period)
7     (list (list 0 1 dash-fraction dash-period)))
8
9 %% common definition for all note head styles reverting
10 %% (palm mute, harmonics, dead notes, ...)
11 defaultNoteHeads = {
12   \revert NoteHead.style
13   \revert TabNoteHead.style
14 }
15
16 accidentalStyle =
17 #(define-music-function
18    (style) (symbol-list?)
19    (_i "Set accidental style to symbol list @var{style} in the form
20 @samp{piano-cautionary}.  If @var{style} has a form like
21 @samp{Staff.piano-cautionary}, the settings are applied to that
22 context.  Otherwise, the context defaults to @samp{Staff}, except for
23 piano styles, which use @samp{GrandStaff} as a context." )
24    (case (length style)
25     ((1) (set-accidental-style (car style)))
26     ((2) (set-accidental-style (cadr style) (car style)))
27     (else
28      (ly:parser-error (_ "not an accidental style")
29       (*location*))
30      (make-music 'Music))))
31
32 %% arpeggios
33
34 % For drawing vertical chord brackets with \arpeggio
35 % This is a shorthand for the value of the print-function property
36 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
37 % cross-staff brackets are desired.
38
39 arpeggio = #(make-music 'ArpeggioEvent)
40 arpeggioArrowUp = {
41   \revert Arpeggio.stencil
42   \revert Arpeggio.X-extent
43   \override Arpeggio.arpeggio-direction = #UP
44 }
45 arpeggioArrowDown = {
46   \revert Arpeggio.stencil
47   \revert Arpeggio.X-extent
48   \override Arpeggio.arpeggio-direction = #DOWN
49 }
50 arpeggioNormal = {
51   \revert Arpeggio.stencil
52   \revert Arpeggio.X-extent
53   \revert Arpeggio.arpeggio-direction
54   \revert Arpeggio.dash-definition
55 }
56 arpeggioBracket = {
57   \revert Arpeggio.X-extent
58   \override Arpeggio.stencil = #ly:arpeggio::brew-chord-bracket
59 }
60 arpeggioParenthesis = {
61   \override Arpeggio.stencil = #ly:arpeggio::brew-chord-slur
62   \override Arpeggio.X-extent = #ly:grob::stencil-width
63   \revert Arpeggio.dash-definition
64 }
65 arpeggioParenthesisDashed = {
66   \override Arpeggio.stencil = #ly:arpeggio::brew-chord-slur
67   \override Arpeggio.X-extent = #ly:grob::stencil-width
68   \override Arpeggio.dash-definition = #'((0 1 0.4 0.75))
69 }
70
71
72 %% auto beaming
73
74 autoBeamOn  = \set autoBeaming = ##t
75 autoBeamOff = \set autoBeaming = ##f
76
77
78 %% balloon length
79
80 balloonLengthOn = {
81   \override BalloonTextItem.extra-spacing-width = #'(0 . 0)
82   \override BalloonTextItem.extra-spacing-height = #'(-inf.0 . +inf.0)
83 }
84 balloonLengthOff = {
85   \override BalloonTextItem.extra-spacing-width = #'(+inf.0 . -inf.0)
86   \override BalloonTextItem.extra-spacing-height = #'(0 . 0)
87 }
88
89
90 %% bar lines
91
92 defineBarLine =
93 #(define-void-function
94    (bar glyph-list) (string? list?)
95    (_i "Define bar line settings for bar line @var{bar}.
96      The list @var{glyph-list} must have three entries which define
97      the appearance at the end of line, at the beginning of the next line,
98      and the span bar, respectively." )
99   (if (not (= (length glyph-list) 3))
100       (ly:error (_ "Argument list for bar '~a' must have three components.") bar)
101       (define-bar-line bar
102                        (car glyph-list)
103                        (cadr glyph-list)
104                        (caddr glyph-list))))
105
106
107 %% bass figures
108
109 bassFigureExtendersOn = {
110   \set useBassFigureExtenders = ##t
111   \set Staff.useBassFigureExtenders = ##t
112 }
113 bassFigureExtendersOff = {
114   \set useBassFigureExtenders = ##f
115   \set Staff.useBassFigureExtenders = ##f
116 }
117 bassFigureStaffAlignmentDown =
118   \override Staff.BassFigureAlignmentPositioning.direction = #DOWN
119 bassFigureStaffAlignmentUp =
120   \override Staff.BassFigureAlignmentPositioning.direction = #UP
121 bassFigureStaffAlignmentNeutral =
122   \revert Staff.BassFigureAlignmentPositioning.direction
123
124
125 %% cadenzas
126
127 cadenzaOn  = \set Timing.timing = ##f
128
129 cadenzaOff = \set Timing.timing = ##t
130
131 %% chord names
132
133 frenchChords = {
134   \set chordRootNamer = #(chord-name->italian-markup #t)
135   \set chordPrefixSpacer = #0.4
136 }
137 germanChords = {
138   \set chordRootNamer = #(chord-name->german-markup #t)
139   \set chordNoteNamer = #note-name->german-markup
140 }
141 semiGermanChords = {
142   \set chordRootNamer = #(chord-name->german-markup #f)
143   \set chordNoteNamer = #note-name->german-markup
144 }
145 italianChords = {
146   \set chordRootNamer = #(chord-name->italian-markup #f)
147   \set chordPrefixSpacer = #0.4
148 }
149 powerChords = {
150   \set chordNameExceptions = #powerChordExceptions
151 }
152
153
154 %% compressFullBarRests
155
156 compressFullBarRests = \set Score.skipBars = ##t
157 expandFullBarRests   = \set Score.skipBars = ##f
158
159
160 %% dots
161
162 dotsUp      = \override Dots.direction = #UP
163 dotsDown    = \override Dots.direction = #DOWN
164 dotsNeutral = \revert Dots.direction
165
166
167 %% dynamics
168
169 dynamicUp = {
170   \override DynamicText.direction = #UP
171   \override DynamicLineSpanner.direction = #UP
172 }
173 dynamicDown = {
174   \override DynamicText.direction = #DOWN
175   \override DynamicLineSpanner.direction = #DOWN
176 }
177 dynamicNeutral = {
178   \revert DynamicText.direction
179   \revert DynamicLineSpanner.direction
180 }
181
182
183 %% easy heads
184
185 easyHeadsOn = {
186   \override NoteHead.stencil = #note-head::brew-ez-stencil
187   \override NoteHead.font-size = #-8
188   \override NoteHead.font-family = #'sans
189   \override NoteHead.font-series = #'bold
190 }
191 easyHeadsOff = {
192   \revert NoteHead.stencil
193   \revert NoteHead.font-size
194   \revert NoteHead.font-family
195   \revert NoteHead.font-series
196 }
197
198
199 %% fermata markup
200
201 fermataMarkup =
202 #(make-music 'MultiMeasureTextEvent
203              ;; Set the 'text based on the 'direction
204              'text (make-fermata-markup)
205              'tweaks '((outside-staff-priority . 40)
206                        (outside-staff-padding . 0)))
207
208 %% font sizes
209
210 teeny      = \set fontSize = #-3
211 tiny       = \set fontSize = #-2
212 small      = \set fontSize = #-1
213 normalsize = \set fontSize = #0
214 large      = \set fontSize = #1
215 huge       = \set fontSize = #2
216
217
218 %% glissando
219
220 glissando = #(make-music 'GlissandoEvent)
221
222
223 %% harmonics
224
225 harmonicsOn =
226 #(define-music-function () ()
227   (_i "Set the default note head style to a diamond-shaped style.")
228   (context-spec-music
229    (override-head-style '(NoteHead TabNoteHead) 'harmonic) 'Bottom))
230 harmonicsOff = \defaultNoteHeads
231 harmonicNote =
232 #(define-music-function (note) (ly:music?)
233    (_i "Print @var{note} with a diamond-shaped note head.")
234    (style-note-heads 'NoteHead 'harmonic note))
235
236
237 %% hideNotes
238
239 hideNotes = {
240   % hide notes, accidentals, etc.
241   \override Dots.transparent = ##t
242   \override NoteHead.transparent = ##t
243   \override NoteHead.no-ledgers = ##t
244   % assume that any Beam inherits transparency from its parent Stem
245   \override Stem.transparent = ##t
246   \override Accidental.transparent = ##t
247   \override Rest.transparent = ##t
248   \override TabNoteHead.transparent = ##t
249 }
250 unHideNotes = {
251   \revert Accidental.transparent
252   \revert Stem.transparent
253   \revert NoteHead.transparent
254   \revert NoteHead.no-ledgers
255   \revert Dots.transparent
256   \revert Rest.transparent
257   \revert TabNoteHead.transparent
258 }
259
260
261 %% improvisation
262
263 improvisationOn = {
264   \set squashedPosition = #0
265   \override NoteHead.style = #'slash
266   \override TabNoteHead.style = #'slash
267   \override Accidental.stencil = ##f
268   \override AccidentalCautionary.stencil = ##f
269 }
270 improvisationOff = {
271   \unset squashedPosition
272   \revert NoteHead.style
273   \revert TabNoteHead.style
274   \revert Accidental.stencil
275   \revert AccidentalCautionary.stencil
276 }
277
278 %% incipit
279
280 incipit =
281 #(define-music-function (incipit-music) (ly:music?)
282   (_i "Output @var{incipit-music} before the main staff as an indication of
283     its appearance in the original music.")
284   #{
285     \once \override Staff.InstrumentName.stencil =
286       #(lambda (grob)
287         (let* ((instrument-name (ly:grob-property grob 'long-text))
288                (align-x (ly:grob-property grob 'self-alignment-X 0))
289                (align-y (ly:grob-property grob 'self-alignment-Y 0)))
290         (set! (ly:grob-property grob 'long-text)
291           #{ \markup {
292             \score
293             {
294               \new MensuralStaff \with {
295                 \override InstrumentName.self-alignment-X = #align-x
296                 \override InstrumentName.self-alignment-Y = #align-y
297                 instrumentName = #instrument-name
298               }
299               {
300                 $incipit-music
301               }
302               \layout {
303                 $(ly:grob-layout grob)
304                 indent-incipit-default = 15\mm
305                 line-width = #(primitive-eval
306                   '(or (false-if-exception indent)
307                     indent-incipit-default))
308                 indent = #(primitive-eval
309                            '(or (false-if-exception (- line-width incipit-width))
310                             (* 0.5 line-width)))
311                 ragged-right = ##f
312                 ragged-last = ##f
313                 system-count = 1
314                 \context {
315                   \Score
316                   \remove "Default_bar_line_engraver"
317                 }
318               }
319             }
320             }
321           #})
322           (set! (ly:grob-property grob 'self-alignment-Y) #f)
323           (set! (ly:grob-property grob 'self-alignment-X) RIGHT)
324           (system-start-text::print grob)))
325   #}
326 )
327
328 %% kievan
329 kievanOn = {
330  \override NoteHead.style = #'kievan
331  \override Stem.X-offset = #stem::kievan-offset-callback
332  \override Stem.stencil = ##f
333  \override Flag.stencil = ##f
334  \override Rest.style = #'mensural
335  \override Accidental.glyph-name-alist = #alteration-kievan-glyph-name-alist
336  \override Dots.style = #'kievan
337  \override Slur.stencil = ##f
338  \override Stem.length = #0.0
339  \override Beam.positions = #beam::get-kievan-positions
340  \override Beam.quantized-positions = #beam::get-kievan-quantized-positions
341  \override NoteHead.duration-log = #note-head::calc-kievan-duration-log
342 }
343 kievanOff = {
344  \revert NoteHead.style
345  \revert Stem.X-offset
346  \revert Stem.stencil
347  \revert Rest.style
348  \revert Accidental.glyph-name-alist
349  \revert Dots.style
350  \revert Slur.stencil
351  \revert Flag.stencil
352  \revert Stem.length
353  \revert Beam.positions
354  \revert Beam.quantized-positions
355  \revert NoteHead.duration-log
356 }
357
358 %% line and page breaking controls
359
360 autoLineBreaksOff = {
361   \overrideProperty Score.NonMusicalPaperColumn.line-break-permission ##f
362   \override Score.NonMusicalPaperColumn.line-break-permission = ##f
363 }
364 autoLineBreaksOn = {
365   \overrideProperty Score.NonMusicalPaperColumn.line-break-permission #'allow
366   \override Score.NonMusicalPaperColumn.line-break-permission = #'allow
367 }
368 autoPageBreaksOff =
369   \override Score.NonMusicalPaperColumn.page-break-permission = ##f
370 autoPageBreaksOn =
371   \override Score.NonMusicalPaperColumn.page-break-permission = #'allow
372 autoBreaksOff = { \autoLineBreaksOff \autoPageBreaksOff }
373 autoBreaksOn = { \autoLineBreaksOn \autoPageBreaksOn }
374
375
376 %% merging
377
378 mergeDifferentlyDottedOn =
379   \override Staff.NoteCollision.merge-differently-dotted = ##t
380 mergeDifferentlyDottedOff =
381   \revert Staff.NoteCollision.merge-differently-dotted
382 mergeDifferentlyHeadedOn =
383   \override Staff.NoteCollision.merge-differently-headed = ##t
384 mergeDifferentlyHeadedOff =
385   \revert Staff.NoteCollision.merge-differently-headed
386
387
388 %% numeric time signature
389
390 numericTimeSignature = \override Staff.TimeSignature.style = #'numbered
391 defaultTimeSignature = \revert Staff.TimeSignature.style
392
393
394 %% palm mutes
395
396 palmMuteOn =
397 #(define-music-function () ()
398   (_i "Set the default note head style to a triangle-shaped style.")
399   (context-spec-music
400    (override-head-style 'NoteHead 'do) 'Bottom))
401 palmMuteOff = \defaultNoteHeads
402 palmMute =
403 #(define-music-function (note) (ly:music?)
404    (_i "Print @var{note} with a triangle-shaped note head.")
405    (style-note-heads 'NoteHead 'do note))
406
407 %% part combiner
408
409 partcombineForce =
410 #(define-music-function (type) ((symbol?))
411    (_i "Override the part-combiner.")
412    (if type (propertySet 'partCombineForced type)
413        (propertyUnset 'partCombineForced)))
414
415 partcombineApart = \partcombineForce #'apart
416 partcombineChords = \partcombineForce #'chords
417 partcombineUnisono = \partcombineForce #'unisono
418 partcombineSoloI = \partcombineForce #'solo1
419 partcombineSoloII = \partcombineForce #'solo2
420 partcombineAutomatic = \partcombineForce \default
421
422
423 %% phrasing slurs
424
425 % directions
426 phrasingSlurUp      = \override PhrasingSlur.direction = #UP
427 phrasingSlurDown    = \override PhrasingSlur.direction = #DOWN
428 phrasingSlurNeutral = \revert PhrasingSlur.direction
429
430 % dash-patterns (make-simple-dash-definition defined at top of file)
431 phrasingSlurDashPattern =
432 #(define-music-function (dash-fraction dash-period)
433    (number? number?)
434    (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
435 line to space repeated at @var{dash-period} interval for phrasing slurs.")
436   #{
437      \override PhrasingSlur.dash-definition =
438        $(make-simple-dash-definition dash-fraction dash-period)
439   #})
440 phrasingSlurDashed =
441   \override PhrasingSlur.dash-definition = #'((0 1 0.4 0.75))
442 phrasingSlurDotted =
443   \override PhrasingSlur.dash-definition = #'((0 1 0.1 0.75))
444 phrasingSlurHalfDashed =
445   \override PhrasingSlur.dash-definition = #'((0 0.5 0.4 0.75)
446                                                 (0.5 1 1 1))
447 phrasingSlurHalfSolid =
448   \override PhrasingSlur.dash-definition = #'((0 0.5 1 1)
449                                                 (0.5 1 0.4 0.75))
450 phrasingSlurSolid =
451   \revert PhrasingSlur.dash-definition
452
453
454 %% point and click
455
456 pointAndClickOn  =
457 #(define-void-function () ()
458    (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
459 originating lilypond source statement;
460 this is helpful when developing a score but generates bigger final-format files.")
461    (ly:set-option 'point-and-click #t))
462
463 pointAndClickOff =
464 #(define-void-function () ()
465    (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
466 back to the lilypond source statement.")
467    (ly:set-option 'point-and-click #f))
468
469 pointAndClickTypes =
470 #(define-void-function (types) (symbol-list-or-symbol?)
471   (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
472   (ly:set-option 'point-and-click types))
473
474 %% predefined fretboards
475
476 predefinedFretboardsOff =
477   \set predefinedDiagramTable = ##f
478 predefinedFretboardsOn =
479   \set predefinedDiagramTable = #default-fret-table
480
481
482 %% shape note heads
483
484 aikenHeads      = \set shapeNoteStyles = ##(do re miMirror fa sol la ti)
485 aikenHeadsMinor = \set shapeNoteStyles = ##(la ti do re miMirror fa sol)
486 funkHeads =
487   \set shapeNoteStyles = ##(doFunk reFunk miFunk faFunk solFunk laFunk tiFunk)
488 funkHeadsMinor =
489   \set shapeNoteStyles = ##(laFunk tiFunk doFunk reFunk miFunk faFunk solFunk)
490 sacredHarpHeads = \set shapeNoteStyles = ##(fa sol la fa sol la mi)
491 sacredHarpHeadsMinor = \set shapeNoteStyles = ##(la mi fa sol la fa sol)
492 southernHarmonyHeads =
493   \set shapeNoteStyles = ##(faThin sol laThin faThin sol laThin miThin)
494 southernHarmonyHeadsMinor =
495   \set shapeNoteStyles = ##(laThin miThin faThin sol laThin faThin sol)
496 walkerHeads =
497   \set shapeNoteStyles = ##(doWalker reWalker miWalker faWalker solFunk laWalker tiWalker)
498 walkerHeadsMinor =
499   \set shapeNoteStyles = ##(laWalker tiWalker doWalker reWalker miWalker faWalker solFunk)
500
501
502 %% shifts
503
504 shiftOff  = \override NoteColumn.horizontal-shift = #0
505 shiftOn   = \override NoteColumn.horizontal-shift = #1
506 shiftOnn  = \override NoteColumn.horizontal-shift = #2
507 shiftOnnn = \override NoteColumn.horizontal-shift = #3
508
509
510 %% slurs
511
512 % directions
513 slurUp         = \override Slur.direction = #UP
514 slurDown       = \override Slur.direction = #DOWN
515 slurNeutral    = \revert Slur.direction
516
517 % dash-patterns (make-simple-dash-definition defined at top of file)
518 slurDashPattern =
519 #(define-music-function (dash-fraction dash-period)
520   (number? number?)
521   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
522 ratio of line to space repeated at @var{dash-period} interval for slurs.")
523   #{
524      \override Slur.dash-definition =
525        $(make-simple-dash-definition dash-fraction dash-period)
526   #})
527 slurDashed     = \override Slur.dash-definition = #'((0 1 0.4 0.75))
528 slurDotted     = \override Slur.dash-definition = #'((0 1 0.1 0.75))
529 slurHalfDashed = \override Slur.dash-definition = #'((0 0.5 0.4 0.75)
530                                                        (0.5 1 1 1))
531 slurHalfSolid  = \override Slur.dash-definition = #'((0 0.5 1 1)
532                                                        (0.5 1 0.4 0.75))
533 slurSolid      = \revert Slur.dash-definition
534
535
536 %% staff switches
537
538 showStaffSwitch = \set followVoice = ##t
539 hideStaffSwitch = \set followVoice = ##f
540
541
542 %% stems
543
544 stemUp      = \override Stem.direction = #UP
545 stemDown    = \override Stem.direction = #DOWN
546 stemNeutral = \revert Stem.direction
547
548
549 %% string numbers
550
551 romanStringNumbers  = {
552   \override StringNumber.number-type = #'roman-upper
553   \override StringNumber.stencil = #ly:text-interface::print
554   \override StringNumber.font-encoding = #'latin1
555   \override StringNumber.font-shape = #'italic
556 }
557 arabicStringNumbers = {
558   \revert StringNumber.number-type
559   \revert StringNumber.stencil
560   \revert StringNumber.font-encoding
561   \revert StringNumber.font-shape
562 }
563
564
565 %% tablature
566
567 % switch to full notation
568 tabFullNotation = {
569   % time signature
570   \revert TabStaff.TimeSignature.stencil
571   % stems (the half note gets a double stem)
572   \revert TabStaff.Stem.length
573   \revert TabStaff.Stem.no-stem-extend
574   \revert TabStaff.Flag.style
575   \revert TabStaff.Stem.details
576   \revert TabStaff.Stem.stencil
577   \revert TabStaff.Flag.stencil
578   \override TabStaff.Stem.stencil = #tabvoice::draw-double-stem-for-half-notes
579   \override TabStaff.Stem.X-extent = #tabvoice::make-double-stem-width-for-half-notes
580   \set TabStaff.autoBeaming = ##t
581   \revert TabStaff.NoteColumn.ignore-collision
582   % beams, dots
583   \revert TabStaff.Beam.stencil
584   \revert TabStaff.StemTremolo.stencil
585   \revert TabStaff.Dots.stencil
586   \revert TabStaff.Tie.stencil
587   \revert TabStaff.Tie.after-line-breaking
588   \revert TabStaff.RepeatTie.stencil
589   \revert TabStaff.RepeatTie.after-line-breaking
590   \revert TabStaff.LaissezVibrerTie.stencil
591   \revert TabStaff.Slur.stencil
592   \revert TabStaff.PhrasingSlur.stencil
593   % tuplet stuff
594   \revert TabStaff.TupletBracket.stencil
595   \revert TabStaff.TupletNumber.stencil
596   % dynamic signs
597   \revert TabStaff.DynamicText.stencil
598   \revert TabStaff.DynamicTextSpanner.stencil
599   \revert TabStaff.DynamicTextSpanner.stencil
600   \revert TabStaff.Hairpin.stencil
601   % rests
602   \revert TabStaff.Rest.stencil
603   \revert TabStaff.MultiMeasureRest.stencil
604   \revert TabStaff.MultiMeasureRestNumber.stencil
605   \revert TabStaff.MultiMeasureRestText.stencil
606   % markups etc.
607   \revert TabStaff.Glissando.stencil
608   \revert TabStaff.Script.stencil
609   \revert TabStaff.TextScript.stencil
610   \revert TabStaff.TextSpanner.stencil
611   \revert TabStaff.Arpeggio.stencil
612   \revert TabStaff.NoteColumn.ignore-collision
613 }
614
615 %tie/repeat tie behaviour
616 hideSplitTiedTabNotes = {
617   \override TabVoice.TabNoteHead.details.tied-properties.break-visibility = #all-invisible
618   \override TabVoice.TabNoteHead.details.tied-properties.parenthesize = ##f
619   \override TabVoice.TabNoteHead.details.repeat-tied-properties.note-head-visible = ##f
620   \override TabVoice.TabNoteHead.details.repeat-tied-properties.parenthesize = ##f
621 }
622
623 showSplitTiedTabNotes = {
624   \override TabVoice.TabNoteHead.details.tied-properties.break-visibility = #begin-of-line-visible
625   \override TabVoice.TabNoteHead.details.tied-properties.parenthesize = ##t
626   \override TabVoice.TabNoteHead.details.repeat-tied-properties.note-head-visible = ##t
627   \override TabVoice.TabNoteHead.details.repeat-tied-properties.parenthesize = ##t
628 }
629
630 %% text length
631
632 textLengthOn = {
633   % 0.4 staff-space between adjacent texts
634   \override TextScript.extra-spacing-width = #'(-0.0 . 0.4)
635   \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)
636 }
637
638 textLengthOff = {
639   \override TextScript.extra-spacing-width = #'(+inf.0 . -inf.0)
640   \override TextScript.extra-spacing-height = #'(0 . 0)
641 }
642
643 markLengthOn = {
644   \override Score.MetronomeMark.extra-spacing-width = #'(0 . 1.0)
645   \override Score.RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5)
646   % Raise as much as four staff-spaces before pushing notecolumns right
647   \override Score.MetronomeMark.extra-spacing-height = #'(4 . 4)
648   \override Score.RehearsalMark.extra-spacing-height = #'(4 . 4)
649 }
650
651 markLengthOff = {
652   \override Score.MetronomeMark.extra-spacing-width = #'(+inf.0 . -inf.0)
653   \override Score.RehearsalMark.extra-spacing-width = #'(+inf.0 . -inf.0)
654   \revert Score.MetronomeMark.extra-spacing-height
655   \revert Score.RehearsalMark.extra-spacing-height
656 }
657
658 %% text spanners
659
660 textSpannerUp      = \override TextSpanner.direction = #UP
661 textSpannerDown    = \override TextSpanner.direction = #DOWN
662 textSpannerNeutral = \revert TextSpanner.direction
663
664
665 %% ties
666
667 % directions
668 tieUp      = \override Tie.direction = #UP
669 tieDown    = \override Tie.direction = #DOWN
670 tieNeutral = \revert Tie.direction
671
672 % dash-patterns (make-simple-dash-definition defined at top of file)
673 tieDashPattern =
674 #(define-music-function (dash-fraction dash-period)
675   (number? number?)
676   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
677 ratio of line to space repeated at @var{dash-period} interval for ties.")
678   #{
679      \override Tie.dash-definition =
680        $(make-simple-dash-definition dash-fraction dash-period)
681   #})
682 tieDashed     = \override Tie.dash-definition = #'((0 1 0.4 0.75))
683 tieDotted     = \override Tie.dash-definition = #'((0 1 0.1 0.75))
684 tieHalfDashed = \override Tie.dash-definition = #'((0 0.5 0.4 0.75)
685                                                      (0.5 1 1 1))
686 tieHalfSolid  = \override Tie.dash-definition = #'((0 0.5 1 1)
687                                                      (0.5 1 0.4 0.75))
688 tieSolid      = \revert Tie.dash-definition
689
690
691 %% tuplets
692
693 tupletUp      = \override TupletBracket.direction = #UP
694 tupletDown    = \override TupletBracket.direction = #DOWN
695 tupletNeutral = \revert TupletBracket.direction
696
697
698 %% voice properties
699
700 % dynamic ly:dir?  text script, articulation script ly:dir?
701 voiceOne   = #(context-spec-music (make-voice-props-set 0)  'Voice)
702 voiceTwo   = #(context-spec-music (make-voice-props-set 1)  'Voice)
703 voiceThree = #(context-spec-music (make-voice-props-set 2)  'Voice)
704 voiceFour  = #(context-spec-music (make-voice-props-set 3)  'Voice)
705 oneVoice   = #(context-spec-music (make-voice-props-revert) 'Voice)
706
707
708 %% voice styles
709
710 voiceOneStyle = {
711   \override NoteHead.style = #'diamond
712   \override NoteHead.color = #red
713   \override Stem.color = #red
714   \override Beam.color = #red
715 }
716 voiceTwoStyle = {
717   \override NoteHead.style = #'triangle
718   \override NoteHead.color = #blue
719   \override Stem.color = #blue
720   \override Beam.color = #blue
721 }
722 voiceThreeStyle = {
723   \override NoteHead.style = #'xcircle
724   \override NoteHead.color = #green
725   \override Stem.color = #green
726   \override Beam.color = #green
727 }
728 voiceFourStyle = {
729   \override NoteHead.style = #'cross
730   \override NoteHead.color = #magenta
731   \override Stem.color = #magenta
732   \override Beam.color = #magenta
733 }
734 voiceNeutralStyle = {
735   \revert NoteHead.style
736   \revert NoteHead.color
737   \revert Stem.color
738   \revert Beam.color
739 }
740
741
742 %% volta brackets
743
744 allowVoltaHook =
745 #(define-void-function (bar) (string?)
746                        (allow-volta-hook bar))
747
748 %% x notes
749
750 #(define (cross-style grob)
751 ;; Returns the symbol 'cross to set the 'style-property for (Tab-)NoteHead.
752 ;; If the current text-font doesn't contain the glyph set 'font-name to '()
753 ;; and 'font-family to 'feta.
754 ;; If 'feta is replaced by another music-font without cross-style-glyphs
755 ;; note-head.cc throws a warning and no visual output happens.
756   (let* ((layout (ly:grob-layout grob))
757          (props (ly:grob-alist-chain grob))
758          (font (ly:paper-get-font layout props))
759          (font-unknown? (string=? (ly:font-name font) "unknown")))
760     (if font-unknown?
761         (begin
762           (ly:grob-set-property! grob 'font-name '())
763           (ly:grob-set-property! grob 'font-family 'feta)))
764     'cross))
765
766 %% Set the default note head style to a cross-shaped style.
767 xNotesOn = {
768   \temporary \override NoteHead.style = #cross-style
769   \temporary \override TabNoteHead.style = #cross-style
770 }
771
772 xNotesOff = \defaultNoteHeads
773
774 xNote =
775 #(define-music-function (note) (ly:music?)
776   (_i "Print @var{note} with a cross-shaped note head.")
777    (if (eq? (ly:music-property note 'name) 'NoteEvent)
778        #{ \tweak style #cross-style $note #}
779        #{ \xNotesOn $note \xNotesOff #}))
780
781 %% dead notes (these need to come after "x notes")
782
783 % Define aliases of cross-head notes for specific purposes
784 deadNotesOn  = \xNotesOn
785 deadNotesOff = \xNotesOff
786 deadNote     = #xNote