]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/flute-slap-notation.ly
Issue 4507/5: Update snippet changing-properties-for-individual-grobs.ly
[lilypond.git] / Documentation / snippets / flute-slap-notation.ly
index 9d5842a451962fc4e7f377d394bd87ee433cafd2..cdbe9fa6c2cb626089d4cb58826901936ab17f6e 100644 (file)
@@ -1,10 +1,13 @@
-%% Do not edit this file; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
+%% DO NOT EDIT this file manually; it is automatically
+%% generated from LSR http://lsr.di.unimi.it
+%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
+%% and then run scripts/auxiliar/makelsr.py
+%%
 %% This file is in the public domain.
-\version "2.13.31"
+\version "2.19.22"
 
 \header {
-  lsrtags = "winds"
+  lsrtags = "contemporary-notation, winds"
 
   texidoc = "
 It is possible to indicate special articulation techniques such as a
@@ -16,22 +19,27 @@ glyph.
 } % begin verbatim
 
 slap =
-#(define-music-function (parser location music) (ly:music?)
+#(define-music-function (music) (ly:music?)
 #{
-  \override NoteHead #'stencil =
-    #(lambda (grob)
-       (grob-interpret-markup grob
-        (markup #:musicglyph "scripts.sforzato")))
-  \override NoteHead #'stem-attachment =
-    #(lambda (grob)
-       (let ((thickness (ly:staff-symbol-line-thickness grob)))
-         (cons 1 (/ thickness 2))))
+  \override NoteHead.stencil =
+  #(lambda (grob)
+     (grob-interpret-markup grob
+      (markup #:musicglyph "scripts.sforzato")))
+  \override NoteHead.stem-attachment =
+  #(lambda (grob)
+     (let* ((thickness (ly:staff-symbol-line-thickness grob))
+            (stem (ly:grob-object grob 'stem))
+            (dir (ly:grob-property stem 'direction UP)))
+       (cons 1 (+ (if (= dir DOWN)
+                      0.5
+                      0)
+                  (/ thickness 2)))))
   $music
-  \revert NoteHead #'stencil
-  \revert NoteHead #'stem-attachment
+  \revert NoteHead.stencil
+  \revert NoteHead.stem-attachment
 #})
 
 \relative c' {
-  c4 \slap c d r \slap { g a } b r
+  c4 \slap c d r
+  \slap { g4 a } b r
 }
-