Hi,

On Wed, Oct 23, 2013 at 2:25 PM, Gilberto Agostinho <
gilbertohasn...@gmail.com> 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
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to