]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/flute-slap-notation.ly
Update snippets from today's LSR with changed makelsr.py
[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.2"
8
9 \header {
10   lsrtags = "winds, contemporary-notation"
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
22 slap =
23 #(define-music-function (parser location music) (ly:music?)
24 #{
25   \override NoteHead #'stencil =
26   #(lambda (grob)
27      (grob-interpret-markup grob
28       (markup #:musicglyph "scripts.sforzato")))
29   \override NoteHead #'stem-attachment =
30   #(lambda (grob)
31      (let* ((thickness (ly:staff-symbol-line-thickness grob))
32             (stem (ly:grob-object grob 'stem))
33             (dir (ly:grob-property stem 'direction UP)))
34        (cons 1 (+ (if (= dir DOWN)
35                       0.5
36                       0)
37                   (/ thickness 2)))))
38   $music
39   \revert NoteHead #'stencil
40   \revert NoteHead #'stem-attachment
41 #})
42
43 \relative c' {
44   c4 \slap c d r
45   \slap { g4 a } b r
46 }