]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/flute-slap-notation.ly
Doc build: use separate argument for extension and new Example macro.
[lilypond.git] / Documentation / snippets / flute-slap-notation.ly
index e7807527150a8a55b81b6a9fb406b556658d5250..805b623e2931222ce9b0fbf3157c91cd2fce1381 100644 (file)
@@ -8,7 +8,7 @@
 
   texidoc = "
 It is possible to indicate special articulation techniques such as a
-flute's \"tongue slap\" by replacing the note head with the appropriate
+flute @qq{tongue slap} by replacing the note head with the appropriate
 glyph.
 
 "
@@ -18,13 +18,17 @@ glyph.
 slap =
 #(define-music-function (parser location music) (ly:music?)
 #{
-  \override NoteHead #'stencil = #(lambda (grob)
-    (grob-interpret-markup grob
-      (markup #:musicglyph "scripts.sforzato")))
-  \override NoteHead #'extra-offset = #'(0.1 . 0.0)
+  \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))))
   $music
   \revert NoteHead #'stencil
-  \revert NoteHead #'extra-offset
+  \revert NoteHead #'stem-attachment
 #})
 
 \relative c' {