X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fproperty-init.ly;h=f91c4b8d85dd760af497e4c99e95d66a71466b67;hb=794dcbdb52faf4292036cd1b0270a956cf4316a3;hp=7cae78ebb11726d36116ca26c1c55d0d196fddb6;hpb=84dfa31321b6f0c3224ed8c586b64ec97e88402f;p=lilypond.git diff --git a/ly/property-init.ly b/ly/property-init.ly index 7cae78ebb1..f91c4b8d85 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -1,58 +1,123 @@ % property-init.ly -\version "2.11.38" +\version "2.12.0" -stemUp = \override Stem #'direction = #UP -stemDown = \override Stem #'direction = #DOWN -stemNeutral= \revert Stem #'direction +stemUp = \override Stem #'direction = #UP +stemDown = \override Stem #'direction = #DOWN +stemNeutral = \revert Stem #'direction -slurUp = \override Slur #'direction = #UP -slurDown = \override Slur #'direction = #DOWN +slurUp = \override Slur #'direction = #UP +slurDown = \override Slur #'direction = #DOWN slurNeutral = \revert Slur #'direction -%% There's also dash, but setting dash period/length should be fixed. +#(define (make-simple-dash-definition dash-fraction dash-period) + (list (list 0 1 dash-fraction dash-period))) + slurDashed = { - \override Slur #'dash-period = #0.75 - \override Slur #'dash-fraction = #0.4 -} + \override Slur #'dash-definition = #'((0 1 0.4 0.75)) +} +slurDashPattern = +#(define-music-function (parser location dash-fraction dash-period) + (number? number?) + #{ + \override Slur #'dash-definition = + $(make-simple-dash-definition dash-fraction dash-period) + #}) slurDotted = { - \override Slur #'dash-period = #0.75 - \override Slur #'dash-fraction = #0.1 + \override Slur #'dash-definition = #'((0 1 0.1 0.75)) +} +slurHalfDashed = { + \override Slur #'dash-definition = #'((0 0.5 0.4 0.75) + (0.5 1 1 1)) +} +slurHalfSolid = { + \override Slur #'dash-definition = #'((0 0.5 1 1) + (0.5 1 0.4 0.75)) } slurSolid = { - \revert Slur #'dash-period - \revert Slur #'dash-fraction + \revert Slur #'dash-definition } -phrasingSlurUp = \override PhrasingSlur #'direction = #UP -phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN +phrasingSlurUp = \override PhrasingSlur #'direction = #UP +phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN phrasingSlurNeutral = \revert PhrasingSlur #'direction -shiftOn = \override NoteColumn #'horizontal-shift = #1 -shiftOnn = \override NoteColumn #'horizontal-shift = #2 -shiftOnnn = \override NoteColumn #'horizontal-shift = #3 +phrasingSlurDashed = { + \override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75)) +} +phrasingSlurDashPattern = +#(define-music-function (parser location dash-fraction dash-period) + (number? number?) + #{ + \override PhrasingSlur #'dash-definition = + $(make-simple-dash-definition dash-fraction dash-period) + #}) +phrasingSlurDotted = { + \override PhrasingSlur #'dash-definition = #'((0 1 0.1 0.75)) +} +phrasingSlurHalfDashed = { + \override PhrasingSlur #'dash-definition = #'((0 0.5 0.4 0.75) + (0.5 1 1 1)) +} +phrasingSlurHalfSolid = { + \override PhrasingSlur #'dash-definition = #'((0 0.5 1 1) + (0.5 1 0.4 0.75)) +} +phrasingSlurSolid = { + \revert PhrasingSlur #'dash-definition +} + +mergeDifferentlyDottedOn = { + \override Staff.NoteCollision #'merge-differently-dotted = ##t +} +mergeDifferentlyDottedOff = { + \revert Staff.NoteCollision #'merge-differently-dotted +} + +mergeDifferentlyHeadedOn = { + \override Staff.NoteCollision #'merge-differently-headed = ##t +} +mergeDifferentlyHeadedOff = { + \revert Staff.NoteCollision #'merge-differently-headed +} + +shiftOn = \override NoteColumn #'horizontal-shift = #1 +shiftOnn = \override NoteColumn #'horizontal-shift = #2 +shiftOnnn = \override NoteColumn #'horizontal-shift = #3 shiftOff = \revert NoteColumn #'horizontal-shift -tieUp = \override Tie #'direction = #UP -tieDown = \override Tie #'direction = #DOWN +tieUp = \override Tie #'direction = #UP +tieDown = \override Tie #'direction = #DOWN tieNeutral = \revert Tie #'direction tieDashed = { - \override Tie #'dash-period = #0.75 - \override Tie #'dash-fraction = #0.4 -} + \override Tie #'dash-definition = #'((0 1 0.4 0.75)) +} +tieDashPattern = +#(define-music-function (parser location dash-fraction dash-period) + (number? number?) + #{ + \override Tie #'dash-definition = + $(make-simple-dash-definition dash-fraction dash-period) + #}) tieDotted = { - \override Tie #'dash-period = #0.75 - \override Tie #'dash-fraction = #0.1 + \override Tie #'dash-definition = #'((0 1 0.1 0.75)) +} +tieHalfDashed = { + \override Tie #'dash-definition = #'((0 0.5 0.4 0.75) + (0.5 1 1 1)) +} +tieHalfSolid = { + \override Tie #'dash-definition = #'((0 0.5 1 1) + (0.5 1 0.4 0.75)) } tieSolid = { - \revert Tie #'dash-period - \revert Tie #'dash-fraction + \revert Tie #'dash-definition } easyHeadsOn = { - \override NoteHead #'stencil = #ly:note-head::brew-ez-stencil + \override NoteHead #'stencil = #ly:note-head::brew-ez-stencil \override NoteHead #'font-size = #-7 \override NoteHead #'font-family = #'sans \override NoteHead #'font-series = #'bold @@ -65,19 +130,18 @@ easyHeadsOff = { \revert NoteHead #'font-series } -aikenHeads = \set shapeNoteStyles = ##(do re mi fa #f la ti) +aikenHeads = \set shapeNoteStyles = #'#(do re mi fa #f la ti) -sacredHarpHeads = - \set shapeNoteStyles = ##(fa #f la fa #f la mi) +sacredHarpHeads = \set shapeNoteStyles = #'#(fa #f la fa #f la mi) dynamicUp = { - \override DynamicText #'direction = #UP - \override DynamicLineSpanner #'direction = #UP + \override DynamicText #'direction = #UP + \override DynamicLineSpanner #'direction = #UP } dynamicDown = { - \override DynamicText #'direction = #DOWN - \override DynamicLineSpanner #'direction = #DOWN + \override DynamicText #'direction = #DOWN + \override DynamicLineSpanner #'direction = #DOWN } dynamicNeutral = { @@ -86,12 +150,12 @@ dynamicNeutral = { } -dotsUp = \override Dots #'direction = #UP -dotsDown = \override Dots #'direction = #DOWN -dotsNeutral = \revert Dots #'direction +dotsUp = \override Dots #'direction = #UP +dotsDown = \override Dots #'direction = #DOWN +dotsNeutral = \revert Dots #'direction -tupletUp = \override TupletBracket #'direction = #UP -tupletDown = \override TupletBracket #'direction = #DOWN +tupletUp = \override TupletBracket #'direction = #UP +tupletDown = \override TupletBracket #'direction = #DOWN tupletNeutral = \revert TupletBracket #'direction cadenzaOn = \set Timing.timing = ##f @@ -100,11 +164,11 @@ cadenzaOff = { \set Timing.measurePosition = #ZERO-MOMENT } -% dynamic ly:dir? text script, articulation script ly:dir? +% dynamic ly:dir? text script, articulation script ly:dir? oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice) voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice) voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice) -voiceThree =#(context-spec-music (make-voice-props-set 2) 'Voice) +voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice) voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice) voiceOneStyle = { @@ -138,7 +202,10 @@ voiceNeutralStyle = { \revert Beam #'color } - +teeny = { + \set fontSize = #-3 +} + tiny = { \set fontSize = #-2 } @@ -160,10 +227,10 @@ huge = { } %% End the incipit and print a ``normal line start''. -endincipit = \context Staff { +endincipit = \context Staff { \partial 16 s16 % Hack to handle e.g. \bar ".|" \endincipit - \once \override Staff.Clef #'full-size-change = ##t - \once \override Staff.Clef #'non-default = ##t + \once \override Staff.Clef #'full-size-change = ##t + \once \override Staff.Clef #'non-default = ##t \bar "" } @@ -171,15 +238,26 @@ autoBeamOff = \set autoBeaming = ##f autoBeamOn = \set autoBeaming = ##t textLengthOn = { - \override TextScript #'extra-spacing-width = #'(0 . 0) - \override TextScript #'infinite-spacing-height = ##t + \override TextScript #'extra-spacing-width = #'(0 . 0) + \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0) } textLengthOff = { - \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0) - \override TextScript #'infinite-spacing-height = ##f + \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0) + \override TextScript #'extra-spacing-height = #'(0 . 0) +} + +balloonLengthOn = { + \override BalloonTextItem #'extra-spacing-width = #'(0 . 0) + \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0) } +balloonLengthOff = { + \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0) + \override BalloonTextItem #'extra-spacing-height = #'(0 . 0) +} + + showStaffSwitch = \set followVoice = ##t hideStaffSwitch = \set followVoice = ##f @@ -207,75 +285,96 @@ defaultTimeSignature = { arpeggio = #(make-music 'ArpeggioEvent) -arpeggioUp = \sequential { +arpeggioArrowUp = { \revert Arpeggio #'stencil + \revert Arpeggio #'X-extent \override Arpeggio #'arpeggio-direction = #UP } -arpeggioDown = \sequential { +arpeggioArrowDown = { \revert Arpeggio #'stencil + \revert Arpeggio #'X-extent \override Arpeggio #'arpeggio-direction = #DOWN } -arpeggioNeutral = \sequential { +arpeggioNormal = { \revert Arpeggio #'stencil - \revert Arpeggio #'arpeggio-direction + \revert Arpeggio #'X-extent + \revert Arpeggio #'arpeggio-direction + \revert Arpeggio #'dash-definition } -arpeggioBracket = \sequential { +arpeggioBracket = { + \revert Arpeggio #'X-extent \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket } +arpeggioParenthesis = { + \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur + \override Arpeggio #'X-extent = #ly:grob::stencil-width + \revert Arpeggio #'dash-definition +} +arpeggioParenthesisDashed = { + \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur + \override Arpeggio #'X-extent = #ly:grob::stencil-width + \override Arpeggio #'dash-definition = #'((0 1 0.4 0.75)) +} + + glissando = #(make-music 'GlissandoEvent) fermataMarkup = \markup { \musicglyph #"scripts.ufermata" } -hideNotes =\sequential { +hideNotes = { % hide notes, accidentals, etc. - \override Dots #'transparent = ##t - \override NoteHead #'transparent = ##t - \override NoteHead #'no-ledgers = ##t - \override Stem #'transparent = ##t - \override Beam #'transparent = ##t - \override Accidental #'transparent = ##t + \override Dots #'transparent = ##t + \override NoteHead #'transparent = ##t + \override NoteHead #'no-ledgers = ##t + \override Stem #'transparent = ##t + \override Beam #'transparent = ##t + \override Accidental #'transparent = ##t } -unHideNotes = \sequential { +unHideNotes = { \revert Accidental #'transparent \revert Beam #'transparent \revert Stem #'transparent \revert NoteHead #'transparent \revert NoteHead #'no-ledgers - \revert Dots #'transparent + \revert Dots #'transparent } germanChords = { - \set chordRootNamer = #(chord-name->german-markup #t) - \set chordNoteNamer = #note-name->german-markup + \set chordRootNamer = #(chord-name->german-markup #t) + \set chordNoteNamer = #note-name->german-markup } semiGermanChords = { - \set chordRootNamer = #(chord-name->german-markup #f) - \set chordNoteNamer = #note-name->german-markup + \set chordRootNamer = #(chord-name->german-markup #f) + \set chordNoteNamer = #note-name->german-markup } frenchChords = { - \set chordRootNamer = #(chord-name->italian-markup #t) - \set chordPrefixSpacer = #0.4 + \set chordRootNamer = #(chord-name->italian-markup #t) + \set chordPrefixSpacer = #0.4 } italianChords = { - \set chordRootNamer = #(chord-name->italian-markup #f) - \set chordPrefixSpacer = #0.4 + \set chordRootNamer = #(chord-name->italian-markup #f) + \set chordPrefixSpacer = #0.4 } -improvisationOn = { - \set squashedPosition = #0 - \override NoteHead #'style = #'slash - \override Accidental #'stencil = ##f +harmonicsOn = \override NoteHead #'style = #'harmonic + +harmonicsOff = \revert NoteHead #'style + +improvisationOn = { + \set squashedPosition = #0 + \override NoteHead #'style = #'slash + \override Accidental #'stencil = ##f } -improvisationOff = { - \unset squashedPosition - \revert NoteHead #'style - \revert Accidental #'stencil +improvisationOff = { + \unset squashedPosition + \revert NoteHead #'style + \revert Accidental #'stencil } textSpannerUp = \override TextSpanner #'direction = #UP @@ -283,3 +382,122 @@ textSpannerDown = \override TextSpanner #'direction = #DOWN textSpannerNeutral = \revert TextSpanner #'direction + +bassFigureExtendersOn = { + \set useBassFigureExtenders = ##t + \set Staff.useBassFigureExtenders = ##t +} + +bassFigureExtendersOff = { + \set useBassFigureExtenders = ##f + \set Staff.useBassFigureExtenders = ##f +} + +bassFigureStaffAlignmentDown = { + \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN +} + +bassFigureStaffAlignmentUp = { + \override Staff.BassFigureAlignmentPositioning #'direction = #UP +} + +bassFigureStaffAlignmentNeutral = { + \revert Staff.BassFigureAlignmentPositioning #'direction +} + +predefinedFretboardsOff = { + \set FretBoards.predefinedDiagramTable = ##f +} + +predefinedFretboardsOn = { + \set FretBoards.predefinedDiagramTable = #fretboard-table +} + +pointAndClickOff = #(define-music-function (parser location) () + (ly:set-option 'point-and-click #f) + (make-music 'SequentialMusic 'void #t)) + +pointAndClickOn = #(define-music-function (parser location) () + (ly:set-option 'point-and-click #t) + (make-music 'SequentialMusic 'void #t)) + +palmMuteOn = { + \override NoteHead #'style = #'do +} + +palmMuteOff = { + \revert NoteHead #'style +} + +palmMute = +#(define-music-function (parser location note) (ly:music?) + ;; are we inside a <...>? + (if (eq? (ly:music-property note 'name) 'NoteEvent) + ;; yes -> add a tweak + (begin (set! (ly:music-property note 'tweaks) + (acons 'style 'do (ly:music-property note 'tweaks))) + note) + ;; no -> use predefined commands to switch to triangle-shaped note heads + #{ + \palmMuteOn + $note + \palmMuteOff + #})) + +deadNotesOn = { + \override TabNoteHead #'style = #'cross + \override NoteHead #'style = #'cross +} + +deadNotesOff = { + \revert TabNoteHead #'style + \revert NoteHead #'style +} + +deadNote = +#(define-music-function (parser location note) (ly:music?) + ;; are we inside a <...>? + (if (eq? (ly:music-property note 'name) 'NoteEvent) + ;; yes -> add a tweak + (begin (set! (ly:music-property note 'tweaks) + (acons 'style 'cross (ly:music-property note 'tweaks))) + note) + ;; no -> use predefined commmands for changing + ;; note head and tablature fret signs + #{ + \deadNotesOn + $note + \deadNotesOff + #})) + +tabFullNotation = { + % time signature + \revert TabStaff.TimeSignature #'stencil + % stems (the half note gets a double stem) + \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes + % beams, dots + \revert TabVoice.Beam #'stencil + \revert TabVoice.Dots #'stencil + \revert TabVoice.Tie #'stencil + \revert TabVoice.Tie #'after-line-breaking + \revert TabVoice.RepeatTie #'stencil + \revert TabVoice.RepeatTie #'after-line-braking + \revert TabVoice.LaissezVibrerTie #'stencil + \revert TabVoice.Slur #'stencil + \revert PhrasingSlur #'stencil + % tuplet stuff + \revert TabVoice.TupletBracket #'stencil + \revert TabVoice.TupletNumber #'stencil + % dynamic signs + \revert DynamicText #'transparent + \revert DynamicTextSpanner #'stencil + \revert TabVoice.DynamicTextSpanner #'stencil + \revert TabVoice.Hairpin #'transparent + % rests + \revert TabVoice.Rest #'stencil + \revert TabVoice.MultiMeasureRest #'stencil + % markups etc. + \revert TabVoice.Script #'stencil + \revert TabVoice.TextScript #'stencil + \revert TabStaff.Arpeggio #'stencil +}