[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Broken slurs won't overlap end-of-measure clef change
From: |
Thomas Morley |
Subject: |
Re: Broken slurs won't overlap end-of-measure clef change |
Date: |
Wed, 19 Oct 2016 09:11:33 +0200 |
2016-10-19 3:02 GMT+02:00 David Nalesnik <address@hidden>:
> On Tue, Oct 18, 2016 at 4:56 PM, Javier Ruiz-Alma <address@hidden> wrote:
>> The first segment of a slur that spans to the next system is typeset short
>> if a clef change is present at the end of the originating measure. The
>> first segment won't overlap the space above the changed clef.
>>
>> Javier Ruiz-Alma
>>
>> \version "2.18.2"
>> \score {
>> <<
>> { c''2 c''4\( c'' \break
>> c''1\)
>> c''4 c'' c'' c''( \break
>> c''1)
>> }
>> { c''1 \clef bass
>> c' c' \clef treble
>> c'
>> }
>> >>
>> \layout { ragged-right = ##t indent = 0 }
>> }
>>
>
> The problem you're seeing is that the right-bound of the slur is set
> to the *left* extent of the NonMusicalPaperColumn that encompasses the
> end materials of the line: Ordinarily, this means that a slur will end
> slightly before a barline, which looks fine. Unfortunately, the
> cautionary clef belongs to the NonMusicalPaperColumn at the end of the
> line, hence the distortion you're seeing.
>
> (The endpoint seems to be created in
> Slur_score_state::get_base_attachments in lily/slur-scoring.cc.)
>
> What's needed is the ability to align the endpoint of a slur to
> specific elements within the 'elements array of the paper column
> bound. Something like the 'break-alignable-interface which allows
> flexible alignments to grobs like BarNumber.
>
> David
Hi David,
thanks for your analysis, which reminded me, how I dealed with the
problem in the bend-engraver.
There I mimiced the default behaviour, but you can do it different, at
least manually. (Although reading a property is surely the way to go.)
As a proof of concept, setting all but last broken curve's right-bound
to BarLine:
\version "2.19.48"
#(define (set-broken-curve-right-bound grob)
(let* ((orig (ly:grob-original grob))
(siblings (if (ly:grob? orig)
(ly:spanner-broken-into orig)
'())))
(if (and (pair? siblings) (not (equal? grob (last siblings))))
(let* ((right-bound
(ly:spanner-bound grob RIGHT))
(right-bound-elts
(ly:grob-array->list (ly:grob-object right-bound 'elements)))
(bar-lines
(filter
(lambda (g) (grob::has-interface g 'bar-line-interface))
right-bound-elts)))
(if (pair? bar-lines)
(ly:spanner-set-bound! grob RIGHT (car bar-lines)))))))
resetRightBound = {
\override Slur.after-line-breaking = #set-broken-curve-right-bound
\override PhrasingSlur.after-line-breaking = #set-broken-curve-right-bound
}
\score {
<<
{ c''2 \resetRightBound c''4\( c'' \break
c''1\)
c''4 c'' c'' c''( \break
c''1)
}
{ c''1 \clef bass
c' c' \clef treble
c'
}
>>
\layout { ragged-right = ##t indent = 0 }
}
Cheers,
Harm