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: David Nalesnik
Subject: Re: So, slashed beamed grace notes...
Date: Wed, 23 Oct 2013 15:23:53 -0500

Hi,


On Wed, Oct 23, 2013 at 2:25 PM, Gilberto Agostinho <address@hidden> wrote:


I recently discussed this with some other users on this post here:
http://lilypond.1069038.n5.nabble.com/Acciaccaturas-and-slashed-stems-td150981.html#a150995

In one of the messages, an example was given illustrating the inadequacies of the snippets.  Here's a quick modification of it which makes the slash travel with the widely changing group.  No time at the moment to work with it further, but this at least is a start.

%%%%%
 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 -1 (+ corr (* dir (1- (/ stem-length 2))))) 
          #:draw-line (cons 2 (* dir 2)))))))))

\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 
  } 

reply via email to

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