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