lilypond-user
[Top][All Lists]
Advanced

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

Re: Vertical spacing for fixed y-offset of systems *calculated from top


From: Trevor Bača
Subject: Re: Vertical spacing for fixed y-offset of systems *calculated from top staff line*?
Date: Fri, 27 May 2011 11:56:36 -0400



On Fri, May 27, 2011 at 7:15 AM, Joe Neeman <address@hidden> wrote:
On Thu, May 26, 2011 at 1:27 AM, Trevor Bača <address@hidden> wrote:
Hi,

I'm looking to vertically lay out systems in a very rigid and regular way. (This is the method I documented a while back in 4.4.2 'Explicit staff and system positioning' using the Y-offset and alignment-distances attributes of line-break-system-details.) The challenge is that this method produces different visual results than it used to now that the new vertical spacing code has been added into the system. Examples are the easiest way to show the difference.


Here's an example of explicit system positioning:

%%% EX 1: EXPLICIT SYSTEM POSITIONING W/ JUMPING STAVES %%%

\version "2.13.61"

\paper {
   evenHeaderMarkup = \markup \fill-line { " " }
   indent = #0
   oddHeaderMarkup = \markup \fill-line { " " }
   top-margin = 20\mm
}

\new Staff {

   %%% PAGE 1 %%%%

   \overrideProperty #"Score.NonMusicalPaperColumn"
   #'line-break-system-details #'((Y-offset . 0))
   c'1 \pageBreak

   \overrideProperty #"Score.NonMusicalPaperColumn"
   #'line-break-system-details #'((Y-offset . 0))
   c''''1

}

%%% END EX 1 %%%

Rendering example 1 shows two pages of music with one system per page. The thing to notice is that staves jump around on the page and appear at two different vertical positions on the two pages. Lily's visual output in cases like this used to be different.

Yes, this seems to be something that changed unintentionally with the new spacing code. I have a patch that gets back the old behaviour, but it has the disadvantage that it introduces millions of false positives to the automatic regression checker (the signature-based one, probably not the pixel-based one).

FWIW, I would consider Carl's solution with top-system-spacing to be "recommended" for most uses, because it allows you to fix the top system on each page, but still have lilypond do everything else automatically. But if you really want to fix the position of every system and you're happy to do manual breaks and everything, then line-break-system-details 'Y-offset is still the way to go.


Hi Joe, hi Carl,

Actually Carl's solution works perfectly. The spacing I was wanting to achieve is that there be (in this case) four systems per page with 2 staves per system (accordion music in this case) with all 8 staves (and 4 systems) at exactly the same vertical position on each page, regardless of the changing density of the music from page to page. And it turns out that the following collection of settings does exactly this for me:


\paper {
   system-system-spacing =
       #'((basic-distance . 50)
          (minimum-distance . 0)
          (padding . -10)
          (stretchability . 0))
   top-system-spacing =
       #'((basic-distance . 15)
          (minimum-distance . 0)
          (padding . -10)
          (stretchability . 0))
}

\layout {
  \context {
      \Score
      \override VerticalAxisGroup #'staff-staff-spacing =
          #'((basic-distance . 0)
             (minimum-distance . 25)
             (padding . 0)
             (stretchability . 0))
      }
  }
}


The things I had to figure out to make this work were:

1. it's important to set not only system-system-spacing but *both* system-system-spacing *and* top-system-spacing; (Carl made this clear)

2. padding for both values needs to be negative; (thanks again to Carl here!)

3. staff-staff-spacing needs to be set on VerticalAxisGroup (and not on StaffGrouper) for the 2-staves-in-one-piano-staff layout that I have; and

4. staff-staff-spacing minimum-distance behaved in such a way that it needed to be greater than or equal to a certain value (25, in this case) to have the effect of making the spacing between the two staves in each system absolutely regular; values smaller than that were allowing the two staves to collapse considerably closer to each other in a 'nonlinear' way ... but this is fixed once the size-25 threshold was crossed

And now the layout looks absolutely great :)

So, Carl, THANK YOU so much for settings; they really helped tremendously.

And, Joe, sorry to have made you perhaps unnecessarily prepare the patch accompanying the previous post. To me it would make more sense for systems to be measured from the top (or middle) staff line (or however it used to previously be) as per your new patch, but I don't think my judgment on these things is the best anyway: many wonderful improvements have shown up everywhere in the vertical spacing, and if it makes better sense for the reference to be the upper envelope of systems rather than whatever it was before, well then that's just fine with me (so long as the absolutely regular type of spacing I've described -- and now achieved -- here continues to be possible). In fact the settings shown here are MUCH better than what I was previously having to do with line-break-system-details + Y-offset + alignment-distances: previously I had to generate an entire skips-only voice to specify \break and \pageBreak information (with NonMusicalPaperColumn #'line-break-permission and #'page-break-permission both set to ##f), and insert a series of patterned but changing Y-offset / alignment-distances pairs just after every \break. I have scripts and so on to do stuff like that so that it didn't mean typing several hundred lines by hand for every new score. BUT the ability to simply create regular marching-down-the-page spacing with \paper and \layout settings is a HUGELY better deal. (And this also means that I'll now be able to have the spacing of the final publication version of the score in effect during the iterative compositional stages of its construction, too, which is particularly nice; previously all the compositional work had to happen first with no firm idea as to how the final spacing would look during those months.)

So again thank you both for the features and the explanations as how to achieve the spacing results I was looking for.

Much appreciated,


Trevor.


--
Trevor Bača
address@hidden

reply via email to

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