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