X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fproperty-init.ly;h=4923420ffef5181bf0ade63b3d3f8904075017fa;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=fc7c67179a377b7e05d2e664539df5b6f97425e0;hpb=7ea158846edf78edd2ebb89a7c9b5f9dbca67bf7;p=lilypond.git diff --git a/ly/property-init.ly b/ly/property-init.ly index fc7c67179a..4923420ffe 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -1,6 +1,6 @@ % property-init.ly -\version "2.17.6" +\version "2.19.22" %% for dashed slurs, phrasing slurs, and ties #(define (make-simple-dash-definition dash-fraction dash-period) @@ -8,14 +8,14 @@ %% common definition for all note head styles reverting %% (palm mute, harmonics, dead notes, ...) -defaultNoteHeads = -#(define-music-function (parser location) () - (_i "Revert to the default note head style.") - (revert-head-style '(NoteHead TabNoteHead))) +defaultNoteHeads = { + \revert NoteHead.style + \revert TabNoteHead.style +} accidentalStyle = #(define-music-function - (parser location style) (symbol-list?) + (style) (symbol-list?) (_i "Set accidental style to symbol list @var{style} in the form @samp{piano-cautionary}. If @var{style} has a form like @samp{Staff.piano-cautionary}, the settings are applied to that @@ -25,8 +25,8 @@ piano styles, which use @samp{GrandStaff} as a context." ) ((1) (set-accidental-style (car style))) ((2) (set-accidental-style (cadr style) (car style))) (else - (ly:parser-error parser (_ "not an accidental style") - location) + (ly:parser-error (_ "not an accidental style") + (*location*)) (make-music 'Music)))) %% arpeggios @@ -91,7 +91,7 @@ balloonLengthOff = { defineBarLine = #(define-void-function - (parser location bar glyph-list) (string? list?) + (bar glyph-list) (string? list?) (_i "Define bar line settings for bar line @var{bar}. The list @var{glyph-list} must have three entries which define the appearance at the end of line, at the beginning of the next line, @@ -124,17 +124,9 @@ bassFigureStaffAlignmentNeutral = %% cadenzas -cadenzaOn = { - \set Timing.timing = ##f - \set Timing.autoBeaming = ##f -} - -cadenzaOff = { - \set Timing.timing = ##t - \set Timing.measurePosition = #ZERO-MOMENT - \set Timing.autoBeaming = ##t -} +cadenzaOn = \set Timing.timing = ##f +cadenzaOff = \set Timing.timing = ##t %% chord names @@ -204,29 +196,14 @@ easyHeadsOff = { } -%% endincipit - -%% End the incipit and print a ``normal line start''. -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 - \bar "" -} - - %% fermata markup fermataMarkup = #(make-music 'MultiMeasureTextEvent - 'tweaks (list - ;; Set the 'text based on the 'direction - (cons 'text (lambda (grob) - (if (eq? (ly:grob-property grob 'direction) DOWN) - (markup #:musicglyph "scripts.dfermata") - (markup #:musicglyph "scripts.ufermata")))) - (cons 'outside-staff-priority 40) - (cons 'outside-staff-padding 0))) + ;; Set the 'text based on the 'direction + 'text (make-fermata-markup) + 'tweaks '((outside-staff-priority . 40) + (outside-staff-padding . 0))) %% font sizes @@ -246,12 +223,13 @@ glissando = #(make-music 'GlissandoEvent) %% harmonics harmonicsOn = -#(define-music-function (parser location) () - (_i "Set the default note head style to a diamond-shaped style.") - (override-head-style '(NoteHead TabNoteHead) 'harmonic)) +#(define-music-function () () + (_i "Set the default note head style to a diamond-shaped style.") + (context-spec-music + (override-head-style '(NoteHead TabNoteHead) 'harmonic) 'Bottom)) harmonicsOff = \defaultNoteHeads harmonicNote = -#(define-music-function (parser location note) (ly:music?) +#(define-music-function (note) (ly:music?) (_i "Print @var{note} with a diamond-shaped note head.") (style-note-heads 'NoteHead 'harmonic note)) @@ -263,18 +241,15 @@ hideNotes = { \override Dots.transparent = ##t \override NoteHead.transparent = ##t \override NoteHead.no-ledgers = ##t + % assume that any Beam inherits transparency from its parent Stem \override Stem.transparent = ##t - \override Flag.transparent = ##t - \override Beam.transparent = ##t \override Accidental.transparent = ##t \override Rest.transparent = ##t \override TabNoteHead.transparent = ##t } unHideNotes = { \revert Accidental.transparent - \revert Beam.transparent \revert Stem.transparent - \revert Flag.transparent \revert NoteHead.transparent \revert NoteHead.no-ledgers \revert Dots.transparent @@ -288,16 +263,68 @@ unHideNotes = { improvisationOn = { \set squashedPosition = #0 \override NoteHead.style = #'slash + \override TabNoteHead.style = #'slash \override Accidental.stencil = ##f \override AccidentalCautionary.stencil = ##f } improvisationOff = { \unset squashedPosition \revert NoteHead.style + \revert TabNoteHead.style \revert Accidental.stencil \revert AccidentalCautionary.stencil } +%% incipit + +incipit = +#(define-music-function (incipit-music) (ly:music?) + (_i "Output @var{incipit-music} before the main staff as an indication of + its appearance in the original music.") + #{ + \once \override Staff.InstrumentName.stencil = + #(lambda (grob) + (let* ((instrument-name (ly:grob-property grob 'long-text)) + (align-x (ly:grob-property grob 'self-alignment-X 0)) + (align-y (ly:grob-property grob 'self-alignment-Y 0))) + (set! (ly:grob-property grob 'long-text) + #{ \markup { + \score + { + \new MensuralStaff \with { + \override InstrumentName.self-alignment-X = #align-x + \override InstrumentName.self-alignment-Y = #align-y + instrumentName = #instrument-name + } + { + $incipit-music + } + \layout { + $(ly:grob-layout grob) + indent-incipit-default = 15\mm + line-width = #(primitive-eval + '(or (false-if-exception indent) + indent-incipit-default)) + indent = #(primitive-eval + '(or (false-if-exception (- line-width incipit-width)) + (* 0.5 line-width))) + ragged-right = ##f + ragged-last = ##f + system-count = 1 + \context { + \Score + \remove "Default_bar_line_engraver" + } + } + } + } + #}) + (set! (ly:grob-property grob 'self-alignment-Y) #f) + (set! (ly:grob-property grob 'self-alignment-X) RIGHT) + (system-start-text::print grob))) + #} +) + %% kievan kievanOn = { \override NoteHead.style = #'kievan @@ -328,6 +355,24 @@ kievanOff = { \revert NoteHead.duration-log } +%% line and page breaking controls + +autoLineBreaksOff = { + \overrideProperty Score.NonMusicalPaperColumn.line-break-permission ##f + \override Score.NonMusicalPaperColumn.line-break-permission = ##f +} +autoLineBreaksOn = { + \overrideProperty Score.NonMusicalPaperColumn.line-break-permission #'allow + \override Score.NonMusicalPaperColumn.line-break-permission = #'allow +} +autoPageBreaksOff = + \override Score.NonMusicalPaperColumn.page-break-permission = ##f +autoPageBreaksOn = + \override Score.NonMusicalPaperColumn.page-break-permission = #'allow +autoBreaksOff = { \autoLineBreaksOff \autoPageBreaksOff } +autoBreaksOn = { \autoLineBreaksOn \autoPageBreaksOn } + + %% merging mergeDifferentlyDottedOn = @@ -349,15 +394,31 @@ defaultTimeSignature = \revert Staff.TimeSignature.style %% palm mutes palmMuteOn = -#(define-music-function (parser location) () - (_i "Set the default note head style to a triangle-shaped style.") - (override-head-style 'NoteHead 'do)) +#(define-music-function () () + (_i "Set the default note head style to a triangle-shaped style.") + (context-spec-music + (override-head-style 'NoteHead 'do) 'Bottom)) palmMuteOff = \defaultNoteHeads palmMute = -#(define-music-function (parser location note) (ly:music?) +#(define-music-function (note) (ly:music?) (_i "Print @var{note} with a triangle-shaped note head.") (style-note-heads 'NoteHead 'do note)) +%% part combiner + +partcombineForce = +#(define-music-function (type) ((symbol?)) + (_i "Override the part-combiner.") + (if type (propertySet 'partCombineForced type) + (propertyUnset 'partCombineForced))) + +partcombineApart = \partcombineForce #'apart +partcombineChords = \partcombineForce #'chords +partcombineUnisono = \partcombineForce #'unisono +partcombineSoloI = \partcombineForce #'solo1 +partcombineSoloII = \partcombineForce #'solo2 +partcombineAutomatic = \partcombineForce \default + %% phrasing slurs @@ -368,7 +429,7 @@ phrasingSlurNeutral = \revert PhrasingSlur.direction % dash-patterns (make-simple-dash-definition defined at top of file) phrasingSlurDashPattern = -#(define-music-function (parser location dash-fraction dash-period) +#(define-music-function (dash-fraction dash-period) (number? number?) (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of line to space repeated at @var{dash-period} interval for phrasing slurs.") @@ -382,10 +443,10 @@ 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)) + (0.5 1 1 1)) phrasingSlurHalfSolid = \override PhrasingSlur.dash-definition = #'((0 0.5 1 1) - (0.5 1 0.4 0.75)) + (0.5 1 0.4 0.75)) phrasingSlurSolid = \revert PhrasingSlur.dash-definition @@ -393,20 +454,20 @@ phrasingSlurSolid = %% point and click pointAndClickOn = -#(define-void-function (parser location) () +#(define-void-function () () (_i "Enable generation of code in final-format (e.g. pdf) files to reference the originating lilypond source statement; this is helpful when developing a score but generates bigger final-format files.") (ly:set-option 'point-and-click #t)) pointAndClickOff = -#(define-void-function (parser location) () +#(define-void-function () () (_i "Suppress generating extra code in final-format (e.g. pdf) files to point back to the lilypond source statement.") (ly:set-option 'point-and-click #f)) pointAndClickTypes = -#(define-void-function (parser location types) (symbol-list-or-symbol?) +#(define-void-function (types) (symbol-list-or-symbol?) (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.") (ly:set-option 'point-and-click types)) @@ -440,10 +501,10 @@ walkerHeadsMinor = %% shifts +shiftOff = \override NoteColumn.horizontal-shift = #0 shiftOn = \override NoteColumn.horizontal-shift = #1 shiftOnn = \override NoteColumn.horizontal-shift = #2 shiftOnnn = \override NoteColumn.horizontal-shift = #3 -shiftOff = \revert NoteColumn.horizontal-shift %% slurs @@ -455,7 +516,7 @@ slurNeutral = \revert Slur.direction % dash-patterns (make-simple-dash-definition defined at top of file) slurDashPattern = -#(define-music-function (parser location dash-fraction dash-period) +#(define-music-function (dash-fraction dash-period) (number? number?) (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of line to space repeated at @var{dash-period} interval for slurs.") @@ -466,9 +527,9 @@ ratio of line to space repeated at @var{dash-period} interval for slurs.") slurDashed = \override Slur.dash-definition = #'((0 1 0.4 0.75)) slurDotted = \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)) + (0.5 1 1 1)) slurHalfSolid = \override Slur.dash-definition = #'((0 0.5 1 1) - (0.5 1 0.4 0.75)) + (0.5 1 0.4 0.75)) slurSolid = \revert Slur.dash-definition @@ -485,6 +546,22 @@ stemDown = \override Stem.direction = #DOWN stemNeutral = \revert Stem.direction +%% string numbers + +romanStringNumbers = { + \override StringNumber.number-type = #'roman-upper + \override StringNumber.stencil = #ly:text-interface::print + \override StringNumber.font-encoding = #'latin1 + \override StringNumber.font-shape = #'italic +} +arabicStringNumbers = { + \revert StringNumber.number-type + \revert StringNumber.stencil + \revert StringNumber.font-encoding + \revert StringNumber.font-shape +} + + %% tablature % switch to full notation @@ -492,45 +569,45 @@ tabFullNotation = { % time signature \revert TabStaff.TimeSignature.stencil % stems (the half note gets a double stem) - \revert TabVoice.Stem.length - \revert TabVoice.Stem.no-stem-extend - \revert TabVoice.Flag.style - \revert TabVoice.Stem.details - \revert TabVoice.Stem.stencil - \revert TabVoice.Flag.stencil - \override TabVoice.Stem.stencil = #tabvoice::draw-double-stem-for-half-notes - \override TabVoice.Stem.X-extent = #tabvoice::make-double-stem-width-for-half-notes - \set TabVoice.autoBeaming = ##t - \revert TabVoice.NoteColumn.ignore-collision + \revert TabStaff.Stem.length + \revert TabStaff.Stem.no-stem-extend + \revert TabStaff.Flag.style + \revert TabStaff.Stem.details + \revert TabStaff.Stem.stencil + \revert TabStaff.Flag.stencil + \override TabStaff.Stem.stencil = #tabvoice::draw-double-stem-for-half-notes + \override TabStaff.Stem.X-extent = #tabvoice::make-double-stem-width-for-half-notes + \set TabStaff.autoBeaming = ##t + \revert TabStaff.NoteColumn.ignore-collision % beams, dots - \revert TabVoice.Beam.stencil - \revert TabVoice.StemTremolo.stencil - \revert TabVoice.Dots.stencil - \revert TabVoice.Tie.stencil - \revert TabVoice.Tie.after-line-breaking - \revert TabVoice.RepeatTie.stencil - \revert TabVoice.RepeatTie.after-line-breaking - \revert TabVoice.LaissezVibrerTie.stencil - \revert TabVoice.Slur.stencil - \revert TabVoice.PhrasingSlur.stencil + \revert TabStaff.Beam.stencil + \revert TabStaff.StemTremolo.stencil + \revert TabStaff.Dots.stencil + \revert TabStaff.Tie.stencil + \revert TabStaff.Tie.after-line-breaking + \revert TabStaff.RepeatTie.stencil + \revert TabStaff.RepeatTie.after-line-breaking + \revert TabStaff.LaissezVibrerTie.stencil + \revert TabStaff.Slur.stencil + \revert TabStaff.PhrasingSlur.stencil % tuplet stuff - \revert TabVoice.TupletBracket.stencil - \revert TabVoice.TupletNumber.stencil + \revert TabStaff.TupletBracket.stencil + \revert TabStaff.TupletNumber.stencil % dynamic signs - \revert TabVoice.DynamicText.stencil - \revert TabVoice.DynamicTextSpanner.stencil - \revert TabVoice.DynamicTextSpanner.stencil - \revert TabVoice.Hairpin.stencil + \revert TabStaff.DynamicText.stencil + \revert TabStaff.DynamicTextSpanner.stencil + \revert TabStaff.DynamicTextSpanner.stencil + \revert TabStaff.Hairpin.stencil % rests - \revert TabVoice.Rest.stencil - \revert TabVoice.MultiMeasureRest.stencil - \revert TabVoice.MultiMeasureRestNumber.stencil - \revert TabVoice.MultiMeasureRestText.stencil + \revert TabStaff.Rest.stencil + \revert TabStaff.MultiMeasureRest.stencil + \revert TabStaff.MultiMeasureRestNumber.stencil + \revert TabStaff.MultiMeasureRestText.stencil % markups etc. - \revert TabVoice.Glissando.stencil - \revert TabVoice.Script.stencil - \revert TabVoice.TextScript.stencil - \revert TabVoice.TextSpanner.stencil + \revert TabStaff.Glissando.stencil + \revert TabStaff.Script.stencil + \revert TabStaff.TextScript.stencil + \revert TabStaff.TextSpanner.stencil \revert TabStaff.Arpeggio.stencil \revert TabStaff.NoteColumn.ignore-collision } @@ -553,25 +630,29 @@ showSplitTiedTabNotes = { %% text length textLengthOn = { - \override TextScript.extra-spacing-width = #'(0 . 0) + % 0.4 staff-space between adjacent texts + \override TextScript.extra-spacing-width = #'(-0.0 . 0.4) \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0) - \override TextScript.outside-staff-horizontal-padding = #0 } textLengthOff = { \override TextScript.extra-spacing-width = #'(+inf.0 . -inf.0) \override TextScript.extra-spacing-height = #'(0 . 0) - \revert TextScript.outside-staff-horizontal-padding } markLengthOn = { - \override Score.MetronomeMark.extra-spacing-width = #'(-0.5 . 0.5) + \override Score.MetronomeMark.extra-spacing-width = #'(0 . 1.0) \override Score.RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5) + % Raise as much as four staff-spaces before pushing notecolumns right + \override Score.MetronomeMark.extra-spacing-height = #'(4 . 4) + \override Score.RehearsalMark.extra-spacing-height = #'(4 . 4) } markLengthOff = { \override Score.MetronomeMark.extra-spacing-width = #'(+inf.0 . -inf.0) \override Score.RehearsalMark.extra-spacing-width = #'(+inf.0 . -inf.0) + \revert Score.MetronomeMark.extra-spacing-height + \revert Score.RehearsalMark.extra-spacing-height } %% text spanners @@ -590,7 +671,7 @@ tieNeutral = \revert Tie.direction % dash-patterns (make-simple-dash-definition defined at top of file) tieDashPattern = -#(define-music-function (parser location dash-fraction dash-period) +#(define-music-function (dash-fraction dash-period) (number? number?) (_i "Set up a custom style of dash pattern for @var{dash-fraction} ratio of line to space repeated at @var{dash-period} interval for ties.") @@ -601,9 +682,9 @@ ratio of line to space repeated at @var{dash-period} interval for ties.") tieDashed = \override Tie.dash-definition = #'((0 1 0.4 0.75)) tieDotted = \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)) + (0.5 1 1 1)) tieHalfSolid = \override Tie.dash-definition = #'((0 0.5 1 1) - (0.5 1 0.4 0.75)) + (0.5 1 0.4 0.75)) tieSolid = \revert Tie.dash-definition @@ -630,35 +711,30 @@ voiceOneStyle = { \override NoteHead.style = #'diamond \override NoteHead.color = #red \override Stem.color = #red - \override Flag.color = #red \override Beam.color = #red } voiceTwoStyle = { \override NoteHead.style = #'triangle \override NoteHead.color = #blue \override Stem.color = #blue - \override Flag.color = #blue \override Beam.color = #blue } voiceThreeStyle = { \override NoteHead.style = #'xcircle \override NoteHead.color = #green \override Stem.color = #green - \override Flag.color = #green \override Beam.color = #green } voiceFourStyle = { \override NoteHead.style = #'cross \override NoteHead.color = #magenta \override Stem.color = #magenta - \override Flag.color = #magenta \override Beam.color = #magenta } voiceNeutralStyle = { \revert NoteHead.style \revert NoteHead.color \revert Stem.color - \revert Flag.color \revert Beam.color } @@ -666,21 +742,41 @@ voiceNeutralStyle = { %% volta brackets allowVoltaHook = -#(define-void-function (parser location bar) (string?) +#(define-void-function (bar) (string?) (allow-volta-hook bar)) %% x notes -xNotesOn = -#(define-music-function (parser location) () - (_i "Set the default note head style to a cross-shaped style.") - (override-head-style '(TabNoteHead NoteHead) 'cross)) +#(define (cross-style grob) +;; Returns the symbol 'cross to set the 'style-property for (Tab-)NoteHead. +;; If the current text-font doesn't contain the glyph set 'font-name to '() +;; and 'font-family to 'feta. +;; If 'feta is replaced by another music-font without cross-style-glyphs +;; note-head.cc throws a warning and no visual output happens. + (let* ((layout (ly:grob-layout grob)) + (props (ly:grob-alist-chain grob)) + (font (ly:paper-get-font layout props)) + (font-unknown? (string=? (ly:font-name font) "unknown"))) + (if font-unknown? + (begin + (ly:grob-set-property! grob 'font-name '()) + (ly:grob-set-property! grob 'font-family 'feta))) + 'cross)) + +%% Set the default note head style to a cross-shaped style. +xNotesOn = { + \temporary \override NoteHead.style = #cross-style + \temporary \override TabNoteHead.style = #cross-style +} + xNotesOff = \defaultNoteHeads -xNote = -#(define-music-function (parser location note) (ly:music?) - (_i "Print @var{note} with a cross-shaped note head.") - (style-note-heads '(TabNoteHead NoteHead) 'cross note)) +xNote = +#(define-music-function (note) (ly:music?) + (_i "Print @var{note} with a cross-shaped note head.") + (if (eq? (ly:music-property note 'name) 'NoteEvent) + #{ \tweak style #cross-style $note #} + #{ \xNotesOn $note \xNotesOff #})) %% dead notes (these need to come after "x notes")