lilypond-user
[Top][All Lists]
Advanced

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

Re: does the custom \dynamic function create DynamicText grobs?


From: Thomas Morley
Subject: Re: does the custom \dynamic function create DynamicText grobs?
Date: Sun, 11 Feb 2018 02:36:55 +0100

2018-02-11 2:08 GMT+01:00 Kieren MacMillan <address@hidden>:
> Hi Thomas,
>
> Thanks for the quick response.
>
>> DynamicText is caused, but you can't nuke the stencil via
>> \omit (which would be stencil-override).
>
> Ah.
>
>> But you could do it later.
>> Applying
>> \override DynamicText.after-line-breaking =
>>  #(lambda (grob) (ly:grob-set-property! grob 'stencil '()))
>> will work, though.
>
> That is like \hide rather than \omit, no?
> (At least that's how it _appears_ to behave when I apply it to my non-minimal 
> "real world" score.)
>
> For now, this works fine — I'm just trying to blank out all dynamics, so I 
> can print out a score and pencil in dynamics on the score, away from the 
> computer — but I am curious if there's a real "stencil nuke" (in case I ever 
> need to do it in an edition-engraver tweak, for example).



Well, not a real "stencil nuke", but in this case you could use
X-offset and trash the stencil as a side-effect.

At least:
{
  \override DynamicText.X-offset ={
  \override DynamicText.X-offset =
    #(lambda (grob) (ly:grob-set-property! grob 'stencil '()))
  c'1
    -\tweak before-line-breaking
      #(lambda (grob)
        (ly:grob-set-property! grob 'stencil
          (grob-interpret-markup grob "very long dynamic")))
    -#(make-music 'AbsoluteDynamicEvent)
}
    #(lambda (grob) (ly:grob-set-property! grob 'stencil '()))
  c'1
    -\tweak before-line-breaking
      #(lambda (grob)
        (ly:grob-set-property! grob 'stencil
          (grob-interpret-markup grob "very long dynamic")))
    -#(make-music 'AbsoluteDynamicEvent)
}
seems to work.
Not tested beyond this example, though.

Best,
  Harm



reply via email to

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