lilypond-user
[Top][All Lists]
Advanced

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

Re: Whiteout box function by Thomas Morley / need help


From: Karol Majewski
Subject: Re: Whiteout box function by Thomas Morley / need help
Date: Fri, 13 Jun 2014 23:45:01 +0200

Thanks, David.

 

I've looked into this, but have no idea what's going on there. Here's crippled version of extraWhiteout function - works only for TextScript and allows to set X-extent only. But still don't know how to turn this into \tweak.

 

extraWhiteout =
#(define-music-function
  (parser location adds)
  (pair?)
  (define more-stencil-whiteout
    (lambda
      (grob)
      (let*
        ((function
            (assoc-get 'stencil
              (reverse
                (ly:grob-basic-properties grob))))
          (stil
            (if
              (and
                (procedure? function)
                (not
                  (eq?
                    (procedure-name function) 'more-stencil-whiteout)))
              (function grob)
              (begin
                (ly:warning "" grob) #f))))
        (if stil
          (let*
            ((x-ext
                (ly:stencil-extent stil X))
              (add-to-x-ext
                (if
                  (pair?
                    (car adds))
                  (car adds) adds))
              (new-stil
                (ly:make-stencil
                  (ly:stencil-expr stil)
                  (offset-add x-ext add-to-x-ext)
                  (ly:stencil-extent stil Y)))) new-stil) #f))))
  #{
    \once \override TextScript.layer = #10
    \once \override TextScript.whiteout = ##t
    \once \override TextScript.stencil = #more-stencil-whiteout
  #})

%%%%%%%%%%%%%%%%%%%%%%%

musicI = { \time 2/4 \repeat unfold 16 b8 }

musicII = {
  r2
  \extraWhiteout #'(-2 . 0.5) b4 ^"XXXXXX"
  b
  r
  r^\pppp
  \extraWhiteout #'(-2 . 10.5) b4 ^"XXXXXX" b
}

\new StaffGroup <<
  \new Staff \relative c'' \musicI
  \new Staff \relative c'' \musicII
>>

 

 

 

--Karol



reply via email to

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