% property-init.ly
-\version "2.17.24"
+\version "2.19.22"
%% for dashed slurs, phrasing slurs, and ties
#(define (make-simple-dash-definition dash-fraction dash-period)
%% 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
((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
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,
%% 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))
%% incipit
incipit =
-#(define-music-function (parser location incipit-music) (ly:music?)
+#(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)
%% 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
% 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.")
%% 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))
% 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.")
% 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.")
%% 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")