lilypond-user
[Top][All Lists]
Advanced

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

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


From: Trevor Bača
Subject: Vertical spacing for fixed y-offset of systems *calculated from top staff line*?
Date: Wed, 25 May 2011 18:27:38 -0400

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.

We can approximate the visual appearance produced by older versions of Lily by nulling out the y-extent of grobs that happen to occur above the top staff line of the system in question:

%%% EX 2: EXPLICIT SYSTEM POSITIONING *WITHOUT* JUMPING STAVES W/ Y-EXTENT HACK %%%

\version "2.13.61"

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

\layout {
   \context {
      \Score
      \override BarNumber #'Y-extent = ##f
      \override NoteHead #'Y-extent = ##f
      \override Script #'Y-extent = ##f
   }
}

\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 2 %%%

Rendering example 2 shows the visual output that I want. But the problem is that nulling out the y-extent of grobs is a  bad idea (as can be seen by adding accents, ottava spanners, text spanners and so on to the music in example 2 and watching how grobs fail to position correctly).

It would appear that what's going on here is that Lily's assessment of what counts as the topmost edge of a system has changed over time: previously, the Y-offset attribute of line-break-system-details applied to the top staff line of the topmost staff in a system; now, the Y-offset attribute of line-break-system-details applies to the outermost envelope (skyline?) of the system. This makes sense. But I would really like to be able to reproduce the utterly regular vertical spacing of my previous scores using current versions of Lily.

Is there any way to achieve the vertical layout of systems that I'm looking for with modern versions of Lily?


Trevor.

--
Trevor Bača
address@hidden

reply via email to

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