On Fri, 2022-03-18 at 12:11 +0100, Valentin Petzel wrote: > Let’s take a look at what’s happening here: > > if we add > \override Score.SpacingSpanner.common-shortest-duration = > #(grob-transformer 'common-shortest-duration > (lambda (grob orig) (display orig) (newline) > orig))
Many thanks - it sounds like it will worth experimenting with setting common-shortest-duration manually to common-up the appearamce of the parts. Would some syntax along the lines \override Score.SpacingSpanner.common-shortest-duration = #(make- moement '(1 . 8)) do this? (I'm doubtful because I didn't see an example in the manual - rather the statement "There is no convenient mechanism to manually override spacing. " at https://lilypond.org/doc/v2.22/Documentation/notation/horizontal-spacing-overview ) Richard > > at the beginning we will have the value of common-shortest duration > ouput. For > 1-1 this is 1/32, for 1-4 this is 1/8. To understand why this is > happening you > need to understand how Lilypond calculates the common-shortest > duration. > Basically Lilypond takes the smallest duration for each measure, and > then > counts for each one how many measures have it as smallest duration. > Then > Lilypond simply finds the duration with the highest count and returns > the > minimum of that one and base-shortest duration. > > Now this algorithm is kind of unstable. In your case you have many > measures > with 1/8th notes as shortest duration and many measures with 1/32nd > notes as > shortest duration. So if you have slightly more measures of the first > type you > will get the dense result, if you have slightly more of the second > type you > get the wide result. > > So in some sense this is "working as intended", it is just that the > algorithm > for common-shortest-duration is probably not optimal. It might be > better to > take some sort of weighted average, which would be much more stable > in such > situations. I’ll do some experimenting for this. > > Cheers, > Valentin > > Am Freitag, 18. März 2022, 10:39:10 CET schrieb Richard Shann: > > Attached are two scores which have quite similar music in them but > > LilyPond typesets one them with about twice as much horizontal > > space as > > the other. > > The documentation gives an overview of the algorithm for horizontal > > spacing but eyeballing this music I can't see any shortest-note > > differences that could trigger this. > > Any idea what might be going on? > > > > Richard Shann >