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