[Top][All Lists]

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

Re: Irregularity in horizontal spacing

From: Urs Liska
Subject: Re: Irregularity in horizontal spacing
Date: Mon, 23 Nov 2015 09:49:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Just to finish this thread up (apart from the opened issue) I'll report
how I finally dealt with the issue in my score.

It turns out that
    \override SpacingSpanner.uniform-stretching = ##t
is what I need to make the overall appearance of the score much better
than default. This completely suppresses the optical spacing of the
semiquavers but that is much less an issue than the default look.

However, this leads to a number of cases where the last semiquaver of a
beat is too close to the next item (see first
attachment for an example). I found that
    \once \override NoteHead.extra-spacing-width = #'(0 . 2)
seems the way to work around this for an individual instance (see second

In order to make that manageable I wrote the following function (using
the edition-engraver)

extraSpace =
#(define-void-function (extra-space measure beat)((pair?) integer? integer?)
   (let* ((semiquaver (- (* beat 4) 1))
          (measurepos (cons semiquaver 16))
          (space (or extra-space (cons 0 2))))
     #{ \editionMod fullscore #measure #measurepos the.swan.Staff.B
        \once \override NoteHead.extra-spacing-width = #space #}))

which allows me to simply write
    \extraSpace 3 3
to apply the tweak to beat 3 in measure 3
    \extraSpace #'(0 . 5) 3 6
to apply the tweak to beat 6 in measure 3, but with a custom value.

To make that even more manageable I wrote the wrapper function

extraSpaces =
#(define-void-function (spaces)(list?)
    (lambda (space)
      #{ \extraSpace #(car space) #(cdr space) #})

which now allows me to write

\extraSpaces #'((3 . 3)
                (3 . 6))



Am 21.11.2015 um 01:06 schrieb Urs Liska:
> Am 21.11.2015 um 00:01 schrieb Simon Albrecht:
>> On 20.11.2015 23:19, Urs Liska wrote:
>>> -------- Weitergeleitete Nachricht --------
>>> Betreff: Re: Irregularity in horizontal spacing
>>> Datum: Fri, 20 Nov 2015 23:04:42 +0100
>>> Von: Urs Liska <address@hidden>
>>> An: address@hidden
>>> Am 20.11.2015 um 17:09 schrieb tisimst:
>>>> Are you referring to the final 16ths in each of the beamed groups in
>>>> the
>>>> center stave?
>>> What I mean is: These final 16ths look pretty good, but they cause the
>>> corresponding 8th notes in the top and bottom staff to be spaced pretty
>>> irregularly. And in effect inacceptably.
>>> As I have to get that score ready ASAP I can't wait for a proper fix (if
>>> it should be considered a bug) but need a workaround that works better
>>> than having to space the notes in all measures manually.
>> Well, I agree that this is a grave problem, and all the more grave
>> since it’s difficult to work around. 
> +1
> Not spectacular but a serious issue (although probably rather low in
> LilyPond's issue categorization ...)
>> I now see Trevor could come up with two ways, but both seem to turn
>> off optical spacing altogether.
> Yes, both are not fully satisfactory. But for my cause the looks with
> uniform-stretch is usually significantly better.
> Although in some situations the default spacing is actually better.
> I've attached another measure where uniform-stretching (first
> attachment) causes the stems in the right hand to look really awkward
> while the default (second attachment) is way superior but still leaves
> the quavers in an acceptable shape.
> I have the impression I can't change this along the way by overriding in
> the music itself, so I think I'll settle for the uniform-stretch as a
> default and tweak individually if necessary.
>> It seems like the spacing engine just does not take the quavers into
>> account, which would mean making some sort of a compromise between
>> optimal spacing for the semiquavers and the quavers. 
> I'm not sure if we can even hope to have a machine do that decision in a
> reliable manner. So maybe it would be more likely to be successful if we
> could provide a property that for example sets an affinity (or whatever
> it should be called) to a certain duration. I.e. sth like "prefer
> quavers over semiquavers for nice (optical) spacing.
>> This is really deep down in the spacing engine and I’m pretty sure
>> that it’s unconfigurable. The question is: whom do we have that might
>> be able to provide a fix? :-( Jan? Han-Wen? (they’ve rather completely
>> left the project, haven’t they?) Mike? Graham? Or David K., are you
>> somewhat acquainted with that area of the source?
> Maybe Keith would be willing to give a look? (see
> http://lilypondblog.org/2014/02/massive-improvement-in-lilyponds-horizontal-spacing/
> and the massive improvement Keith achieved in that area)
>> At least I’ve created
>> <https://sourceforge.net/p/testlilyissues/issues/4665/> – not a
>> Defect, but an Enhancement, since it’s about functionality that we
>> just don’t have currently…
> Thank you.
> I've updated it with some more score attachments.
> Best
> Urs
>> Yours, Simon
> _______________________________________________
> bug-lilypond mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-lilypond

Attachment: schwan.png
Description: PNG image

Attachment: schwan.png
Description: PNG image

reply via email to

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