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