Jump to content

Flute slap notation: Difference between revisions

From LilyPond wiki
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
slap =
slap =
#(define-music-function (music) (ly:music?)
#(define-music-function (music) (ly:music?)
#{
  #{
  \temporary \override NoteHead.stencil = #ly:text-interface::print
    \temporary \override NoteHead.stencil =
  \temporary \override NoteHead.text =
      #ly:text-interface::print
    \markup  
    \temporary \override NoteHead.text =
    \translate #'(1 . 0)  
      \markup
    \override #'(thickness . 1.4)  
        \translate #'(1 . 0)  
    \overlay {
          \override #'(thickness . 1.4)  
      \draw-line #'(-1.2 . 0.4)
            \overlay { \draw-line #'(-1.2 . 0.4)
      \draw-line #'(-1.2 . -0.4)
                      \draw-line #'(-1.2 . -0.4) }
     }
     \temporary \override NoteHead.stem-attachment =
  \temporary \override NoteHead.stem-attachment =
      #(lambda (grob)
  #(lambda (grob)
        (let* ((stem (ly:grob-object grob 'stem))
    (let* ((stem (ly:grob-object grob 'stem))
              (dir (ly:grob-property stem 'direction UP))
            (dir (ly:grob-property stem 'direction UP))
              (is-up (eqv? dir UP)))
            (is-up (eqv? dir UP)))
          (cons dir (if is-up 0 -0.8))))
      (cons dir (if is-up 0 -0.8))))
    #music
  #music
    \revert NoteHead.stencil
  \revert NoteHead.stencil
    \revert NoteHead.text
  \revert NoteHead.text
    \revert NoteHead.stem-attachment
  \revert NoteHead.stem-attachment
  #})
#})


\relative c' {
\relative c' {
Line 32: Line 31:
</lilypond>
</lilypond>


[[Category:Contemporary notation]]
[[Category:Scheme]]
[[Category:Winds]]
[[Category:Winds]]
[[Category:Contemporary notation]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Snippet]]

Latest revision as of 11:05, 15 December 2025

It is possible to indicate special articulation techniques such as a flute “tongue slap” by replacing the note head with the appropriate glyph. For that we can draw the accent-like note head with \markup.

\version "2.24"

slap =
#(define-music-function (music) (ly:music?)
  #{
    \temporary \override NoteHead.stencil =
      #ly:text-interface::print
    \temporary \override NoteHead.text =
      \markup
        \translate #'(1 . 0) 
          \override #'(thickness . 1.4) 
            \overlay { \draw-line #'(-1.2 . 0.4)
                       \draw-line #'(-1.2 . -0.4) }
    \temporary \override NoteHead.stem-attachment =
      #(lambda (grob)
        (let* ((stem (ly:grob-object grob 'stem))
               (dir (ly:grob-property stem 'direction UP))
               (is-up (eqv? dir UP)))
          (cons dir (if is-up 0 -0.8))))
    #music
    \revert NoteHead.stencil
    \revert NoteHead.text
    \revert NoteHead.stem-attachment
  #})

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