Doc: CG intro -- mention lily-git.
[lilypond/mpolesky.git] / ly / property-init.ly
blob355094e3a6dc1ce91a76b0bb896501b9d871d50c
1 % property-init.ly
3 \version "2.12.0"
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)))
10 %% arpeggios
12 % For drawing vertical chord brackets with \arpeggio
13 % This is a shorthand for the value of the print-function property
14 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
15 % cross-staff brackets are desired.
17 arpeggio = #(make-music 'ArpeggioEvent)
18 arpeggioArrowUp = {
19 \revert Arpeggio #'stencil
20 \revert Arpeggio #'X-extent
21 \override Arpeggio #'arpeggio-direction = #UP
23 arpeggioArrowDown = {
24 \revert Arpeggio #'stencil
25 \revert Arpeggio #'X-extent
26 \override Arpeggio #'arpeggio-direction = #DOWN
28 arpeggioNormal = {
29 \revert Arpeggio #'stencil
30 \revert Arpeggio #'X-extent
31 \revert Arpeggio #'arpeggio-direction
32 \revert Arpeggio #'dash-definition
34 arpeggioBracket = {
35 \revert Arpeggio #'X-extent
36 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket
38 arpeggioParenthesis = {
39 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
40 \override Arpeggio #'X-extent = #ly:grob::stencil-width
41 \revert Arpeggio #'dash-definition
43 arpeggioParenthesisDashed = {
44 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
45 \override Arpeggio #'X-extent = #ly:grob::stencil-width
46 \override Arpeggio #'dash-definition = #'((0 1 0.4 0.75))
50 %% auto beaming
52 autoBeamOn = \set autoBeaming = ##t
53 autoBeamOff = \set autoBeaming = ##f
56 %% balloon length
58 balloonLengthOn = {
59 \override BalloonTextItem #'extra-spacing-width = #'(0 . 0)
60 \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0)
62 balloonLengthOff = {
63 \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0)
64 \override BalloonTextItem #'extra-spacing-height = #'(0 . 0)
68 %% bass figures
70 bassFigureExtendersOn = {
71 \set useBassFigureExtenders = ##t
72 \set Staff.useBassFigureExtenders = ##t
74 bassFigureExtendersOff = {
75 \set useBassFigureExtenders = ##f
76 \set Staff.useBassFigureExtenders = ##f
78 bassFigureStaffAlignmentDown =
79 \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
80 bassFigureStaffAlignmentUp =
81 \override Staff.BassFigureAlignmentPositioning #'direction = #UP
82 bassFigureStaffAlignmentNeutral =
83 \revert Staff.BassFigureAlignmentPositioning #'direction
86 %% cadenzas
88 cadenzaOn = \set Timing.timing = ##f
89 cadenzaOff = {
90 \set Timing.timing = ##t
91 \set Timing.measurePosition = #ZERO-MOMENT
95 %% chord names
97 frenchChords = {
98 \set chordRootNamer = #(chord-name->italian-markup #t)
99 \set chordPrefixSpacer = #0.4
101 germanChords = {
102 \set chordRootNamer = #(chord-name->german-markup #t)
103 \set chordNoteNamer = #note-name->german-markup
105 semiGermanChords = {
106 \set chordRootNamer = #(chord-name->german-markup #f)
107 \set chordNoteNamer = #note-name->german-markup
109 italianChords = {
110 \set chordRootNamer = #(chord-name->italian-markup #f)
111 \set chordPrefixSpacer = #0.4
115 %% compressFullBarRests
117 compressFullBarRests = \set Score.skipBars = ##t
118 expandFullBarRests = \set Score.skipBars = ##f
121 %% dots
123 dotsUp = \override Dots #'direction = #UP
124 dotsDown = \override Dots #'direction = #DOWN
125 dotsNeutral = \revert Dots #'direction
128 %% dynamics
130 dynamicUp = {
131 \override DynamicText #'direction = #UP
132 \override DynamicLineSpanner #'direction = #UP
134 dynamicDown = {
135 \override DynamicText #'direction = #DOWN
136 \override DynamicLineSpanner #'direction = #DOWN
138 dynamicNeutral = {
139 \revert DynamicText #'direction
140 \revert DynamicLineSpanner #'direction
144 %% easy heads
146 easyHeadsOn = {
147 \override NoteHead #'stencil = #note-head::brew-ez-stencil
148 \override NoteHead #'font-size = #-8
149 \override NoteHead #'font-family = #'sans
150 \override NoteHead #'font-series = #'bold
152 easyHeadsOff = {
153 \revert NoteHead #'stencil
154 \revert NoteHead #'font-size
155 \revert NoteHead #'font-family
156 \revert NoteHead #'font-series
160 %% endincipit
162 %% End the incipit and print a ``normal line start''.
163 endincipit = \context Staff {
164 \partial 16 s16 % Hack to handle e.g. \bar ".|" \endincipit
165 \once \override Staff.Clef #'full-size-change = ##t
166 \once \override Staff.Clef #'non-default = ##t
167 \bar ""
171 %% fermata markup
173 fermataMarkup =
174 #(make-music 'MultiMeasureTextEvent
175 'tweaks (list
176 ; Set the 'text based on the 'direction
177 (cons 'text (lambda (grob)
178 (if (eq? (ly:grob-property grob 'direction) DOWN)
179 (markup #:musicglyph "scripts.dfermata")
180 (markup #:musicglyph "scripts.ufermata"))))
181 (cons 'outside-staff-priority 40)))
184 %% font sizes
186 teeny = \set fontSize = #-3
187 tiny = \set fontSize = #-2
188 small = \set fontSize = #-1
189 normalsize = \set fontSize = #0
190 large = \set fontSize = #1
191 huge = \set fontSize = #2
194 %% glissando
196 glissando = #(make-music 'GlissandoEvent)
199 %% harmonics
201 harmonicsOn = \override NoteHead #'style = #'harmonic
202 harmonicsOff = \revert NoteHead #'style
205 %% hideNotes
207 hideNotes = {
208 % hide notes, accidentals, etc.
209 \override Dots #'transparent = ##t
210 \override NoteHead #'transparent = ##t
211 \override NoteHead #'no-ledgers = ##t
212 \override Stem #'transparent = ##t
213 \override Beam #'transparent = ##t
214 \override Accidental #'transparent = ##t
216 unHideNotes = {
217 \revert Accidental #'transparent
218 \revert Beam #'transparent
219 \revert Stem #'transparent
220 \revert NoteHead #'transparent
221 \revert NoteHead #'no-ledgers
222 \revert Dots #'transparent
226 %% improvisation
228 improvisationOn = {
229 \set squashedPosition = #0
230 \override NoteHead #'style = #'slash
231 \override Accidental #'stencil = ##f
233 improvisationOff = {
234 \unset squashedPosition
235 \revert NoteHead #'style
236 \revert Accidental #'stencil
240 %% merging
242 mergeDifferentlyDottedOn =
243 \override Staff.NoteCollision #'merge-differently-dotted = ##t
244 mergeDifferentlyDottedOff =
245 \revert Staff.NoteCollision #'merge-differently-dotted
246 mergeDifferentlyHeadedOn =
247 \override Staff.NoteCollision #'merge-differently-headed = ##t
248 mergeDifferentlyHeadedOff =
249 \revert Staff.NoteCollision #'merge-differently-headed
252 %% numeric time signature
254 numericTimeSignature = \override Staff.TimeSignature #'style = #'numbered
255 defaultTimeSignature = \revert Staff.TimeSignature #'style
258 %% palm mutes
260 palmMuteOn =
261 #(define-music-function (parser location) ()
262 (override-head-style 'NoteHead 'do))
263 palmMuteOff =
264 #(define-music-function (parser location) ()
265 (revert-head-style 'NoteHead))
266 palmMute =
267 #(define-music-function (parser location note) (ly:music?)
268 (style-note-heads 'NoteHead 'do note))
271 %% phrasing slurs
273 % directions
274 phrasingSlurUp = \override PhrasingSlur #'direction = #UP
275 phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN
276 phrasingSlurNeutral = \revert PhrasingSlur #'direction
278 % dash-patterns (make-simple-dash-definition defined at top of file)
279 phrasingSlurDashPattern =
280 #(define-music-function (parser location dash-fraction dash-period)
281 (number? number?)
282 (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
283 line to space repeated at @var{dash-period} interval.")
285 \override PhrasingSlur #'dash-definition =
286 $(make-simple-dash-definition dash-fraction dash-period)
288 phrasingSlurDashed =
289 \override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75))
290 phrasingSlurDotted =
291 \override PhrasingSlur #'dash-definition = #'((0 1 0.1 0.75))
292 phrasingSlurHalfDashed =
293 \override PhrasingSlur #'dash-definition = #'((0 0.5 0.4 0.75)
294 (0.5 1 1 1))
295 phrasingSlurHalfSolid =
296 \override PhrasingSlur #'dash-definition = #'((0 0.5 1 1)
297 (0.5 1 0.4 0.75))
298 phrasingSlurSolid =
299 \revert PhrasingSlur #'dash-definition
302 %% point and click
304 pointAndClickOn =
305 #(define-music-function (parser location) ()
306 (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
307 originating lilypond source statement;
308 this is helpful when developing a score but generates bigger final-format files.")
309 (ly:set-option 'point-and-click #t)
310 (make-music 'SequentialMusic 'void #t))
312 pointAndClickOff =
313 #(define-music-function (parser location) ()
314 (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
315 back to the lilypond source statement.")
316 (ly:set-option 'point-and-click #f)
317 (make-music 'SequentialMusic 'void #t))
320 %% predefined fretboards
322 predefinedFretboardsOff =
323 \set FretBoards.predefinedDiagramTable = ##f
324 predefinedFretboardsOn =
325 \set FretBoards.predefinedDiagramTable = #fretboard-table
328 %% shape note heads
330 aikenHeads = \set shapeNoteStyles = #'#(do re mi fa #f la ti)
331 sacredHarpHeads = \set shapeNoteStyles = #'#(fa #f la fa #f la mi)
334 %% shifts
336 shiftOn = \override NoteColumn #'horizontal-shift = #1
337 shiftOnn = \override NoteColumn #'horizontal-shift = #2
338 shiftOnnn = \override NoteColumn #'horizontal-shift = #3
339 shiftOff = \revert NoteColumn #'horizontal-shift
342 %% slurs
344 % directions
345 slurUp = \override Slur #'direction = #UP
346 slurDown = \override Slur #'direction = #DOWN
347 slurNeutral = \revert Slur #'direction
349 % dash-patterns (make-simple-dash-definition defined at top of file)
350 slurDashPattern =
351 #(define-music-function (parser location dash-fraction dash-period)
352 (number? number?)
354 \override Slur #'dash-definition =
355 $(make-simple-dash-definition dash-fraction dash-period)
357 slurDashed = \override Slur #'dash-definition = #'((0 1 0.4 0.75))
358 slurDotted = \override Slur #'dash-definition = #'((0 1 0.1 0.75))
359 slurHalfDashed = \override Slur #'dash-definition = #'((0 0.5 0.4 0.75)
360 (0.5 1 1 1))
361 slurHalfSolid = \override Slur #'dash-definition = #'((0 0.5 1 1)
362 (0.5 1 0.4 0.75))
363 slurSolid = \revert Slur #'dash-definition
366 %% staff switches
368 showStaffSwitch = \set followVoice = ##t
369 hideStaffSwitch = \set followVoice = ##f
372 %% stems
374 stemUp = \override Stem #'direction = #UP
375 stemDown = \override Stem #'direction = #DOWN
376 stemNeutral = \revert Stem #'direction
379 %% tablature
381 % switch to full notation
382 tabFullNotation = {
383 % time signature
384 \revert TabStaff.TimeSignature #'stencil
385 % stems (the half note gets a double stem)
386 \revert TabVoice.Stem #'length
387 \revert TabVoice.Stem #'no-stem-extend
388 \revert TabVoice.Stem #'flag-style
389 \revert TabVoice.Stem #'details
390 \revert TabVoice.Stem #'transparent
391 \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
392 \set autoBeaming = ##t
393 \revert NoteColumn #'ignore-collision
394 % beams, dots
395 \revert TabVoice.Beam #'stencil
396 \revert TabVoice.Dots #'stencil
397 \revert TabVoice.Tie #'stencil
398 \revert TabVoice.Tie #'after-line-breaking
399 \revert TabVoice.RepeatTie #'stencil
400 \revert TabVoice.RepeatTie #'after-line-breaking
401 \revert TabVoice.LaissezVibrerTie #'stencil
402 \revert TabVoice.Slur #'stencil
403 \revert TabVoice.PhrasingSlur #'stencil
404 % tuplet stuff
405 \revert TabVoice.TupletBracket #'stencil
406 \revert TabVoice.TupletNumber #'stencil
407 % dynamic signs
408 \revert TabVoice.DynamicText #'transparent
409 \revert TabVoice.DynamicTextSpanner #'stencil
410 \revert TabVoice.DynamicTextSpanner #'stencil
411 \revert TabVoice.Hairpin #'transparent
412 % rests
413 \revert TabVoice.Rest #'stencil
414 \revert TabVoice.MultiMeasureRest #'stencil
415 \revert TabVoice.MultiMeasureRestNumber #'transparent
416 % markups etc.
417 \revert TabVoice.Script #'stencil
418 \revert TabVoice.TextScript #'stencil
419 \revert TabStaff.Arpeggio #'stencil
420 \revert TabStaff.NoteColumn #'ignore-collision
423 %tie/repeat tie behaviour
424 hideSplitTiedTabNotes = {
425 \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #all-invisible
426 \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##f
427 \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##f
428 \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##f
431 showSplitTiedTabNotes = {
432 \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #begin-of-line-visible
433 \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##t
434 \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##t
435 \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##t
438 %% text length
440 textLengthOn = {
441 \override TextScript #'extra-spacing-width = #'(0 . 0)
442 \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
444 textLengthOff = {
445 \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
446 \override TextScript #'extra-spacing-height = #'(0 . 0)
450 %% text spanners
452 textSpannerUp = \override TextSpanner #'direction = #UP
453 textSpannerDown = \override TextSpanner #'direction = #DOWN
454 textSpannerNeutral = \revert TextSpanner #'direction
457 %% ties
459 % directions
460 tieUp = \override Tie #'direction = #UP
461 tieDown = \override Tie #'direction = #DOWN
462 tieNeutral = \revert Tie #'direction
464 % dash-patterns (make-simple-dash-definition defined at top of file)
465 tieDashPattern =
466 #(define-music-function (parser location dash-fraction dash-period)
467 (number? number?)
469 \override Tie #'dash-definition =
470 $(make-simple-dash-definition dash-fraction dash-period)
472 tieDashed = \override Tie #'dash-definition = #'((0 1 0.4 0.75))
473 tieDotted = \override Tie #'dash-definition = #'((0 1 0.1 0.75))
474 tieHalfDashed = \override Tie #'dash-definition = #'((0 0.5 0.4 0.75)
475 (0.5 1 1 1))
476 tieHalfSolid = \override Tie #'dash-definition = #'((0 0.5 1 1)
477 (0.5 1 0.4 0.75))
478 tieSolid = \revert Tie #'dash-definition
481 %% tuplets
483 tupletUp = \override TupletBracket #'direction = #UP
484 tupletDown = \override TupletBracket #'direction = #DOWN
485 tupletNeutral = \revert TupletBracket #'direction
488 %% voice properties
490 % dynamic ly:dir? text script, articulation script ly:dir?
491 voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
492 voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
493 voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice)
494 voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
495 oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
498 %% voice styles
500 voiceOneStyle = {
501 \override NoteHead #'style = #'diamond
502 \override NoteHead #'color = #red
503 \override Stem #'color = #red
504 \override Beam #'color = #red
506 voiceTwoStyle = {
507 \override NoteHead #'style = #'triangle
508 \override NoteHead #'color = #blue
509 \override Stem #'color = #blue
510 \override Beam #'color = #blue
512 voiceThreeStyle = {
513 \override NoteHead #'style = #'xcircle
514 \override NoteHead #'color = #green
515 \override Stem #'color = #green
516 \override Beam #'color = #green
518 voiceFourStyle = {
519 \override NoteHead #'style = #'cross
520 \override NoteHead #'color = #magenta
521 \override Stem #'color = #magenta
522 \override Beam #'color = #magenta
524 voiceNeutralStyle = {
525 \revert NoteHead #'style
526 \revert NoteHead #'color
527 \revert Stem #'color
528 \revert Beam #'color
532 %% x notes
534 xNotesOn =
535 #(define-music-function (parser location) ()
536 (override-head-style '(TabNoteHead NoteHead) 'cross))
537 xNotesOff =
538 #(define-music-function (parser location) ()
539 (revert-head-style '(TabNoteHead NoteHead)))
540 xNote =
541 #(define-music-function (parser location note) (ly:music?)
542 (style-note-heads '(TabNoteHead NoteHead) 'cross note))
545 %% dead notes (these need to come after "x notes")
547 % Define aliases of cross-head notes for specific purposes
548 deadNotesOn = \xNotesOn
549 deadNotesOff = \xNotesOff
550 deadNote = #xNote