lilypond-user
[Top][All Lists]
Advanced

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

Re: DurationLine avoiding RehearsalMarks


From: Jean Abou Samra
Subject: Re: DurationLine avoiding RehearsalMarks
Date: Tue, 12 Apr 2022 11:54:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0



Le 12/04/2022 à 11:16, Thomas Morley a écrit :
Hi Jean,

thanks for all your work and explanations.
I'll split my answer into different mails.
This one is about the design

Am Mo., 11. Apr. 2022 um 18:04 Uhr schrieb Jean Abou Samra <jean@abou-samra.fr>:
Le 11/04/2022 à 17:20, Thomas Morley a écrit :
Well, your example prints as I would wish it should.
Alas, there are obviously different opinions. Look at:
\layout {
     \context {
       \Voice
       \consists Duration_line_engraver
     }
}

<<
     \new Staff {
           \override Glissando.breakable = ##t
           c'1(\-\startTextSpan\glissando \break s1 c''1)\stopTextSpan
     }
     \new Staff { s1 \key cis \major s1 s1 }
Not all spanners start/end equal.
Imho, it's a mess which needs design decisions.


Hm. That's right. Let's consider another example:

\version "2.23.8"

\layout {
    \context {
      \Voice
      \consists Duration_line_engraver
    }
}

\paper {
    ragged-right = ##t
}

<<
    \new Staff { c'1\- \break c'1 }
    \new Staff { c'1 \breathe c'1 }
  >>


Well, maybe it doesn't make sense anyway -- I don't think I've
ever seen a breathing sign in one staff and not another.

Though, if this is something we want to support, I think we'll
agree that the duration line in the upper staff should not be
affected by the breathing sign, as the breathing sign doesn't
apply to that staff.
I slightly disagree.

In many details DurationLine was tailored after Glissando and
Glissando _is_ effected by the breathing sign. See:

\layout {
    \context {
      \Voice
      \consists Duration_line_engraver
    }
}

\paper {
    ragged-right = ##t
}

<<
    \new Staff {
           \override Glissando.breakable = ##t
           \override Glissando.after-line-breaking = ##t
           \override DurationLine.after-line-breaking = ##t
           \override Score.RehearsalMark.break-visibility = ##(#t #t #t)
           c'1\-\glissando
           %\mark \default
           \break c''1
    }
    \new Staff {
           c'1
           \breathe
           c'1
    }
  >>

Thus any design decision should affect both, DurationLine and Glissando, imho.


Making the DurationLine affected only by breakable items in
its staff is easy to define (implementation: see below). If
we decide that we want different behaviors for different breakable
items, like KeySignature vs. BreathingSign, a definition is
going to be trickier ...
If you uncomment \mark above then DurationLine is affected and Glissando not.
That's the bug at hand, imho.
I have a fix for it in a local branch, explicitely removing
RehearsalMark from items to consider.
Isn't it sufficient here?

If you agree I'll do some polish and probably add a regtest and open a MR.



Well, if the goal is to have DurationLine similar to Glissando,
how about reusing line-spanner-interface code? I haven't reviewed
the code very thoroughly, but I assumed there was a difference
warranting a different code path. If you put
ly:line-spanner::calc-{left,right}-bound-info in
DurationLine.{left,righ}-bound-info, that gives you X values for free
in the bound info properties. Would that solve the problem?

One difference I can foresee is that line-spanner-interface callbacks
fall back to bound-details.left if there is no value in left-broken
(and same at the right) whereas DurationLine does not do this. But
maybe that ought to be uniformized regardless?

If there is a reason to keep DurationLine calculations separate, you
could go for using ly:generic-bound-extent. The line-spanner-interface
uses its C++ equivalent internally.

Best,
Jean




reply via email to

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