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 \revert NoteHead.style
13 \revert TabNoteHead.style
17 #(define-music-function
18 (style) (symbol-list?)
19 (_i "Set accidental style to symbol list @var{style} in the form
20 @samp{piano-cautionary}. If @var{style} has a form like
21 @samp{Staff.piano-cautionary}, the settings are applied to that
22 context. Otherwise, the context defaults to @samp{Staff}, except for
23 piano styles, which use @samp{GrandStaff} as a context." )
25 ((1) (set-accidental-style (car style)))
26 ((2) (set-accidental-style (cadr style) (car style)))
28 (ly:parser-error (_ "not an accidental style")
30 (make-music 'Music))))
34 % For drawing vertical chord brackets with \arpeggio
35 % This is a shorthand for the value of the print-function property
36 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
37 % cross-staff brackets are desired.
39 arpeggio = #(make-music 'ArpeggioEvent)
41 \revert Arpeggio.stencil
42 \revert Arpeggio.X-extent
43 \override Arpeggio.arpeggio-direction = #UP
46 \revert Arpeggio.stencil
47 \revert Arpeggio.X-extent
48 \override Arpeggio.arpeggio-direction = #DOWN
51 \revert Arpeggio.stencil
52 \revert Arpeggio.X-extent
53 \revert Arpeggio.arpeggio-direction
54 \revert Arpeggio.dash-definition
57 \revert Arpeggio.X-extent
58 \override Arpeggio.stencil = #ly:arpeggio::brew-chord-bracket
60 arpeggioParenthesis = {
61 \override Arpeggio.stencil = #ly:arpeggio::brew-chord-slur
62 \override Arpeggio.X-extent = #ly:grob::stencil-width
63 \revert Arpeggio.dash-definition
65 arpeggioParenthesisDashed = {
66 \override Arpeggio.stencil = #ly:arpeggio::brew-chord-slur
67 \override Arpeggio.X-extent = #ly:grob::stencil-width
68 \override Arpeggio.dash-definition = #'((0 1 0.4 0.75))
74 autoBeamOn = \set autoBeaming = ##t
75 autoBeamOff = \set autoBeaming = ##f
81 \override BalloonTextItem.extra-spacing-width = #'(0 . 0)
82 \override BalloonTextItem.extra-spacing-height = #'(-inf.0 . +inf.0)
85 \override BalloonTextItem.extra-spacing-width = #'(+inf.0 . -inf.0)
86 \override BalloonTextItem.extra-spacing-height = #'(0 . 0)
93 #(define-void-function
94 (bar glyph-list) (string? list?)
95 (_i "Define bar line settings for bar line @var{bar}.
96 The list @var{glyph-list} must have three entries which define
97 the appearance at the end of line, at the beginning of the next line,
98 and the span bar, respectively." )
99 (if (not (= (length glyph-list) 3))
100 (ly:error (_ "Argument list for bar '~a' must have three components.") bar)
104 (caddr glyph-list))))
109 bassFigureExtendersOn = {
110 \set useBassFigureExtenders = ##t
111 \set Staff.useBassFigureExtenders = ##t
113 bassFigureExtendersOff = {
114 \set useBassFigureExtenders = ##f
115 \set Staff.useBassFigureExtenders = ##f
117 bassFigureStaffAlignmentDown =
118 \override Staff.BassFigureAlignmentPositioning.direction = #DOWN
119 bassFigureStaffAlignmentUp =
120 \override Staff.BassFigureAlignmentPositioning.direction = #UP
121 bassFigureStaffAlignmentNeutral =
122 \revert Staff.BassFigureAlignmentPositioning.direction
127 cadenzaOn = \set Timing.timing = ##f
129 cadenzaOff = \set Timing.timing = ##t
134 \set chordRootNamer = #(chord-name->italian-markup #t)
135 \set chordPrefixSpacer = #0.4
138 \set chordRootNamer = #(chord-name->german-markup #t)
139 \set chordNoteNamer = #note-name->german-markup
142 \set chordRootNamer = #(chord-name->german-markup #f)
143 \set chordNoteNamer = #note-name->german-markup
146 \set chordRootNamer = #(chord-name->italian-markup #f)
147 \set chordPrefixSpacer = #0.4
150 \set chordNameExceptions = #powerChordExceptions
154 %% compressFullBarRests
156 compressFullBarRests = \set Score.skipBars = ##t
157 expandFullBarRests = \set Score.skipBars = ##f
162 dotsUp = \override Dots.direction = #UP
163 dotsDown = \override Dots.direction = #DOWN
164 dotsNeutral = \revert Dots.direction
170 \override DynamicText.direction = #UP
171 \override DynamicLineSpanner.direction = #UP
174 \override DynamicText.direction = #DOWN
175 \override DynamicLineSpanner.direction = #DOWN
178 \revert DynamicText.direction
179 \revert DynamicLineSpanner.direction
186 \override NoteHead.stencil = #note-head::brew-ez-stencil
187 \override NoteHead.font-size = #-8
188 \override NoteHead.font-family = #'sans
189 \override NoteHead.font-series = #'bold
192 \revert NoteHead.stencil
193 \revert NoteHead.font-size
194 \revert NoteHead.font-family
195 \revert NoteHead.font-series
202 #(make-music 'MultiMeasureTextEvent
203 ;; Set the 'text based on the 'direction
204 'text (make-fermata-markup)
205 'tweaks '((outside-staff-priority . 40)
206 (outside-staff-padding . 0)))
210 teeny = \set fontSize = #-3
211 tiny = \set fontSize = #-2
212 small = \set fontSize = #-1
213 normalsize = \set fontSize = #0
214 large = \set fontSize = #1
215 huge = \set fontSize = #2
220 glissando = #(make-music 'GlissandoEvent)
226 #(define-music-function () ()
227 (_i "Set the default note head style to a diamond-shaped style.")
229 (override-head-style '(NoteHead TabNoteHead) 'harmonic) 'Bottom))
230 harmonicsOff = \defaultNoteHeads
232 #(define-music-function (note) (ly:music?)
233 (_i "Print @var{note} with a diamond-shaped note head.")
234 (style-note-heads 'NoteHead 'harmonic note))
240 % hide notes, accidentals, etc.
241 \override Dots.transparent = ##t
242 \override NoteHead.transparent = ##t
243 \override NoteHead.no-ledgers = ##t
244 % assume that any Beam inherits transparency from its parent Stem
245 \override Stem.transparent = ##t
246 \override Accidental.transparent = ##t
247 \override Rest.transparent = ##t
248 \override TabNoteHead.transparent = ##t
251 \revert Accidental.transparent
252 \revert Stem.transparent
253 \revert NoteHead.transparent
254 \revert NoteHead.no-ledgers
255 \revert Dots.transparent
256 \revert Rest.transparent
257 \revert TabNoteHead.transparent
264 \set squashedPosition = #0
265 \override NoteHead.style = #'slash
266 \override TabNoteHead.style = #'slash
267 \override Accidental.stencil = ##f
268 \override AccidentalCautionary.stencil = ##f
271 \unset squashedPosition
272 \revert NoteHead.style
273 \revert TabNoteHead.style
274 \revert Accidental.stencil
275 \revert AccidentalCautionary.stencil
281 #(define-music-function (incipit-music) (ly:music?)
282 (_i "Output @var{incipit-music} before the main staff as an indication of
283 its appearance in the original music.")
285 \once \override Staff.InstrumentName.stencil =
287 (let* ((instrument-name (ly:grob-property grob 'long-text))
288 (align-x (ly:grob-property grob 'self-alignment-X 0))
289 (align-y (ly:grob-property grob 'self-alignment-Y 0)))
290 (set! (ly:grob-property grob 'long-text)
294 \new MensuralStaff \with {
295 \override InstrumentName.self-alignment-X = #align-x
296 \override InstrumentName.self-alignment-Y = #align-y
297 instrumentName = #instrument-name
303 $(ly:grob-layout grob)
304 indent-incipit-default = 15\mm
305 line-width = #(primitive-eval
306 '(or (false-if-exception indent)
307 indent-incipit-default))
308 indent = #(primitive-eval
309 '(or (false-if-exception (- line-width incipit-width))
316 \remove "Default_bar_line_engraver"
322 (set! (ly:grob-property grob 'self-alignment-Y) #f)
323 (set! (ly:grob-property grob 'self-alignment-X) RIGHT)
324 (system-start-text::print grob)))
330 \override NoteHead.style = #'kievan
331 \override Stem.X-offset = #stem::kievan-offset-callback
332 \override Stem.stencil = ##f
333 \override Flag.stencil = ##f
334 \override Rest.style = #'mensural
335 \override Accidental.glyph-name-alist = #alteration-kievan-glyph-name-alist
336 \override Dots.style = #'kievan
337 \override Slur.stencil = ##f
338 \override Stem.length = #0.0
339 \override Beam.positions = #beam::get-kievan-positions
340 \override Beam.quantized-positions = #beam::get-kievan-quantized-positions
341 \override NoteHead.duration-log = #note-head::calc-kievan-duration-log
344 \revert NoteHead.style
345 \revert Stem.X-offset
348 \revert Accidental.glyph-name-alist
353 \revert Beam.positions
354 \revert Beam.quantized-positions
355 \revert NoteHead.duration-log
358 %% line and page breaking controls
360 autoLineBreaksOff = {
361 \overrideProperty Score.NonMusicalPaperColumn.line-break-permission ##f
362 \override Score.NonMusicalPaperColumn.line-break-permission = ##f
365 \overrideProperty Score.NonMusicalPaperColumn.line-break-permission #'allow
366 \override Score.NonMusicalPaperColumn.line-break-permission = #'allow
369 \override Score.NonMusicalPaperColumn.page-break-permission = ##f
371 \override Score.NonMusicalPaperColumn.page-break-permission = #'allow
372 autoBreaksOff = { \autoLineBreaksOff \autoPageBreaksOff }
373 autoBreaksOn = { \autoLineBreaksOn \autoPageBreaksOn }
378 mergeDifferentlyDottedOn =
379 \override Staff.NoteCollision.merge-differently-dotted = ##t
380 mergeDifferentlyDottedOff =
381 \revert Staff.NoteCollision.merge-differently-dotted
382 mergeDifferentlyHeadedOn =
383 \override Staff.NoteCollision.merge-differently-headed = ##t
384 mergeDifferentlyHeadedOff =
385 \revert Staff.NoteCollision.merge-differently-headed
388 %% numeric time signature
390 numericTimeSignature = \override Staff.TimeSignature.style = #'numbered
391 defaultTimeSignature = \revert Staff.TimeSignature.style
397 #(define-music-function () ()
398 (_i "Set the default note head style to a triangle-shaped style.")
400 (override-head-style 'NoteHead 'do) 'Bottom))
401 palmMuteOff = \defaultNoteHeads
403 #(define-music-function (note) (ly:music?)
404 (_i "Print @var{note} with a triangle-shaped note head.")
405 (style-note-heads 'NoteHead 'do note))
410 #(define-music-function (type) ((symbol?))
411 (_i "Override the part-combiner.")
412 (if type (propertySet 'partCombineForced type)
413 (propertyUnset 'partCombineForced)))
415 partcombineApart = \partcombineForce #'apart
416 partcombineChords = \partcombineForce #'chords
417 partcombineUnisono = \partcombineForce #'unisono
418 partcombineSoloI = \partcombineForce #'solo1
419 partcombineSoloII = \partcombineForce #'solo2
420 partcombineAutomatic = \partcombineForce \default
426 phrasingSlurUp = \override PhrasingSlur.direction = #UP
427 phrasingSlurDown = \override PhrasingSlur.direction = #DOWN
428 phrasingSlurNeutral = \revert PhrasingSlur.direction
430 % dash-patterns (make-simple-dash-definition defined at top of file)
431 phrasingSlurDashPattern =
432 #(define-music-function (dash-fraction dash-period)
434 (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of
435 line to space repeated at @var{dash-period} interval for phrasing slurs.")
437 \override PhrasingSlur.dash-definition =
438 $(make-simple-dash-definition dash-fraction dash-period)
441 \override PhrasingSlur.dash-definition = #'((0 1 0.4 0.75))
443 \override PhrasingSlur.dash-definition = #'((0 1 0.1 0.75))
444 phrasingSlurHalfDashed =
445 \override PhrasingSlur.dash-definition = #'((0 0.5 0.4 0.75)
447 phrasingSlurHalfSolid =
448 \override PhrasingSlur.dash-definition = #'((0 0.5 1 1)
451 \revert PhrasingSlur.dash-definition
457 #(define-void-function () ()
458 (_i "Enable generation of code in final-format (e.g. pdf) files to reference the
459 originating lilypond source statement;
460 this is helpful when developing a score but generates bigger final-format files.")
461 (ly:set-option 'point-and-click #t))
464 #(define-void-function () ()
465 (_i "Suppress generating extra code in final-format (e.g. pdf) files to point
466 back to the lilypond source statement.")
467 (ly:set-option 'point-and-click #f))
470 #(define-void-function (types) (symbol-list-or-symbol?)
471 (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
472 (ly:set-option 'point-and-click types))
474 %% predefined fretboards
476 predefinedFretboardsOff =
477 \set predefinedDiagramTable = ##f
478 predefinedFretboardsOn =
479 \set predefinedDiagramTable = #default-fret-table
484 aikenHeads = \set shapeNoteStyles = ##(do re miMirror fa sol la ti)
485 aikenHeadsMinor = \set shapeNoteStyles = ##(la ti do re miMirror fa sol)
487 \set shapeNoteStyles = ##(doFunk reFunk miFunk faFunk solFunk laFunk tiFunk)
489 \set shapeNoteStyles = ##(laFunk tiFunk doFunk reFunk miFunk faFunk solFunk)
490 sacredHarpHeads = \set shapeNoteStyles = ##(fa sol la fa sol la mi)
491 sacredHarpHeadsMinor = \set shapeNoteStyles = ##(la mi fa sol la fa sol)
492 southernHarmonyHeads =
493 \set shapeNoteStyles = ##(faThin sol laThin faThin sol laThin miThin)
494 southernHarmonyHeadsMinor =
495 \set shapeNoteStyles = ##(laThin miThin faThin sol laThin faThin sol)
497 \set shapeNoteStyles = ##(doWalker reWalker miWalker faWalker solFunk laWalker tiWalker)
499 \set shapeNoteStyles = ##(laWalker tiWalker doWalker reWalker miWalker faWalker solFunk)
504 shiftOff = \override NoteColumn.horizontal-shift = #0
505 shiftOn = \override NoteColumn.horizontal-shift = #1
506 shiftOnn = \override NoteColumn.horizontal-shift = #2
507 shiftOnnn = \override NoteColumn.horizontal-shift = #3
513 slurUp = \override Slur.direction = #UP
514 slurDown = \override Slur.direction = #DOWN
515 slurNeutral = \revert Slur.direction
517 % dash-patterns (make-simple-dash-definition defined at top of file)
519 #(define-music-function (dash-fraction dash-period)
521 (_i "Set up a custom style of dash pattern for @var{dash-fraction}
522 ratio of line to space repeated at @var{dash-period} interval for slurs.")
524 \override Slur.dash-definition =
525 $(make-simple-dash-definition dash-fraction dash-period)
527 slurDashed = \override Slur.dash-definition = #'((0 1 0.4 0.75))
528 slurDotted = \override Slur.dash-definition = #'((0 1 0.1 0.75))
529 slurHalfDashed = \override Slur.dash-definition = #'((0 0.5 0.4 0.75)
531 slurHalfSolid = \override Slur.dash-definition = #'((0 0.5 1 1)
533 slurSolid = \revert Slur.dash-definition
538 showStaffSwitch = \set followVoice = ##t
539 hideStaffSwitch = \set followVoice = ##f
544 stemUp = \override Stem.direction = #UP
545 stemDown = \override Stem.direction = #DOWN
546 stemNeutral = \revert Stem.direction
551 romanStringNumbers = {
552 \override StringNumber.number-type = #'roman-upper
553 \override StringNumber.stencil = #ly:text-interface::print
554 \override StringNumber.font-encoding = #'latin1
555 \override StringNumber.font-shape = #'italic
557 arabicStringNumbers = {
558 \revert StringNumber.number-type
559 \revert StringNumber.stencil
560 \revert StringNumber.font-encoding
561 \revert StringNumber.font-shape
567 % switch to full notation
570 \revert TabStaff.TimeSignature.stencil
571 % stems (the half note gets a double stem)
572 \revert TabStaff.Stem.length
573 \revert TabStaff.Stem.no-stem-extend
574 \revert TabStaff.Flag.style
575 \revert TabStaff.Stem.details
576 \revert TabStaff.Stem.stencil
577 \revert TabStaff.Flag.stencil
578 \override TabStaff.Stem.stencil = #tabvoice::draw-double-stem-for-half-notes
579 \override TabStaff.Stem.X-extent = #tabvoice::make-double-stem-width-for-half-notes
580 \set TabStaff.autoBeaming = ##t
581 \revert TabStaff.NoteColumn.ignore-collision
583 \revert TabStaff.Beam.stencil
584 \revert TabStaff.StemTremolo.stencil
585 \revert TabStaff.Dots.stencil
586 \revert TabStaff.Tie.stencil
587 \revert TabStaff.Tie.after-line-breaking
588 \revert TabStaff.RepeatTie.stencil
589 \revert TabStaff.RepeatTie.after-line-breaking
590 \revert TabStaff.LaissezVibrerTie.stencil
591 \revert TabStaff.Slur.stencil
592 \revert TabStaff.PhrasingSlur.stencil
594 \revert TabStaff.TupletBracket.stencil
595 \revert TabStaff.TupletNumber.stencil
597 \revert TabStaff.DynamicText.stencil
598 \revert TabStaff.DynamicTextSpanner.stencil
599 \revert TabStaff.DynamicTextSpanner.stencil
600 \revert TabStaff.Hairpin.stencil
602 \revert TabStaff.Rest.stencil
603 \revert TabStaff.MultiMeasureRest.stencil
604 \revert TabStaff.MultiMeasureRestNumber.stencil
605 \revert TabStaff.MultiMeasureRestText.stencil
607 \revert TabStaff.Glissando.stencil
608 \revert TabStaff.Script.stencil
609 \revert TabStaff.TextScript.stencil
610 \revert TabStaff.TextSpanner.stencil
611 \revert TabStaff.Arpeggio.stencil
612 \revert TabStaff.NoteColumn.ignore-collision
615 %tie/repeat tie behaviour
616 hideSplitTiedTabNotes = {
617 \override TabVoice.TabNoteHead.details.tied-properties.break-visibility = #all-invisible
618 \override TabVoice.TabNoteHead.details.tied-properties.parenthesize = ##f
619 \override TabVoice.TabNoteHead.details.repeat-tied-properties.note-head-visible = ##f
620 \override TabVoice.TabNoteHead.details.repeat-tied-properties.parenthesize = ##f
623 showSplitTiedTabNotes = {
624 \override TabVoice.TabNoteHead.details.tied-properties.break-visibility = #begin-of-line-visible
625 \override TabVoice.TabNoteHead.details.tied-properties.parenthesize = ##t
626 \override TabVoice.TabNoteHead.details.repeat-tied-properties.note-head-visible = ##t
627 \override TabVoice.TabNoteHead.details.repeat-tied-properties.parenthesize = ##t
633 % 0.4 staff-space between adjacent texts
634 \override TextScript.extra-spacing-width = #'(-0.0 . 0.4)
635 \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)
639 \override TextScript.extra-spacing-width = #'(+inf.0 . -inf.0)
640 \override TextScript.extra-spacing-height = #'(0 . 0)
644 \override Score.MetronomeMark.extra-spacing-width = #'(0 . 1.0)
645 \override Score.RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5)
646 % Raise as much as four staff-spaces before pushing notecolumns right
647 \override Score.MetronomeMark.extra-spacing-height = #'(4 . 4)
648 \override Score.RehearsalMark.extra-spacing-height = #'(4 . 4)
652 \override Score.MetronomeMark.extra-spacing-width = #'(+inf.0 . -inf.0)
653 \override Score.RehearsalMark.extra-spacing-width = #'(+inf.0 . -inf.0)
654 \revert Score.MetronomeMark.extra-spacing-height
655 \revert Score.RehearsalMark.extra-spacing-height
660 textSpannerUp = \override TextSpanner.direction = #UP
661 textSpannerDown = \override TextSpanner.direction = #DOWN
662 textSpannerNeutral = \revert TextSpanner.direction
668 tieUp = \override Tie.direction = #UP
669 tieDown = \override Tie.direction = #DOWN
670 tieNeutral = \revert Tie.direction
672 % dash-patterns (make-simple-dash-definition defined at top of file)
674 #(define-music-function (dash-fraction dash-period)
676 (_i "Set up a custom style of dash pattern for @var{dash-fraction}
677 ratio of line to space repeated at @var{dash-period} interval for ties.")
679 \override Tie.dash-definition =
680 $(make-simple-dash-definition dash-fraction dash-period)
682 tieDashed = \override Tie.dash-definition = #'((0 1 0.4 0.75))
683 tieDotted = \override Tie.dash-definition = #'((0 1 0.1 0.75))
684 tieHalfDashed = \override Tie.dash-definition = #'((0 0.5 0.4 0.75)
686 tieHalfSolid = \override Tie.dash-definition = #'((0 0.5 1 1)
688 tieSolid = \revert Tie.dash-definition
693 tupletUp = \override TupletBracket.direction = #UP
694 tupletDown = \override TupletBracket.direction = #DOWN
695 tupletNeutral = \revert TupletBracket.direction
700 % dynamic ly:dir? text script, articulation script ly:dir?
701 voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
702 voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
703 voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice)
704 voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
705 oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
711 \override NoteHead.style = #'diamond
712 \override NoteHead.color = #red
713 \override Stem.color = #red
714 \override Beam.color = #red
717 \override NoteHead.style = #'triangle
718 \override NoteHead.color = #blue
719 \override Stem.color = #blue
720 \override Beam.color = #blue
723 \override NoteHead.style = #'xcircle
724 \override NoteHead.color = #green
725 \override Stem.color = #green
726 \override Beam.color = #green
729 \override NoteHead.style = #'cross
730 \override NoteHead.color = #magenta
731 \override Stem.color = #magenta
732 \override Beam.color = #magenta
734 voiceNeutralStyle = {
735 \revert NoteHead.style
736 \revert NoteHead.color
745 #(define-void-function (bar) (string?)
746 (allow-volta-hook bar))
750 #(define (cross-style grob)
751 ;; Returns the symbol 'cross to set the 'style-property for (Tab-)NoteHead.
752 ;; If the current text-font doesn't contain the glyph set 'font-name to '()
753 ;; and 'font-family to 'feta.
754 ;; If 'feta is replaced by another music-font without cross-style-glyphs
755 ;; note-head.cc throws a warning and no visual output happens.
756 (let* ((layout (ly:grob-layout grob))
757 (props (ly:grob-alist-chain grob))
758 (font (ly:paper-get-font layout props))
759 (font-unknown? (string=? (ly:font-name font) "unknown")))
762 (ly:grob-set-property! grob 'font-name '())
763 (ly:grob-set-property! grob 'font-family 'feta)))
766 %% Set the default note head style to a cross-shaped style.
768 \temporary \override NoteHead.style = #cross-style
769 \temporary \override TabNoteHead.style = #cross-style
772 xNotesOff = \defaultNoteHeads
775 #(define-music-function (note) (ly:music?)
776 (_i "Print @var{note} with a cross-shaped note head.")
777 (if (eq? (ly:music-property note 'name) 'NoteEvent)
778 #{ \tweak style #cross-style $note #}
779 #{ \xNotesOn $note \xNotesOff #}))
781 %% dead notes (these need to come after "x notes")
783 % Define aliases of cross-head notes for specific purposes
784 deadNotesOn = \xNotesOn
785 deadNotesOff = \xNotesOff