lilypond-user
[Top][All Lists]
Advanced

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

Re: Printing two staves in the same place (overlaying)


From: Aaron Hill
Subject: Re: Printing two staves in the same place (overlaying)
Date: Sat, 07 Aug 2021 06:34:48 -0700
User-agent: Roundcube Webmail/1.4.9

On 2021-08-07 2:38 am, Daniel Benjamin Miller wrote:
Thanks, Silvain, but let me clarify. I want two staffs to actually be
placed in the same exact spot. So, for instance, the five lines of
each staff should be engraved in the same spot --- but everything
within the staff should be "unaware" of this fact.

You have a few options, depending on the degree of alignment you do want between the staves.

%%%%
\version "2.22.0"

staffI = \new Staff \fixed c' { g4 a b a8 g | fis4 e f2 }
staffII = \new Staff \fixed c'' { c2 d4 b, | c4 d bes,2 }

zeroSpacing = \with {
  \override VerticalAxisGroup.staff-staff-spacing =
  #'((basic-distance . 0) (minimum-distance . 0)
     (padding . -inf.0) (stretchability . 0))
}

\new StaffGroup \with \zeroSpacing << \staffI \staffII >>

\markup \overlay {
  \with-color #red \score { \staffI }
  \with-color #blue \score { \staffII }
}
%%%%

The first approach above eliminates spacing by using an extremely negative padding to permit overlapping staves within a system. The second approach uses \markup to overlap the stencils from two scores.

With the first option, there is still general time alignment between the systems, which if you do want measures to line up, that would be the way to go. With the second, each staff is completely isolated from one another. In the example above, I added color to each staff so you can better see the effect.


-- Aaron Hill

Attachment: overlap-staves.cropped.png
Description: PNG image


reply via email to

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