lilypond-user
[Top][All Lists]
Advanced

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

Re: Text Spanner auto expand to end of duration


From: Dimitris Marinakis
Subject: Re: Text Spanner auto expand to end of duration
Date: Sat, 6 Feb 2021 21:07:19 +0200

Aha! Found the culprit. As you can see if other staves have different durations (shorter than the span that needs to be covered), the spanner terminates at the first next duration it finds. Could you make the spanner to see only the relevant duration of the context it is applied to? Voice, Staff etc.?
Apologies for the redundant erroneous mails. 
Dimitris
%%%%%%%%%%%%%%%%%%%%%
\version "2.23.0"

#(define (encompass-spanner-duration grob)
   (let* ((rb (ly:spanner-bound grob RIGHT))
          (right-col (ly:item-get-column rb))
          (right-neighbor (ly:grob-object right-col 'right-neighbor)))
     (if (ly:grob? right-neighbor)
         (ly:spanner-set-bound! grob RIGHT right-neighbor))))

instrumentOne = \relative c' {
  \partCombineAutomatic
  c4 d e f |
  R1 |
  \override TrillSpanner.after-line-breaking =
  #encompass-spanner-duration
  d'2\startTrillSpan c | b a |
  b2  g2 | f1\stopTrillSpan |
  e1 |
}

instrumentTwo = \relative g' {
  R1 |
  R1 |
  R1 |
  R1 |
  R1 |
  R1 |
  R1 |
}

instrumentThree = \relative g' {
  a4 b c d e f d e c b a d g f e d c b c d e f e d c1
}

<<
  \new Staff \instrumentTwo
  \new Staff \instrumentOne
>>

<<
  \new Staff \instrumentThree
  \new Staff \instrumentOne
>>

On Sat, Feb 6, 2021 at 8:35 PM Dimitris Marinakis <dtsmarin02@gmail.com> wrote:
Excuse my mistake in the tiny example: It is supposed to be a TrillSpanner not a TextSpanner override. 
The tiny example works apparently but the issue still remains in my real-scenario file.
Sorry let me find a better example to highlight the issue in case it was a simple user-error.

On Sat, Feb 6, 2021 at 8:21 PM Dimitris Marinakis <dtsmarin02@gmail.com> wrote:
Sorry for resurrecting the thread after months. I ran into a strange bug(?) I think.
Using this code in combination with \partCombine confuses Lilypond and the spanner is terminated mid-bar where the invisible full-measure rest of the other part is hidden. 

I could tweak the right padding but honestly i'm really tired with huge amounts of manual adjustments in complex scores. Anything almost-automatic is a win for me. 

Here is a tiny example:
\version "2.23.0"
#(define (encompass-spanner-duration grob)
   (let* ((rb (ly:spanner-bound grob RIGHT))
          (right-col (ly:item-get-column rb))
          (right-neighbor (ly:grob-object right-col 'right-neighbor)))
     (if (ly:grob? right-neighbor)
         (ly:spanner-set-bound! grob RIGHT right-neighbor))))

instrumentOne = \relative c' {

 c4 d e f |
  R1 |
 \override Score.TextSpanner.after-line-breaking =
    #encompass-spanner-duration
d'2\startTrillSpan c | b a |
  b2  g2 | f1 |
  e1\stopTrillSpan |
}

instrumentTwo = \relative g' {
  R1 |
  g4 a b c |
  \override Score.TextSpanner.after-line-breaking =
    #encompass-spanner-duration
 d2\startTrillSpan c | b a |
  g2 f( | e) d |
  e1\stopTrillSpan |
}

<<
  \new Staff \instrumentOne
  \new Staff \instrumentTwo
  \new Staff \partCombine \instrumentOne \instrumentTwo
>>



Dimitris

reply via email to

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