]> git.donarmstrong.com Git - lilypond.git/blob - ly/property-init.ly
cec33d9a42530e46a9a26f712c4cc08506924cd6
[lilypond.git] / ly / property-init.ly
1 % property-init.ly
2
3 \version "2.15.10"
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 (parser location) ()
13    (_i "Revert to the default note head style.")
14    (revert-head-style '(NoteHead TabNoteHead)))
15
16
17 accidentalStyle =
18 #(define-music-function
19    (parser location context style) ((symbol?) string?)
20    (_i "Set accidental style to @var{style}, a string.  If an optional
21 @var{context} symbol is given, e.g. @code{#'Staff} or @code{#'Voice},
22 the settings are applied to that context.  Otherwise, the context
23 defaults to @samp{Staff}, except for piano styles, which use
24 @samp{GrandStaff} as a context." )
25    (if context
26        (set-accidental-style (string->symbol style) context)
27        (set-accidental-style (string->symbol style))))
28
29 %% arpeggios
30
31 % For drawing vertical chord brackets with \arpeggio
32 % This is a shorthand for the value of the print-function property
33 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
34 % cross-staff brackets are desired.
35
36 arpeggio = #(make-music 'ArpeggioEvent)
37 arpeggioArrowUp = {
38   \revert Arpeggio  #'stencil
39   \revert Arpeggio #'X-extent
40   \override Arpeggio  #'arpeggio-direction = #UP
41 }
42 arpeggioArrowDown = {
43   \revert Arpeggio #'stencil
44   \revert Arpeggio #'X-extent
45   \override Arpeggio  #'arpeggio-direction = #DOWN
46 }
47 arpeggioNormal = {
48   \revert Arpeggio #'stencil
49   \revert Arpeggio #'X-extent
50   \revert Arpeggio #'arpeggio-direction
51   \revert Arpeggio #'dash-definition
52 }
53 arpeggioBracket = {
54   \revert Arpeggio #'X-extent
55   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket
56 }
57 arpeggioParenthesis = {
58   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
59   \override Arpeggio #'X-extent = #ly:grob::stencil-width
60   \revert Arpeggio #'dash-definition
61 }
62 arpeggioParenthesisDashed = {
63   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
64   \override Arpeggio #'X-extent = #ly:grob::stencil-width
65   \override Arpeggio #'dash-definition = #'((0 1 0.4 0.75))
66 }
67
68
69 %% auto beaming
70
71 autoBeamOn  = \set autoBeaming = ##t
72 autoBeamOff = \set autoBeaming = ##f
73
74
75 %% balloon length
76
77 balloonLengthOn = {
78   \override BalloonTextItem #'extra-spacing-width = #'(0 . 0)
79   \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0)
80 }
81 balloonLengthOff = {
82   \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0)
83   \override BalloonTextItem #'extra-spacing-height = #'(0 . 0)
84 }
85
86
87 %% bass figures
88
89 bassFigureExtendersOn = {
90   \set useBassFigureExtenders = ##t
91   \set Staff.useBassFigureExtenders = ##t
92 }
93 bassFigureExtendersOff = {
94   \set useBassFigureExtenders = ##f
95   \set Staff.useBassFigureExtenders = ##f
96 }
97 bassFigureStaffAlignmentDown =
98   \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
99 bassFigureStaffAlignmentUp =
100   \override Staff.BassFigureAlignmentPositioning #'direction = #UP
101 bassFigureStaffAlignmentNeutral =
102   \revert Staff.BassFigureAlignmentPositioning #'direction
103
104
105 %% cadenzas
106
107 cadenzaOn  = {
108   \set Timing.timing = ##f
109   \set Timing.autoBeaming = ##f
110 }
111
112 cadenzaOff = {
113   \set Timing.timing = ##t
114   \set Timing.measurePosition = #ZERO-MOMENT
115   \set Timing.autoBeaming = ##t
116 }
117
118
119 %% chord names
120
121 frenchChords = {
122   \set chordRootNamer = #(chord-name->italian-markup #t)
123   \set chordPrefixSpacer = #0.4
124 }
125 germanChords = {
126   \set chordRootNamer = #(chord-name->german-markup #t)
127   \set chordNoteNamer = #note-name->german-markup
128 }
129 semiGermanChords = {
130   \set chordRootNamer = #(chord-name->german-markup #f)
131   \set chordNoteNamer = #note-name->german-markup
132 }
133 italianChords = {
134   \set chordRootNamer = #(chord-name->italian-markup #f)
135   \set chordPrefixSpacer = #0.4
136 }
137 powerChords = {
138   \set chordNameExceptions = #powerChordExceptions
139 }
140
141
142 %% compressFullBarRests
143
144 compressFullBarRests = \set Score.skipBars = ##t
145 expandFullBarRests   = \set Score.skipBars = ##f
146
147
148 %% dots
149
150 dotsUp      = \override Dots #'direction = #UP
151 dotsDown    = \override Dots #'direction = #DOWN
152 dotsNeutral = \revert Dots #'direction
153
154
155 %% dynamics
156
157 dynamicUp = {
158   \override DynamicText #'direction = #UP
159   \override DynamicLineSpanner #'direction = #UP
160 }
161 dynamicDown = {
162   \override DynamicText #'direction = #DOWN
163   \override DynamicLineSpanner #'direction = #DOWN
164 }
165 dynamicNeutral = {
166   \revert DynamicText #'direction
167   \revert DynamicLineSpanner #'direction
168 }
169
170
171 %% easy heads
172
173 easyHeadsOn = {
174   \override NoteHead #'stencil = #note-head::brew-ez-stencil
175   \override NoteHead #'font-size = #-8
176   \override NoteHead #'font-family = #'sans
177   \override NoteHead #'font-series = #'bold
178 }
179 easyHeadsOff = {
180   \revert NoteHead #'stencil
181   \revert NoteHead #'font-size
182   \revert NoteHead #'font-family
183   \revert NoteHead #'font-series
184 }
185
186
187 %% endincipit
188
189 %% End the incipit and print a ``normal line start''.
190 endincipit = \context Staff {
191   \partial 16 s16  % Hack to handle e.g. \bar ".|" \endincipit
192   \once \override Staff.Clef #'full-size-change = ##t
193   \once \override Staff.Clef #'non-default = ##t
194   \bar ""
195 }
196
197
198 %% fermata markup
199
200 fermataMarkup =
201 #(make-music 'MultiMeasureTextEvent
202              'tweaks (list
203                       ;; Set the 'text based on the 'direction
204                       (cons 'text (lambda (grob)
205                                     (if (eq? (ly:grob-property grob 'direction) DOWN)
206                                         (markup #:musicglyph "scripts.dfermata")
207                                         (markup #:musicglyph "scripts.ufermata"))))
208                       (cons 'outside-staff-priority 40)
209                       (cons 'outside-staff-padding 0)))
210
211 %% font sizes
212
213 teeny      = \set fontSize = #-3
214 tiny       = \set fontSize = #-2
215 small      = \set fontSize = #-1
216 normalsize = \set fontSize = #0
217 large      = \set fontSize = #1
218 huge       = \set fontSize = #2
219
220
221 %% glissando
222
223 glissando = #(make-music 'GlissandoEvent)
224
225
226 %% harmonics
227
228 harmonicsOn =
229 #(define-music-function (parser location) ()
230    (_i "Set the default note head style to a diamond-shaped style.")
231    (override-head-style '(NoteHead TabNoteHead) 'harmonic))
232 harmonicsOff = \defaultNoteHeads
233 harmonicNote =
234 #(define-music-function (parser location note) (ly:music?)
235    (_i "Print @var{note} with a diamond-shaped note head.")
236    (style-note-heads 'NoteHead 'harmonic note))
237
238
239 %% hideNotes
240
241 hideNotes = {
242   % hide notes, accidentals, etc.
243   \override Dots #'transparent = ##t
244   \override NoteHead #'transparent = ##t
245   \override NoteHead #'no-ledgers = ##t
246   \override Stem #'transparent = ##t
247   \override Flag #'transparent = ##t
248   \override Beam #'transparent = ##t
249   \override Accidental #'transparent = ##t
250   \override Rest #'transparent = ##t
251 }
252 unHideNotes = {
253   \revert Accidental #'transparent
254   \revert Beam #'transparent
255   \revert Stem #'transparent
256   \revert Flag #'transparent
257   \revert NoteHead #'transparent
258   \revert NoteHead #'no-ledgers
259   \revert Dots #'transparent
260   \revert Rest #'transparent
261 }
262
263
264 %% improvisation
265
266 improvisationOn = {
267   \set squashedPosition = #0
268   \override NoteHead #'style = #'slash
269   \override Accidental #'stencil = ##f
270   \override AccidentalCautionary #'stencil = ##f
271 }
272 improvisationOff = {
273   \unset squashedPosition
274   \revert NoteHead #'style
275   \revert Accidental #'stencil
276   \revert AccidentalCautionary #'stencil
277 }
278
279
280 %% merging
281
282 mergeDifferentlyDottedOn =
283   \override Staff.NoteCollision #'merge-differently-dotted = ##t
284 mergeDifferentlyDottedOff =
285   \revert Staff.NoteCollision #'merge-differently-dotted
286 mergeDifferentlyHeadedOn =
287   \override Staff.NoteCollision #'merge-differently-headed = ##t
288 mergeDifferentlyHeadedOff =
289   \revert Staff.NoteCollision #'merge-differently-headed
290
291
292 %% numeric time signature
293
294 numericTimeSignature = \override Staff.TimeSignature #'style = #'numbered
295 defaultTimeSignature = \revert Staff.TimeSignature #'style
296
297
298 %% palm mutes
299
300 palmMuteOn =
301 #(define-music-function (parser location) ()
302    (_i "Set the default note head style to a triangle-shaped style.")
303    (override-head-style 'NoteHead 'do))
304 palmMuteOff = \defaultNoteHeads
305 palmMute =
306 #(define-music-function (parser location note) (ly:music?)
307    (_i "Print @var{note} with a triangle-shaped note head.")
308    (style-note-heads 'NoteHead 'do note))
309
310
311 %% phrasing slurs
312
313 % directions
314 phrasingSlurUp      = \override PhrasingSlur #'direction = #UP
315 phrasingSlurDown    = \override PhrasingSlur #'direction = #DOWN
316 phrasingSlurNeutral = \revert PhrasingSlur #'direction
317
318 % dash-patterns (make-simple-dash-definition defined at top of file)
319 phrasingSlurDashPattern =
320 #(define-music-function (parser location dash-fraction dash-period)
321    (number? number?)
322    (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
323 line to space repeated at @var{dash-period} interval for phrasing slurs.")
324   #{
325      \override PhrasingSlur #'dash-definition =
326        $(make-simple-dash-definition dash-fraction dash-period)
327   #})
328 phrasingSlurDashed =
329   \override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75))
330 phrasingSlurDotted =
331   \override PhrasingSlur #'dash-definition = #'((0 1 0.1 0.75))
332 phrasingSlurHalfDashed =
333   \override PhrasingSlur #'dash-definition = #'((0 0.5 0.4 0.75)
334                                                 (0.5 1 1 1))
335 phrasingSlurHalfSolid =
336   \override PhrasingSlur #'dash-definition = #'((0 0.5 1 1)
337                                                 (0.5 1 0.4 0.75))
338 phrasingSlurSolid =
339   \revert PhrasingSlur #'dash-definition
340
341
342 %% point and click
343
344 pointAndClickOn  =
345 #(define-music-function (parser location) ()
346    (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
347 originating lilypond source statement;
348 this is helpful when developing a score but generates bigger final-format files.")
349    (ly:set-option 'point-and-click #t)
350    (make-music 'SequentialMusic 'void #t))
351
352 pointAndClickOff =
353 #(define-music-function (parser location) ()
354    (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
355 back to the lilypond source statement.")
356    (ly:set-option 'point-and-click #f)
357    (make-music 'SequentialMusic 'void #t))
358
359 pointAndClickTypes =
360 #(define-void-function (parser location types) (list-or-symbol?)
361   (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
362   (ly:set-option 'point-and-click types))
363
364 %% predefined fretboards
365
366 predefinedFretboardsOff =
367   \set predefinedDiagramTable = ##f
368 predefinedFretboardsOn =
369   \set predefinedDiagramTable = #default-fret-table
370
371
372 %% shape note heads
373
374 aikenHeads      = \set shapeNoteStyles = #'#(do re miMirror fa sol la ti)
375 aikenHeadsMinor = \set shapeNoteStyles = #'#(la ti do re miMirror fa sol)
376 funkHeads =
377   \set shapeNoteStyles = #'#(doFunk reFunk miFunk faFunk solFunk laFunk tiFunk)
378 funkHeadsMinor =
379   \set shapeNoteStyles = #'#(laFunk tiFunk doFunk reFunk miFunk faFunk solFunk)
380 sacredHarpHeads = \set shapeNoteStyles = #'#(fa sol la fa sol la mi)
381 sacredHarpHeadsMinor = \set shapeNoteStyles = #'#(la mi fa sol la fa sol)
382 southernHarmonyHeads =
383   \set shapeNoteStyles = #'#(faThin sol laThin faThin sol laThin miThin)
384 southernHarmonyHeadsMinor =
385   \set shapeNoteStyles = #'#(laThin miThin faThin sol laThin faThin sol)
386 walkerHeads =
387   \set shapeNoteStyles = #'#(doWalker reWalker miWalker faWalker solFunk laWalker tiWalker)
388 walkerHeadsMinor =
389   \set shapeNoteStyles = #'#(laWalker tiWalker doWalker reWalker miWalker faWalker solFunk)
390
391
392 %% shifts
393
394 shiftOn   = \override NoteColumn #'horizontal-shift = #1
395 shiftOnn  = \override NoteColumn #'horizontal-shift = #2
396 shiftOnnn = \override NoteColumn #'horizontal-shift = #3
397 shiftOff  = \revert NoteColumn #'horizontal-shift
398
399
400 %% slurs
401
402 % directions
403 slurUp         = \override Slur #'direction = #UP
404 slurDown       = \override Slur #'direction = #DOWN
405 slurNeutral    = \revert Slur #'direction
406
407 % dash-patterns (make-simple-dash-definition defined at top of file)
408 slurDashPattern =
409 #(define-music-function (parser location dash-fraction dash-period)
410   (number? number?)
411   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
412 ratio of line to space repeated at @var{dash-period} interval for slurs.")
413   #{
414      \override Slur #'dash-definition =
415        $(make-simple-dash-definition dash-fraction dash-period)
416   #})
417 slurDashed     = \override Slur #'dash-definition = #'((0 1 0.4 0.75))
418 slurDotted     = \override Slur #'dash-definition = #'((0 1 0.1 0.75))
419 slurHalfDashed = \override Slur #'dash-definition = #'((0 0.5 0.4 0.75)
420                                                        (0.5 1 1 1))
421 slurHalfSolid  = \override Slur #'dash-definition = #'((0 0.5 1 1)
422                                                        (0.5 1 0.4 0.75))
423 slurSolid      = \revert Slur #'dash-definition
424
425
426 %% staff switches
427
428 showStaffSwitch = \set followVoice = ##t
429 hideStaffSwitch = \set followVoice = ##f
430
431
432 %% stems
433
434 stemUp      = \override Stem #'direction = #UP
435 stemDown    = \override Stem #'direction = #DOWN
436 stemNeutral = \revert Stem #'direction
437
438
439 %% tablature
440
441 % switch to full notation
442 tabFullNotation = {
443   % time signature
444   \revert TabStaff.TimeSignature #'stencil
445   % stems (the half note gets a double stem)
446   \revert TabVoice.Stem #'length
447   \revert TabVoice.Stem #'no-stem-extend
448   \revert TabVoice.Flag #'style
449   \revert TabVoice.Stem #'details
450   \revert TabVoice.Stem #'stencil
451   \revert TabVoice.Flag #'stencil
452   \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
453   \override TabVoice.Stem #'X-extent = #tabvoice::make-double-stem-width-for-half-notes
454   \set TabVoice.autoBeaming = ##t
455   \revert TabVoice.NoteColumn #'ignore-collision
456   % beams, dots
457   \revert TabVoice.Beam #'stencil
458   \revert TabVoice.StemTremolo #'stencil
459   \revert TabVoice.Dots #'stencil
460   \revert TabVoice.Tie #'stencil
461   \revert TabVoice.Tie #'after-line-breaking
462   \revert TabVoice.RepeatTie #'stencil
463   \revert TabVoice.RepeatTie #'after-line-breaking
464   \revert TabVoice.LaissezVibrerTie #'stencil
465   \revert TabVoice.Slur #'stencil
466   \revert TabVoice.PhrasingSlur #'stencil
467   % tuplet stuff
468   \revert TabVoice.TupletBracket #'stencil
469   \revert TabVoice.TupletNumber #'stencil
470   % dynamic signs
471   \revert TabVoice.DynamicText #'stencil
472   \revert TabVoice.DynamicTextSpanner #'stencil
473   \revert TabVoice.DynamicTextSpanner #'stencil
474   \revert TabVoice.Hairpin #'stencil
475   % rests
476   \revert TabVoice.Rest #'stencil
477   \revert TabVoice.MultiMeasureRest #'stencil
478   \revert TabVoice.MultiMeasureRestNumber #'stencil
479   \revert TabVoice.MultiMeasureRestText #'stencil
480   % markups etc.
481   \revert TabVoice.Glissando #'stencil
482   \revert TabVoice.Script #'stencil
483   \revert TabVoice.TextScript #'stencil
484   \revert TabVoice.TextSpanner #'stencil
485   \revert TabStaff.Arpeggio #'stencil
486   \revert TabStaff.NoteColumn #'ignore-collision
487 }
488
489 %tie/repeat tie behaviour
490 hideSplitTiedTabNotes = {
491   \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #all-invisible
492   \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##f
493   \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##f
494   \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##f
495 }
496
497 showSplitTiedTabNotes = {
498   \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #begin-of-line-visible
499   \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##t
500   \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##t
501   \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##t
502 }
503
504 %% text length
505
506 textLengthOn = {
507   \override TextScript #'extra-spacing-width = #'(0 . 0)
508   \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
509 }
510 textLengthOff = {
511   \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
512   \override TextScript #'extra-spacing-height = #'(0 . 0)
513 }
514
515
516 %% text spanners
517
518 textSpannerUp      = \override TextSpanner #'direction = #UP
519 textSpannerDown    = \override TextSpanner #'direction = #DOWN
520 textSpannerNeutral = \revert TextSpanner #'direction
521
522
523 %% ties
524
525 % directions
526 tieUp      = \override Tie #'direction = #UP
527 tieDown    = \override Tie #'direction = #DOWN
528 tieNeutral = \revert Tie #'direction
529
530 % dash-patterns (make-simple-dash-definition defined at top of file)
531 tieDashPattern =
532 #(define-music-function (parser location dash-fraction dash-period)
533   (number? number?)
534   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
535 ratio of line to space repeated at @var{dash-period} interval for ties.")
536   #{
537      \override Tie #'dash-definition =
538        $(make-simple-dash-definition dash-fraction dash-period)
539   #})
540 tieDashed     = \override Tie #'dash-definition = #'((0 1 0.4 0.75))
541 tieDotted     = \override Tie #'dash-definition = #'((0 1 0.1 0.75))
542 tieHalfDashed = \override Tie #'dash-definition = #'((0 0.5 0.4 0.75)
543                                                      (0.5 1 1 1))
544 tieHalfSolid  = \override Tie #'dash-definition = #'((0 0.5 1 1)
545                                                      (0.5 1 0.4 0.75))
546 tieSolid      = \revert Tie #'dash-definition
547
548
549 %% tuplets
550
551 tupletUp      = \override TupletBracket #'direction = #UP
552 tupletDown    = \override TupletBracket #'direction = #DOWN
553 tupletNeutral = \revert TupletBracket #'direction
554
555
556 %% voice properties
557
558 % dynamic ly:dir?  text script, articulation script ly:dir?
559 voiceOne   = #(context-spec-music (make-voice-props-set 0)  'Voice)
560 voiceTwo   = #(context-spec-music (make-voice-props-set 1)  'Voice)
561 voiceThree = #(context-spec-music (make-voice-props-set 2)  'Voice)
562 voiceFour  = #(context-spec-music (make-voice-props-set 3)  'Voice)
563 oneVoice   = #(context-spec-music (make-voice-props-revert) 'Voice)
564
565
566 %% voice styles
567
568 voiceOneStyle = {
569   \override NoteHead #'style = #'diamond
570   \override NoteHead #'color = #red
571   \override Stem #'color = #red
572   \override Flag #'color = #red
573   \override Beam #'color = #red
574 }
575 voiceTwoStyle = {
576   \override NoteHead #'style = #'triangle
577   \override NoteHead #'color = #blue
578   \override Stem #'color = #blue
579   \override Flag #'color = #blue
580   \override Beam #'color = #blue
581 }
582 voiceThreeStyle = {
583   \override NoteHead #'style = #'xcircle
584   \override NoteHead #'color = #green
585   \override Stem #'color = #green
586   \override Flag #'color = #green
587   \override Beam #'color = #green
588 }
589 voiceFourStyle = {
590   \override NoteHead #'style = #'cross
591   \override NoteHead #'color = #magenta
592   \override Stem #'color = #magenta
593   \override Flag #'color = #magenta
594   \override Beam #'color = #magenta
595 }
596 voiceNeutralStyle = {
597   \revert NoteHead #'style
598   \revert NoteHead #'color
599   \revert Stem #'color
600   \revert Flag #'color
601   \revert Beam #'color
602 }
603
604
605 %% x notes
606
607 xNotesOn =
608 #(define-music-function (parser location) ()
609    (_i "Set the default note head style to a cross-shaped style.")
610    (override-head-style '(TabNoteHead NoteHead) 'cross))
611 xNotesOff = \defaultNoteHeads
612 xNote =
613 #(define-music-function (parser location note) (ly:music?)
614    (_i "Print @var{note} with a cross-shaped note head.")
615    (style-note-heads '(TabNoteHead NoteHead) 'cross note))
616
617
618 %% dead notes (these need to come after "x notes")
619
620 % Define aliases of cross-head notes for specific purposes
621 deadNotesOn  = \xNotesOn
622 deadNotesOff = \xNotesOff
623 deadNote     = #xNote