lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: So, slashed beamed grace notes...


From: Gilberto Agostinho
Subject: Re: So, slashed beamed grace notes...
Date: Wed, 23 Oct 2013 14:30:13 -0700 (PDT)

Hi David,

I slightly modified the constants in your function and the result now is
looking even better (in my opinion, the slashes tend to be in a better
position now). This is the modified code:

%%%%% A better slash snippet %%%

\version "2.17.29"

 slash = { 
  #(remove-grace-property 'Voice 'Stem 'direction) 
  \once \override Stem #'stencil = 
  #(lambda (grob) 
    (let* ((x-parent (ly:grob-parent grob X)) 
           (is-rest? (ly:grob? (ly:grob-object x-parent 'rest)))) 
     (if is-rest? 
      empty-stencil 
      (let* ((dir (ly:grob-property grob 'direction)) 
             (stem (ly:stem::print grob)) 
             (stem-y (ly:grob-extent grob grob Y)) 
             (stem-length (- (cdr stem-y) (car stem-y)))
             (corr (if (= dir 1) (car stem-y) (cdr stem-y))))
       (ly:stencil-add 
        stem 
        (grob-interpret-markup grob 
         (markup #:translate (cons -0.5 (+ corr (* dir (1- (/ stem-length
1.1))))) 
          #:draw-line (cons 1.9 (* dir 1.7)))))))))
} 
\new Staff { 
  \relative c'' { 
    \acciaccatura {\slash g8[ a b c ] } d4 
    \acciaccatura {\slash g8[ a b c ] } d4 
    \acciaccatura {\slash g8[ a b c ] } d4 
    \acciaccatura {\slash g8[ a b c ] } d4 
  } 
  \relative c' { 
    \clef bass 
    \acciaccatura {\slash d8[ c b a ] } g4 
    \acciaccatura {\slash d8[ c b a ] } g4 
    \acciaccatura {\slash d8[ c b a ] } g4 
    \acciaccatura {\slash d8[ c b a ] } g4 
  } 
} 

Take care,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/So-slashed-beamed-grace-notes-tp152817p152866.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]