]> git.donarmstrong.com Git - lilypond.git/blob - ly/property-init.ly
Merge branch 'stable/2.16' into staging
[lilypond.git] / ly / property-init.ly
1 % property-init.ly
2
3 \version "2.16.0"
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   \override TabNoteHead #'transparent = ##t
252 }
253 unHideNotes = {
254   \revert Accidental #'transparent
255   \revert Beam #'transparent
256   \revert Stem #'transparent
257   \revert Flag #'transparent
258   \revert NoteHead #'transparent
259   \revert NoteHead #'no-ledgers
260   \revert Dots #'transparent
261   \revert Rest #'transparent
262   \revert TabNoteHead #'transparent
263 }
264
265
266 %% improvisation
267
268 improvisationOn = {
269   \set squashedPosition = #0
270   \override NoteHead #'style = #'slash
271   \override Accidental #'stencil = ##f
272   \override AccidentalCautionary #'stencil = ##f
273 }
274 improvisationOff = {
275   \unset squashedPosition
276   \revert NoteHead #'style
277   \revert Accidental #'stencil
278   \revert AccidentalCautionary #'stencil
279 }
280
281
282 %% merging
283
284 mergeDifferentlyDottedOn =
285   \override Staff.NoteCollision #'merge-differently-dotted = ##t
286 mergeDifferentlyDottedOff =
287   \revert Staff.NoteCollision #'merge-differently-dotted
288 mergeDifferentlyHeadedOn =
289   \override Staff.NoteCollision #'merge-differently-headed = ##t
290 mergeDifferentlyHeadedOff =
291   \revert Staff.NoteCollision #'merge-differently-headed
292
293
294 %% numeric time signature
295
296 numericTimeSignature = \override Staff.TimeSignature #'style = #'numbered
297 defaultTimeSignature = \revert Staff.TimeSignature #'style
298
299
300 %% palm mutes
301
302 palmMuteOn =
303 #(define-music-function (parser location) ()
304    (_i "Set the default note head style to a triangle-shaped style.")
305    (override-head-style 'NoteHead 'do))
306 palmMuteOff = \defaultNoteHeads
307 palmMute =
308 #(define-music-function (parser location note) (ly:music?)
309    (_i "Print @var{note} with a triangle-shaped note head.")
310    (style-note-heads 'NoteHead 'do note))
311
312
313 %% phrasing slurs
314
315 % directions
316 phrasingSlurUp      = \override PhrasingSlur #'direction = #UP
317 phrasingSlurDown    = \override PhrasingSlur #'direction = #DOWN
318 phrasingSlurNeutral = \revert PhrasingSlur #'direction
319
320 % dash-patterns (make-simple-dash-definition defined at top of file)
321 phrasingSlurDashPattern =
322 #(define-music-function (parser location dash-fraction dash-period)
323    (number? number?)
324    (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
325 line to space repeated at @var{dash-period} interval for phrasing slurs.")
326   #{
327      \override PhrasingSlur #'dash-definition =
328        $(make-simple-dash-definition dash-fraction dash-period)
329   #})
330 phrasingSlurDashed =
331   \override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75))
332 phrasingSlurDotted =
333   \override PhrasingSlur #'dash-definition = #'((0 1 0.1 0.75))
334 phrasingSlurHalfDashed =
335   \override PhrasingSlur #'dash-definition = #'((0 0.5 0.4 0.75)
336                                                 (0.5 1 1 1))
337 phrasingSlurHalfSolid =
338   \override PhrasingSlur #'dash-definition = #'((0 0.5 1 1)
339                                                 (0.5 1 0.4 0.75))
340 phrasingSlurSolid =
341   \revert PhrasingSlur #'dash-definition
342
343
344 %% point and click
345
346 pointAndClickOn  =
347 #(define-music-function (parser location) ()
348    (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
349 originating lilypond source statement;
350 this is helpful when developing a score but generates bigger final-format files.")
351    (ly:set-option 'point-and-click #t)
352    (make-music 'SequentialMusic 'void #t))
353
354 pointAndClickOff =
355 #(define-music-function (parser location) ()
356    (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
357 back to the lilypond source statement.")
358    (ly:set-option 'point-and-click #f)
359    (make-music 'SequentialMusic 'void #t))
360
361 pointAndClickTypes =
362 #(define-void-function (parser location types) (list-or-symbol?)
363   (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
364   (ly:set-option 'point-and-click types))
365
366 %% predefined fretboards
367
368 predefinedFretboardsOff =
369   \set predefinedDiagramTable = ##f
370 predefinedFretboardsOn =
371   \set predefinedDiagramTable = #default-fret-table
372
373
374 %% shape note heads
375
376 aikenHeads      = \set shapeNoteStyles = #'#(do re miMirror fa sol la ti)
377 aikenHeadsMinor = \set shapeNoteStyles = #'#(la ti do re miMirror fa sol)
378 funkHeads =
379   \set shapeNoteStyles = #'#(doFunk reFunk miFunk faFunk solFunk laFunk tiFunk)
380 funkHeadsMinor =
381   \set shapeNoteStyles = #'#(laFunk tiFunk doFunk reFunk miFunk faFunk solFunk)
382 sacredHarpHeads = \set shapeNoteStyles = #'#(fa sol la fa sol la mi)
383 sacredHarpHeadsMinor = \set shapeNoteStyles = #'#(la mi fa sol la fa sol)
384 southernHarmonyHeads =
385   \set shapeNoteStyles = #'#(faThin sol laThin faThin sol laThin miThin)
386 southernHarmonyHeadsMinor =
387   \set shapeNoteStyles = #'#(laThin miThin faThin sol laThin faThin sol)
388 walkerHeads =
389   \set shapeNoteStyles = #'#(doWalker reWalker miWalker faWalker solFunk laWalker tiWalker)
390 walkerHeadsMinor =
391   \set shapeNoteStyles = #'#(laWalker tiWalker doWalker reWalker miWalker faWalker solFunk)
392
393
394 %% shifts
395
396 shiftOn   = \override NoteColumn #'horizontal-shift = #1
397 shiftOnn  = \override NoteColumn #'horizontal-shift = #2
398 shiftOnnn = \override NoteColumn #'horizontal-shift = #3
399 shiftOff  = \revert NoteColumn #'horizontal-shift
400
401
402 %% slurs
403
404 % directions
405 slurUp         = \override Slur #'direction = #UP
406 slurDown       = \override Slur #'direction = #DOWN
407 slurNeutral    = \revert Slur #'direction
408
409 % dash-patterns (make-simple-dash-definition defined at top of file)
410 slurDashPattern =
411 #(define-music-function (parser location dash-fraction dash-period)
412   (number? number?)
413   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
414 ratio of line to space repeated at @var{dash-period} interval for slurs.")
415   #{
416      \override Slur #'dash-definition =
417        $(make-simple-dash-definition dash-fraction dash-period)
418   #})
419 slurDashed     = \override Slur #'dash-definition = #'((0 1 0.4 0.75))
420 slurDotted     = \override Slur #'dash-definition = #'((0 1 0.1 0.75))
421 slurHalfDashed = \override Slur #'dash-definition = #'((0 0.5 0.4 0.75)
422                                                        (0.5 1 1 1))
423 slurHalfSolid  = \override Slur #'dash-definition = #'((0 0.5 1 1)
424                                                        (0.5 1 0.4 0.75))
425 slurSolid      = \revert Slur #'dash-definition
426
427
428 %% staff switches
429
430 showStaffSwitch = \set followVoice = ##t
431 hideStaffSwitch = \set followVoice = ##f
432
433
434 %% stems
435
436 stemUp      = \override Stem #'direction = #UP
437 stemDown    = \override Stem #'direction = #DOWN
438 stemNeutral = \revert Stem #'direction
439
440
441 %% tablature
442
443 % switch to full notation
444 tabFullNotation = {
445   % time signature
446   \revert TabStaff.TimeSignature #'stencil
447   % stems (the half note gets a double stem)
448   \revert TabVoice.Stem #'length
449   \revert TabVoice.Stem #'no-stem-extend
450   \revert TabVoice.Flag #'style
451   \revert TabVoice.Stem #'details
452   \revert TabVoice.Stem #'stencil
453   \revert TabVoice.Flag #'stencil
454   \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
455   \override TabVoice.Stem #'X-extent = #tabvoice::make-double-stem-width-for-half-notes
456   \set TabVoice.autoBeaming = ##t
457   \revert TabVoice.NoteColumn #'ignore-collision
458   % beams, dots
459   \revert TabVoice.Beam #'stencil
460   \revert TabVoice.StemTremolo #'stencil
461   \revert TabVoice.Dots #'stencil
462   \revert TabVoice.Tie #'stencil
463   \revert TabVoice.Tie #'after-line-breaking
464   \revert TabVoice.RepeatTie #'stencil
465   \revert TabVoice.RepeatTie #'after-line-breaking
466   \revert TabVoice.LaissezVibrerTie #'stencil
467   \revert TabVoice.Slur #'stencil
468   \revert TabVoice.PhrasingSlur #'stencil
469   % tuplet stuff
470   \revert TabVoice.TupletBracket #'stencil
471   \revert TabVoice.TupletNumber #'stencil
472   % dynamic signs
473   \revert TabVoice.DynamicText #'stencil
474   \revert TabVoice.DynamicTextSpanner #'stencil
475   \revert TabVoice.DynamicTextSpanner #'stencil
476   \revert TabVoice.Hairpin #'stencil
477   % rests
478   \revert TabVoice.Rest #'stencil
479   \revert TabVoice.MultiMeasureRest #'stencil
480   \revert TabVoice.MultiMeasureRestNumber #'stencil
481   \revert TabVoice.MultiMeasureRestText #'stencil
482   % markups etc.
483   \revert TabVoice.Glissando #'stencil
484   \revert TabVoice.Script #'stencil
485   \revert TabVoice.TextScript #'stencil
486   \revert TabVoice.TextSpanner #'stencil
487   \revert TabStaff.Arpeggio #'stencil
488   \revert TabStaff.NoteColumn #'ignore-collision
489 }
490
491 %tie/repeat tie behaviour
492 hideSplitTiedTabNotes = {
493   \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #all-invisible
494   \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##f
495   \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##f
496   \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##f
497 }
498
499 showSplitTiedTabNotes = {
500   \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #begin-of-line-visible
501   \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##t
502   \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##t
503   \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##t
504 }
505
506 %% text length
507
508 textLengthOn = {
509   \override TextScript #'extra-spacing-width = #'(0 . 0)
510   \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
511 }
512 textLengthOff = {
513   \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
514   \override TextScript #'extra-spacing-height = #'(0 . 0)
515 }
516
517
518 %% text spanners
519
520 textSpannerUp      = \override TextSpanner #'direction = #UP
521 textSpannerDown    = \override TextSpanner #'direction = #DOWN
522 textSpannerNeutral = \revert TextSpanner #'direction
523
524
525 %% ties
526
527 % directions
528 tieUp      = \override Tie #'direction = #UP
529 tieDown    = \override Tie #'direction = #DOWN
530 tieNeutral = \revert Tie #'direction
531
532 % dash-patterns (make-simple-dash-definition defined at top of file)
533 tieDashPattern =
534 #(define-music-function (parser location dash-fraction dash-period)
535   (number? number?)
536   (_i "Set up a custom style of dash pattern for @var{dash-fraction}
537 ratio of line to space repeated at @var{dash-period} interval for ties.")
538   #{
539      \override Tie #'dash-definition =
540        $(make-simple-dash-definition dash-fraction dash-period)
541   #})
542 tieDashed     = \override Tie #'dash-definition = #'((0 1 0.4 0.75))
543 tieDotted     = \override Tie #'dash-definition = #'((0 1 0.1 0.75))
544 tieHalfDashed = \override Tie #'dash-definition = #'((0 0.5 0.4 0.75)
545                                                      (0.5 1 1 1))
546 tieHalfSolid  = \override Tie #'dash-definition = #'((0 0.5 1 1)
547                                                      (0.5 1 0.4 0.75))
548 tieSolid      = \revert Tie #'dash-definition
549
550
551 %% tuplets
552
553 tupletUp      = \override TupletBracket #'direction = #UP
554 tupletDown    = \override TupletBracket #'direction = #DOWN
555 tupletNeutral = \revert TupletBracket #'direction
556
557
558 %% voice properties
559
560 % dynamic ly:dir?  text script, articulation script ly:dir?
561 voiceOne   = #(context-spec-music (make-voice-props-set 0)  'Voice)
562 voiceTwo   = #(context-spec-music (make-voice-props-set 1)  'Voice)
563 voiceThree = #(context-spec-music (make-voice-props-set 2)  'Voice)
564 voiceFour  = #(context-spec-music (make-voice-props-set 3)  'Voice)
565 oneVoice   = #(context-spec-music (make-voice-props-revert) 'Voice)
566
567
568 %% voice styles
569
570 voiceOneStyle = {
571   \override NoteHead #'style = #'diamond
572   \override NoteHead #'color = #red
573   \override Stem #'color = #red
574   \override Flag #'color = #red
575   \override Beam #'color = #red
576 }
577 voiceTwoStyle = {
578   \override NoteHead #'style = #'triangle
579   \override NoteHead #'color = #blue
580   \override Stem #'color = #blue
581   \override Flag #'color = #blue
582   \override Beam #'color = #blue
583 }
584 voiceThreeStyle = {
585   \override NoteHead #'style = #'xcircle
586   \override NoteHead #'color = #green
587   \override Stem #'color = #green
588   \override Flag #'color = #green
589   \override Beam #'color = #green
590 }
591 voiceFourStyle = {
592   \override NoteHead #'style = #'cross
593   \override NoteHead #'color = #magenta
594   \override Stem #'color = #magenta
595   \override Flag #'color = #magenta
596   \override Beam #'color = #magenta
597 }
598 voiceNeutralStyle = {
599   \revert NoteHead #'style
600   \revert NoteHead #'color
601   \revert Stem #'color
602   \revert Flag #'color
603   \revert Beam #'color
604 }
605
606
607 %% x notes
608
609 xNotesOn =
610 #(define-music-function (parser location) ()
611    (_i "Set the default note head style to a cross-shaped style.")
612    (override-head-style '(TabNoteHead NoteHead) 'cross))
613 xNotesOff = \defaultNoteHeads
614 xNote =
615 #(define-music-function (parser location note) (ly:music?)
616    (_i "Print @var{note} with a cross-shaped note head.")
617    (style-note-heads '(TabNoteHead NoteHead) 'cross note))
618
619
620 %% dead notes (these need to come after "x notes")
621
622 % Define aliases of cross-head notes for specific purposes
623 deadNotesOn  = \xNotesOn
624 deadNotesOff = \xNotesOff
625 deadNote     = #xNote