lilypond-user
[Top][All Lists]
Advanced

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

Re: Grace note beams won't hide correctly


From: Aaron Hill
Subject: Re: Grace note beams won't hide correctly
Date: Thu, 04 Jul 2019 14:50:17 -0700
User-agent: Roundcube Webmail/1.3.8

On 2019-07-04 2:02 pm, Ben wrote:
This is the first time I've encountered the need to hide /grace note/
beams and/or stems. Can someone show me what I am doing wrong?

Here's my attempt, though it may not be the most ideal:

%%%%
\version "2.19.82"
\language "english"

overlaySlash = #(define-music-function
    (thickness length angle offset)
    (number? number? number? number-pair?)
  #{ \once \override Beam.stencil =
    #(grob-transformer 'stencil (lambda (grob orig)
      (let ((th (* (ly:staff-symbol-line-thickness grob) thickness))
            (x (interval-start (ly:stencil-extent orig X)))
            (y (interval-start (ly:stencil-extent orig Y)))
            (hl (/ length 2)))
        (ly:stencil-add orig
          (ly:stencil-translate
            (ly:stencil-rotate
              (make-line-stencil th (- hl) 0 hl 0)
              angle 0 0)
            (cons (+ x (car offset)) (+ y (cdr offset)))))))) #})

noStem = \omit Stem

\relative c' {
  \overlaySlash 1.2 7 35 #'(2 . -1)
  \appoggiatura {
    e!8^[ \noStem g! c! fs bf ef
    bf fs c! \undo \noStem e,!]
  }
  \noStem df4
}
%%%%


-- Aaron Hill

Attachment: grace-no-stems.cropped.png
Description: PNG image


reply via email to

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