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)))
9 %% common definition for all note head styles reverting
10 %% (palm mute, harmonics, dead notes, ...)
12 #(define-music-function (parser location) ()
13 (_i "Revert to the default note head style.")
14 (revert-head-style '(NoteHead TabNoteHead)))
16 #(define (context-name? c)
17 "A stopgap measure until dotted lists become available as arguments.
18 Distinguish context names from accidental styles by virtue of their
19 first letter being uppercase."
21 (char-upper-case? (string-ref (symbol->string c) 0))))
24 #(define-music-function
25 (parser location context style) ((context-name?) string?)
26 (_i "Set accidental style to @var{style}, a string. If an optional
27 @var{context} symbol is given, e.g. @code{#'Staff} or @code{#'Voice},
28 the settings are applied to that context. Otherwise, the context
29 defaults to @samp{Staff}, except for piano styles, which use
30 @samp{GrandStaff} as a context." )
32 (set-accidental-style (string->symbol style) context)
33 (set-accidental-style (string->symbol style))))
37 % For drawing vertical chord brackets with \arpeggio
38 % This is a shorthand for the value of the print-function property
39 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
40 % cross-staff brackets are desired.
42 arpeggio = #(make-music 'ArpeggioEvent)
44 \revert Arpeggio #'stencil
45 \revert Arpeggio #'X-extent
46 \override Arpeggio #'arpeggio-direction = #UP
49 \revert Arpeggio #'stencil
50 \revert Arpeggio #'X-extent
51 \override Arpeggio #'arpeggio-direction = #DOWN
54 \revert Arpeggio #'stencil
55 \revert Arpeggio #'X-extent
56 \revert Arpeggio #'arpeggio-direction
57 \revert Arpeggio #'dash-definition
60 \revert Arpeggio #'X-extent
61 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket
63 arpeggioParenthesis = {
64 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
65 \override Arpeggio #'X-extent = #ly:grob::stencil-width
66 \revert Arpeggio #'dash-definition
68 arpeggioParenthesisDashed = {
69 \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
70 \override Arpeggio #'X-extent = #ly:grob::stencil-width
71 \override Arpeggio #'dash-definition = #'((0 1 0.4 0.75))
77 autoBeamOn = \set autoBeaming = ##t
78 autoBeamOff = \set autoBeaming = ##f
84 \override BalloonTextItem #'extra-spacing-width = #'(0 . 0)
85 \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0)
88 \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0)
89 \override BalloonTextItem #'extra-spacing-height = #'(0 . 0)
96 #(define-void-function
97 (parser location bar glyph-list) (string? list?)
98 (_i "Define bar line settings for bar line @var{bar}.
99 The list @var{glyph-list} must have three entries which define
100 the appearance at the end of line, at the beginning of the next line,
101 and the span bar, respectively." )
102 (if (not (= (length glyph-list) 3))
103 (ly:error (_ "Argument list for bar '~a' must have three components.") bar)
107 (caddr glyph-list))))
112 bassFigureExtendersOn = {
113 \set useBassFigureExtenders = ##t
114 \set Staff.useBassFigureExtenders = ##t
116 bassFigureExtendersOff = {
117 \set useBassFigureExtenders = ##f
118 \set Staff.useBassFigureExtenders = ##f
120 bassFigureStaffAlignmentDown =
121 \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
122 bassFigureStaffAlignmentUp =
123 \override Staff.BassFigureAlignmentPositioning #'direction = #UP
124 bassFigureStaffAlignmentNeutral =
125 \revert Staff.BassFigureAlignmentPositioning #'direction
131 \set Timing.timing = ##f
132 \set Timing.autoBeaming = ##f
136 \set Timing.timing = ##t
137 \set Timing.measurePosition = #ZERO-MOMENT
138 \set Timing.autoBeaming = ##t
145 \set chordRootNamer = #(chord-name->italian-markup #t)
146 \set chordPrefixSpacer = #0.4
149 \set chordRootNamer = #(chord-name->german-markup #t)
150 \set chordNoteNamer = #note-name->german-markup
153 \set chordRootNamer = #(chord-name->german-markup #f)
154 \set chordNoteNamer = #note-name->german-markup
157 \set chordRootNamer = #(chord-name->italian-markup #f)
158 \set chordPrefixSpacer = #0.4
161 \set chordNameExceptions = #powerChordExceptions
165 %% compressFullBarRests
167 compressFullBarRests = \set Score.skipBars = ##t
168 expandFullBarRests = \set Score.skipBars = ##f
173 dotsUp = \override Dots #'direction = #UP
174 dotsDown = \override Dots #'direction = #DOWN
175 dotsNeutral = \revert Dots #'direction
181 \override DynamicText #'direction = #UP
182 \override DynamicLineSpanner #'direction = #UP
185 \override DynamicText #'direction = #DOWN
186 \override DynamicLineSpanner #'direction = #DOWN
189 \revert DynamicText #'direction
190 \revert DynamicLineSpanner #'direction
197 \override NoteHead #'stencil = #note-head::brew-ez-stencil
198 \override NoteHead #'font-size = #-8
199 \override NoteHead #'font-family = #'sans
200 \override NoteHead #'font-series = #'bold
203 \revert NoteHead #'stencil
204 \revert NoteHead #'font-size
205 \revert NoteHead #'font-family
206 \revert NoteHead #'font-series
212 %% End the incipit and print a ``normal line start''.
213 endincipit = \context Staff {
214 \partial 16 s16 % Hack to handle e.g. \bar ".|" \endincipit
215 \once \override Staff.Clef #'full-size-change = ##t
216 \once \override Staff.Clef #'non-default = ##t
224 #(make-music 'MultiMeasureTextEvent
226 ;; Set the 'text based on the 'direction
227 (cons 'text (lambda (grob)
228 (if (eq? (ly:grob-property grob 'direction) DOWN)
229 (markup #:musicglyph "scripts.dfermata")
230 (markup #:musicglyph "scripts.ufermata"))))
231 (cons 'outside-staff-priority 40)
232 (cons 'outside-staff-padding 0)))
236 teeny = \set fontSize = #-3
237 tiny = \set fontSize = #-2
238 small = \set fontSize = #-1
239 normalsize = \set fontSize = #0
240 large = \set fontSize = #1
241 huge = \set fontSize = #2
246 glissando = #(make-music 'GlissandoEvent)
252 #(define-music-function (parser location) ()
253 (_i "Set the default note head style to a diamond-shaped style.")
254 (override-head-style '(NoteHead TabNoteHead) 'harmonic))
255 harmonicsOff = \defaultNoteHeads
257 #(define-music-function (parser location note) (ly:music?)
258 (_i "Print @var{note} with a diamond-shaped note head.")
259 (style-note-heads 'NoteHead 'harmonic note))
265 % hide notes, accidentals, etc.
266 \override Dots #'transparent = ##t
267 \override NoteHead #'transparent = ##t
268 \override NoteHead #'no-ledgers = ##t
269 \override Stem #'transparent = ##t
270 \override Flag #'transparent = ##t
271 \override Beam #'transparent = ##t
272 \override Accidental #'transparent = ##t
273 \override Rest #'transparent = ##t
274 \override TabNoteHead #'transparent = ##t
277 \revert Accidental #'transparent
278 \revert Beam #'transparent
279 \revert Stem #'transparent
280 \revert Flag #'transparent
281 \revert NoteHead #'transparent
282 \revert NoteHead #'no-ledgers
283 \revert Dots #'transparent
284 \revert Rest #'transparent
285 \revert TabNoteHead #'transparent
292 \set squashedPosition = #0
293 \override NoteHead #'style = #'slash
294 \override Accidental #'stencil = ##f
295 \override AccidentalCautionary #'stencil = ##f
298 \unset squashedPosition
299 \revert NoteHead #'style
300 \revert Accidental #'stencil
301 \revert AccidentalCautionary #'stencil
307 mergeDifferentlyDottedOn =
308 \override Staff.NoteCollision #'merge-differently-dotted = ##t
309 mergeDifferentlyDottedOff =
310 \revert Staff.NoteCollision #'merge-differently-dotted
311 mergeDifferentlyHeadedOn =
312 \override Staff.NoteCollision #'merge-differently-headed = ##t
313 mergeDifferentlyHeadedOff =
314 \revert Staff.NoteCollision #'merge-differently-headed
317 %% numeric time signature
319 numericTimeSignature = \override Staff.TimeSignature #'style = #'numbered
320 defaultTimeSignature = \revert Staff.TimeSignature #'style
326 #(define-music-function (parser location) ()
327 (_i "Set the default note head style to a triangle-shaped style.")
328 (override-head-style 'NoteHead 'do))
329 palmMuteOff = \defaultNoteHeads
331 #(define-music-function (parser location note) (ly:music?)
332 (_i "Print @var{note} with a triangle-shaped note head.")
333 (style-note-heads 'NoteHead 'do note))
339 phrasingSlurUp = \override PhrasingSlur #'direction = #UP
340 phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN
341 phrasingSlurNeutral = \revert PhrasingSlur #'direction
343 % dash-patterns (make-simple-dash-definition defined at top of file)
344 phrasingSlurDashPattern =
345 #(define-music-function (parser location dash-fraction dash-period)
347 (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
348 line to space repeated at @var{dash-period} interval for phrasing slurs.")
350 \override PhrasingSlur #'dash-definition =
351 $(make-simple-dash-definition dash-fraction dash-period)
354 \override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75))
356 \override PhrasingSlur #'dash-definition = #'((0 1 0.1 0.75))
357 phrasingSlurHalfDashed =
358 \override PhrasingSlur #'dash-definition = #'((0 0.5 0.4 0.75)
360 phrasingSlurHalfSolid =
361 \override PhrasingSlur #'dash-definition = #'((0 0.5 1 1)
364 \revert PhrasingSlur #'dash-definition
370 #(define-music-function (parser location) ()
371 (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
372 originating lilypond source statement;
373 this is helpful when developing a score but generates bigger final-format files.")
374 (ly:set-option 'point-and-click #t)
375 (make-music 'SequentialMusic 'void #t))
378 #(define-music-function (parser location) ()
379 (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
380 back to the lilypond source statement.")
381 (ly:set-option 'point-and-click #f)
382 (make-music 'SequentialMusic 'void #t))
385 #(define-void-function (parser location types) (list-or-symbol?)
386 (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
387 (ly:set-option 'point-and-click types))
389 %% predefined fretboards
391 predefinedFretboardsOff =
392 \set predefinedDiagramTable = ##f
393 predefinedFretboardsOn =
394 \set predefinedDiagramTable = #default-fret-table
399 aikenHeads = \set shapeNoteStyles = #'#(do re miMirror fa sol la ti)
400 aikenHeadsMinor = \set shapeNoteStyles = #'#(la ti do re miMirror fa sol)
402 \set shapeNoteStyles = #'#(doFunk reFunk miFunk faFunk solFunk laFunk tiFunk)
404 \set shapeNoteStyles = #'#(laFunk tiFunk doFunk reFunk miFunk faFunk solFunk)
405 sacredHarpHeads = \set shapeNoteStyles = #'#(fa sol la fa sol la mi)
406 sacredHarpHeadsMinor = \set shapeNoteStyles = #'#(la mi fa sol la fa sol)
407 southernHarmonyHeads =
408 \set shapeNoteStyles = #'#(faThin sol laThin faThin sol laThin miThin)
409 southernHarmonyHeadsMinor =
410 \set shapeNoteStyles = #'#(laThin miThin faThin sol laThin faThin sol)
412 \set shapeNoteStyles = #'#(doWalker reWalker miWalker faWalker solFunk laWalker tiWalker)
414 \set shapeNoteStyles = #'#(laWalker tiWalker doWalker reWalker miWalker faWalker solFunk)
419 shiftOn = \override NoteColumn #'horizontal-shift = #1
420 shiftOnn = \override NoteColumn #'horizontal-shift = #2
421 shiftOnnn = \override NoteColumn #'horizontal-shift = #3
422 shiftOff = \revert NoteColumn #'horizontal-shift
428 slurUp = \override Slur #'direction = #UP
429 slurDown = \override Slur #'direction = #DOWN
430 slurNeutral = \revert Slur #'direction
432 % dash-patterns (make-simple-dash-definition defined at top of file)
434 #(define-music-function (parser location dash-fraction dash-period)
436 (_i "Set up a custom style of dash pattern for @var{dash-fraction}
437 ratio of line to space repeated at @var{dash-period} interval for slurs.")
439 \override Slur #'dash-definition =
440 $(make-simple-dash-definition dash-fraction dash-period)
442 slurDashed = \override Slur #'dash-definition = #'((0 1 0.4 0.75))
443 slurDotted = \override Slur #'dash-definition = #'((0 1 0.1 0.75))
444 slurHalfDashed = \override Slur #'dash-definition = #'((0 0.5 0.4 0.75)
446 slurHalfSolid = \override Slur #'dash-definition = #'((0 0.5 1 1)
448 slurSolid = \revert Slur #'dash-definition
453 showStaffSwitch = \set followVoice = ##t
454 hideStaffSwitch = \set followVoice = ##f
459 stemUp = \override Stem #'direction = #UP
460 stemDown = \override Stem #'direction = #DOWN
461 stemNeutral = \revert Stem #'direction
466 % switch to full notation
469 \revert TabStaff.TimeSignature #'stencil
470 % stems (the half note gets a double stem)
471 \revert TabVoice.Stem #'length
472 \revert TabVoice.Stem #'no-stem-extend
473 \revert TabVoice.Flag #'style
474 \revert TabVoice.Stem #'details
475 \revert TabVoice.Stem #'stencil
476 \revert TabVoice.Flag #'stencil
477 \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
478 \override TabVoice.Stem #'X-extent = #tabvoice::make-double-stem-width-for-half-notes
479 \set TabVoice.autoBeaming = ##t
480 \revert TabVoice.NoteColumn #'ignore-collision
482 \revert TabVoice.Beam #'stencil
483 \revert TabVoice.StemTremolo #'stencil
484 \revert TabVoice.Dots #'stencil
485 \revert TabVoice.Tie #'stencil
486 \revert TabVoice.Tie #'after-line-breaking
487 \revert TabVoice.RepeatTie #'stencil
488 \revert TabVoice.RepeatTie #'after-line-breaking
489 \revert TabVoice.LaissezVibrerTie #'stencil
490 \revert TabVoice.Slur #'stencil
491 \revert TabVoice.PhrasingSlur #'stencil
493 \revert TabVoice.TupletBracket #'stencil
494 \revert TabVoice.TupletNumber #'stencil
496 \revert TabVoice.DynamicText #'stencil
497 \revert TabVoice.DynamicTextSpanner #'stencil
498 \revert TabVoice.DynamicTextSpanner #'stencil
499 \revert TabVoice.Hairpin #'stencil
501 \revert TabVoice.Rest #'stencil
502 \revert TabVoice.MultiMeasureRest #'stencil
503 \revert TabVoice.MultiMeasureRestNumber #'stencil
504 \revert TabVoice.MultiMeasureRestText #'stencil
506 \revert TabVoice.Glissando #'stencil
507 \revert TabVoice.Script #'stencil
508 \revert TabVoice.TextScript #'stencil
509 \revert TabVoice.TextSpanner #'stencil
510 \revert TabStaff.Arpeggio #'stencil
511 \revert TabStaff.NoteColumn #'ignore-collision
514 %tie/repeat tie behaviour
515 hideSplitTiedTabNotes = {
516 \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #all-invisible
517 \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##f
518 \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##f
519 \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##f
522 showSplitTiedTabNotes = {
523 \override TabVoice.TabNoteHead #'(details tied-properties break-visibility) = #begin-of-line-visible
524 \override TabVoice.TabNoteHead #'(details tied-properties parenthesize) = ##t
525 \override TabVoice.TabNoteHead #'(details repeat-tied-properties note-head-visible) = ##t
526 \override TabVoice.TabNoteHead #'(details repeat-tied-properties parenthesize) = ##t
532 \override TextScript #'extra-spacing-width = #'(0 . 0)
533 \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
536 \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
537 \override TextScript #'extra-spacing-height = #'(0 . 0)
543 textSpannerUp = \override TextSpanner #'direction = #UP
544 textSpannerDown = \override TextSpanner #'direction = #DOWN
545 textSpannerNeutral = \revert TextSpanner #'direction
551 tieUp = \override Tie #'direction = #UP
552 tieDown = \override Tie #'direction = #DOWN
553 tieNeutral = \revert Tie #'direction
555 % dash-patterns (make-simple-dash-definition defined at top of file)
557 #(define-music-function (parser location dash-fraction dash-period)
559 (_i "Set up a custom style of dash pattern for @var{dash-fraction}
560 ratio of line to space repeated at @var{dash-period} interval for ties.")
562 \override Tie #'dash-definition =
563 $(make-simple-dash-definition dash-fraction dash-period)
565 tieDashed = \override Tie #'dash-definition = #'((0 1 0.4 0.75))
566 tieDotted = \override Tie #'dash-definition = #'((0 1 0.1 0.75))
567 tieHalfDashed = \override Tie #'dash-definition = #'((0 0.5 0.4 0.75)
569 tieHalfSolid = \override Tie #'dash-definition = #'((0 0.5 1 1)
571 tieSolid = \revert Tie #'dash-definition
576 tupletUp = \override TupletBracket #'direction = #UP
577 tupletDown = \override TupletBracket #'direction = #DOWN
578 tupletNeutral = \revert TupletBracket #'direction
583 % dynamic ly:dir? text script, articulation script ly:dir?
584 voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
585 voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
586 voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice)
587 voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
588 oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
594 \override NoteHead #'style = #'diamond
595 \override NoteHead #'color = #red
596 \override Stem #'color = #red
597 \override Flag #'color = #red
598 \override Beam #'color = #red
601 \override NoteHead #'style = #'triangle
602 \override NoteHead #'color = #blue
603 \override Stem #'color = #blue
604 \override Flag #'color = #blue
605 \override Beam #'color = #blue
608 \override NoteHead #'style = #'xcircle
609 \override NoteHead #'color = #green
610 \override Stem #'color = #green
611 \override Flag #'color = #green
612 \override Beam #'color = #green
615 \override NoteHead #'style = #'cross
616 \override NoteHead #'color = #magenta
617 \override Stem #'color = #magenta
618 \override Flag #'color = #magenta
619 \override Beam #'color = #magenta
621 voiceNeutralStyle = {
622 \revert NoteHead #'style
623 \revert NoteHead #'color
633 #(define-void-function (parser location bar) (string?)
634 (allow-volta-hook bar))
639 #(define-music-function (parser location) ()
640 (_i "Set the default note head style to a cross-shaped style.")
641 (override-head-style '(TabNoteHead NoteHead) 'cross))
642 xNotesOff = \defaultNoteHeads
644 #(define-music-function (parser location note) (ly:music?)
645 (_i "Print @var{note} with a cross-shaped note head.")
646 (style-note-heads '(TabNoteHead NoteHead) 'cross note))
649 %% dead notes (these need to come after "x notes")
651 % Define aliases of cross-head notes for specific purposes
652 deadNotesOn = \xNotesOn
653 deadNotesOff = \xNotesOff