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: Daniel Benjamin Miller
Subject: Re: Printing two staves in the same place (overlaying)
Date: Mon, 20 Sep 2021 05:24:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

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

This works quite well for overlaying two staves.

Now, I want to do something a little more complex, but in the same way, and I'm trying to figure out the vertical axis group tweak necessary for doing this.

I want to have two staff groups, one layered on top of another.

Basically, I am already able to layer one staff on top of another --- call them A and B --- where A contains the musical content I want to include and B is a dummy staff (into which I will copy the notes of a given system as found in staff A, in order to selectively put the staff group bracket over the "one staff" A).

Basically, I am looking to do this for a grouper that encompasses two parts. Here's a mockup of what I'm trying to do:

Does anyone have advice? I've spent some time trying to tweak the vertical properties, but (so far) haven't figured it out. Of course, as a last resort, I could move the notes from one pair of parts to another at layout time, but this setup would be preferable for me if it's possible to do.

All the best,
Daniel



reply via email to

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