lilypond-user
[Top][All Lists]
Advanced

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

Re: Whiteout staff lines behind beams


From: Abraham Lee
Subject: Re: Whiteout staff lines behind beams
Date: Wed, 21 Dec 2022 07:42:45 -0700



On Wed, Dec 21, 2022 at 3:09 AM Jean Abou Samra <jean@abou-samra.fr> wrote:
Le 21/12/2022 à 01:26, Abraham Lee a écrit :
> Is there a way to turn the stencil into a composite of the original
> with a big block of whiteout that follows the entire group's outer
> skyline so it hides the staff lines? Would be a nice feature, IMO. I
> know the stems can be "frenched", but would be cool if the staff lines
> could be instead.



This has become somewhat easier to do in 2.24 with the new skyline
functions.

\version "2.24"

\layout {
   #(use-modules (ice-9 match)
                 (srfi srfi-1))
   \context {
     \Score
     \override Beam.stencil =
       #(grob-transformer
         'stencil
         (lambda (grob orig)
           (define (sanitize lst)
             (filter (match-lambda ((x . y) (and (finite? x) (finite? y))))
                     lst))
           (match-let* (((down . up) (ly:skylines-for-stencil orig X))
                        (down-points (sanitize (ly:skyline->points down X)))
                        (up-points (sanitize (ly:skyline->points up X))))
             (ly:stencil-add
              (stencil-with-color
               (ly:round-polygon
                (append-reverse down-points up-points)
                0.0)
               "white")
              orig))))
     \override Stem.layer = 10
   }
}

\language "english"

\relative {
   \clef bass
   \time 4/4
   f8 g16 a b c df e f e df c b a g f |
   e8 f16 g a b c df e df c b a g f e |
}

This is so cool! I am definitely going to have to try this out on more complicated stuff to see what I think. Could be my new go-to!

I have tried and tried (using after-line-breaking, yes I know, I shouldn't abuse that anymore...), but my Scheme chops are just not this good. All your recent solutions have me in awe. I definitely need more understanding of what you've done here. I've had many other ideas that I've wanted to implement, but never succeeded at.

Thanks for giving me hope,
Abraham



reply via email to

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