]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/flute-slap-notation.ly
makelsr: update (with -d).
[lilypond.git] / Documentation / snippets / flute-slap-notation.ly
1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
4 \version "2.12.2"
5
6 \header {
7   lsrtags = "winds"
8
9   texidoc = "
10 It is possible to indicate special articulation techniques such as a
11 flute @qq{tongue slap} by replacing the note head with the appropriate
12 glyph.
13
14 "
15   doctitle = "Flute slap notation"
16 } % begin verbatim
17
18 slap =
19 #(define-music-function (parser location music) (ly:music?)
20 #{
21   \override NoteHead #'stencil =
22   #(lambda (grob)
23      (grob-interpret-markup grob
24       (markup #:musicglyph "scripts.sforzato")))
25   \override NoteHead #'stem-attachment =
26   #(lambda (grob)
27      (let* ((thickness (ly:staff-symbol-line-thickness grob))
28             (stem (ly:grob-object grob 'stem))
29             (dir (ly:grob-property stem 'direction UP)))
30        (cons 1 (+ (if (= dir DOWN)
31                       0.5
32                       0)
33                   (/ thickness 2)))))
34   $music
35   \revert NoteHead #'stencil
36   \revert NoteHead #'stem-attachment
37 #})
38
39 \relative c' {
40   c4 \slap c d r
41   \slap { g4 a } b r
42 }
43