lilypond-user
[Top][All Lists]
Advanced

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

Re: help!


From: Jean Abou Samra
Subject: Re: help!
Date: Tue, 1 Feb 2022 23:04:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0



Le 01/02/2022 à 18:34, Valentin Petzel a écrit :
Thank you. As it seems prior to 2.23 the Volta Bracket engraver would override
the text property even if you had manually specified this. So we can either
directly modify this in the repeat command (which I consider a bit ugly), or
try some workaround like this: (Basically this checks if details.text is set
and sets text to details.text if so before calculating the stencil):

\version "2.22"

{
   \override Score.VoltaBracket.stencil =
   #(lambda (grob)
      (let* ((det (ly:grob-property grob 'details))
             (det-text (assoc-get 'text det #f)))
        (if (markup? det-text)
            (ly:grob-set-property! grob 'text det-text))
        (ly:volta-bracket-interface::print grob)))
   \repeat volta 2 {
     c' d' e' f'
   }
   \alternative {
     {
       \once\override Score.VoltaBracket.details.text = \markup\smaller"bla
bla"
       \once\override Score.VoltaBracket.shorten-pair = #'(0.1 . 1.1)
       g' a' b' c'' \mark\markup\smaller\smaller\musicglyph #"scripts.segno"
     }
     {
       \once\override Score.VoltaBracket.details.text = \markup\smaller"blu
blu"
       \once\override Score.VoltaBracket.shorten-pair = #'(2.2 . -0.1)
       c'1
     }
   }
}


Or use:

\version "2.22"

{
  \repeat volta 2 {
    c' d' e' f'
  }
  \alternative {
    {
      \overrideProperty Score.VoltaBracket.text \markup\smaller"bla bla"
      \once\override Score.VoltaBracket.shorten-pair = #'(0.1 . 1.1)
      g' a' b' c'' \mark\markup\smaller\smaller\musicglyph #"scripts.segno"
    }
    {
      \overrideProperty Score.VoltaBracket.text \markup\smaller"blu blu"
      \once\override Score.VoltaBracket.shorten-pair = #'(2.2 . -0.1)
      c'1
    }
  }
}


\overrideProperty is the typical workaround for this
kind of issue as it operates later than \override
(at engraver acknowledge time) and thus can override
decisions made in the meantime.

Best,
Jean





reply via email to

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