%% Generated by lilypond-book.py
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************



\paper {
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}





% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "flute-slap-notation.ly"
\sourcefileline 0
%% DO NOT EDIT this file manually; it is automatically
%% generated from LSR http://lsr.dsi.unimi.it
%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
\version "2.16.0"

\header {
%% Translation of GIT committish: e99967817ff985eb5bd5b0220b2fbf552963f9de
  texidocfr = "
L'indication d'une technique particulière d'articulation, telle le
@qq{coup de langue} des flûtistes, en remplaçant la tête de note par un
glyphe approprié.

"
  doctitlefr = "Coup de langue à la flûte"

  lsrtags = "contemporary-notation, winds"

  texidoc = "
It is possible to indicate special articulation techniques such as a
flute @qq{tongue slap} by replacing the note head with the appropriate
glyph.

"
  doctitle = "Flute slap notation"
} % begin verbatim


slap =
#(define-music-function (parser location music) (ly:music?)
#{
  \override NoteHead #'stencil =
  #(lambda (grob)
     (grob-interpret-markup grob
      (markup #:musicglyph "scripts.sforzato")))
  \override NoteHead #'stem-attachment =
  #(lambda (grob)
     (let* ((thickness (ly:staff-symbol-line-thickness grob))
            (stem (ly:grob-object grob 'stem))
            (dir (ly:grob-property stem 'direction UP)))
       (cons 1 (+ (if (= dir DOWN)
                      0.5
                      0)
                  (/ thickness 2)))))
  $music
  \revert NoteHead #'stencil
  \revert NoteHead #'stem-attachment
#})

\relative c' {
  c4 \slap c d r
  \slap { g4 a } b r
}



% ****************************************************************
% end ly snippet
% ****************************************************************
