[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug? Accidentals from tied notes having stencils that occupy space
From: |
Thomas Morley |
Subject: |
Re: Bug? Accidentals from tied notes having stencils that occupy space |
Date: |
Tue, 3 Apr 2018 15:06:01 +0200 |
2018-04-02 19:21 GMT+02:00 Stefano Troncaro <address@hidden>:
> Hi everyone,
>
> I've experienced that in certain situations, when notes with accidentals are
> tied, the accidental grobs have stencils that seem to be hidden (not shown
> but occupy space) which creates very awkward spacing.
>
> I made this snippet to showcase this:
>>
>> \version "2.19.80"
>> \language "english"
>>
>> \paper {
>> ragged-right = ##t
>> }
>>
>> %Tied accidentals have the same placement as the untied ones,
>> %even though that with ties there should be less grobs occupying space
>> \score {
>> \relative c'' {
>> <cs gs>1 <es cs gs cs,> \break
>> <cs gs>~ <es cs gs cs,> \break
>> <es cs>~ <es cs gs cs,> \break
>> <cs cs,>~ <es cs gs cs,> \break
>> }
>> }
>>
>> %Checking that there are accidental grobs for each notehead
>> \score {
>> \relative c'' {
>> <cs cs,>~
>> \override Accidental.before-line-breaking =
>> #(lambda (grob)
>> (pretty-print grob))
>> <es cs gs cs,>
>> %Output:
>> %#<Grob Accidental >
>> %#<Grob Accidental >
>> %#<Grob Accidental >
>> %#<Grob Accidental >
>> %Showing there are 4 accidental grobs instead of only the required 2
>> }
>> }
>>
>> %Deleting the tied accidentals "fixes" placement, shouldn't this be
>> default?
>> \score {
>> \relative c'' {
>> <cs cs,>~
>> \override NoteColumn.before-line-breaking =
>> #(lambda (nc)
>> (let* ((nhds (ly:grob-array->list (ly:grob-object nc 'note-heads)))
>> (accs
>> (filter ly:grob?
>> (map
>> (lambda (nhd)
>> (ly:grob-object nhd 'accidental-grob))
>> nhds)))
>> (stils
>> (list
>> ly:accidental-interface::print
>> #f
>> ly:accidental-interface::print
>> #f)))
>> (for-each
>> (lambda (acc stil)
>> (ly:grob-set-property! acc 'stencil stil))
>> accs
>> stils)))
>> <es cs gs cs,>
>> }
>> }
>>
>
> I'm fairly confident that the accidental grobs shouldn't be taking up space
> in those cases. But maybe this is intended by design and I'm failing to see
> it's use.
>
> So, is this a bug?
Hi,
in general I'd agree calling it a bug of type ugly.
Looking for an even worse example I found:
chrd = < cis~ dis~ eis~ fis gis~ ais~ bis >1
\relative c' { \chrd q }
Though, according to common type-setting rules accidentals of tied
notes have to be repeated at line-start.
chrd = < cis~ dis~ eis~ fis gis~ ais~ bis >1
\relative c' { \chrd \break q }
This _is_ correct!
So it should be clear that simply deleting accidental-stencils via
'before-line-breaking is not the way to go.
I observed the following interesting behaviour.
If you set
AccidentalPlacement.positioning-done = ##t
i.e. don't let Lilypond place the accidentals, only _two_ accidentals
are printed.
Uncommenting the break will print all accidentals, as wished.
chrd = < cis~ dis~ eis~ fis gis~ ais~ bis >1
\relative c' {
\chrd
%\break
\override Staff.AccidentalPlacement.positioning-done = ##t
q
}
Ofcourse now no placement happens and all clashes.
Also this means it doesn't matter, whether accidental-grobs or their
stencils are present or not.
Rather that the default-procedure, i.e.
ly:accidental-placement::calc-positioning-done should be improved,
imho.
Cheers,
Harm