From 9c0bf4c3661da7668d8073e8ffb7035b78efa9df Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 1 Dec 2015 20:21:33 +0100 Subject: [PATCH] Issue 4680: Improve flute-slap-notation snippet It needed proper pairing of \temporary \override with \revert --- .../snippets/new/flute-slap-notation.ly | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/snippets/new/flute-slap-notation.ly diff --git a/Documentation/snippets/new/flute-slap-notation.ly b/Documentation/snippets/new/flute-slap-notation.ly new file mode 100644 index 0000000000..b18de49510 --- /dev/null +++ b/Documentation/snippets/new/flute-slap-notation.ly @@ -0,0 +1,38 @@ +\version "2.19.22" + +\header { + 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" +} +slap = +#(define-music-function (music) (ly:music?) +#{ + \temporary \override NoteHead.stencil = + #(lambda (grob) + (grob-interpret-markup grob + (markup #:musicglyph "scripts.sforzato"))) + \temporary \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 +} -- 2.39.2