]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/flute-slap-notation.ly
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / Documentation / snippets / flute-slap-notation.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.19.22
8 \version "2.19.22"
9
10 \header {
11   lsrtags = "contemporary-notation, winds"
12
13   texidoc = "
14 It is possible to indicate special articulation techniques such as a
15 flute @qq{tongue slap} by replacing the note head with the appropriate
16 glyph.
17
18 "
19   doctitle = "Flute slap notation"
20 } % begin verbatim
21
22 slap =
23 #(define-music-function (music) (ly:music?)
24 #{
25   \temporary \override NoteHead.stencil =
26   #(lambda (grob)
27      (grob-interpret-markup grob
28       (markup #:musicglyph "scripts.sforzato")))
29   \temporary \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 }