]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/flute-slap-notation.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / new / flute-slap-notation.ly
1 \version "2.19.22"
2
3 \header {
4   lsrtags = "contemporary-notation, winds"
5
6   texidoc = "
7 It is possible to indicate special articulation techniques such as a
8 flute @qq{tongue slap} by replacing the note head with the appropriate
9 glyph.
10
11 "
12   doctitle = "Flute slap notation"
13 }
14 slap =
15 #(define-music-function (music) (ly:music?)
16 #{
17   \temporary \override NoteHead.stencil =
18   #(lambda (grob)
19      (grob-interpret-markup grob
20       (markup #:musicglyph "scripts.sforzato")))
21   \temporary \override NoteHead.stem-attachment =
22   #(lambda (grob)
23      (let* ((thickness (ly:staff-symbol-line-thickness grob))
24             (stem (ly:grob-object grob 'stem))
25             (dir (ly:grob-property stem 'direction UP)))
26        (cons 1 (+ (if (= dir DOWN)
27                       0.5
28                       0)
29                   (/ thickness 2)))))
30   #music
31   \revert NoteHead.stencil
32   \revert NoteHead.stem-attachment
33 #})
34
35 \relative c' {
36   c4 \slap c d r
37   \slap { g4 a } b r
38 }