lilypond-user
[Top][All Lists]
Advanced

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

Re: Extending bar line across ungrouped staves


From: lilypond
Subject: Re: Extending bar line across ungrouped staves
Date: Sat, 25 Feb 2012 15:57:26 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

I want to lay out a score structure with N bars of single-staff
music, followed by one bar of dual-staff music.  In my tiny
example, N is 1, but in the actual work it's larger.

My first attempt nearly works, except that I'd like the barlines
that delineate the beginning and ending of the final bar to span
across both staves:

% This is close, but the bar lines don't span the staves:
\version "2.14.2"
\score {
    \relative c' {
      e1
      <<
        { <b d g>1\fermata }
        \new Staff {
          \override Staff.TimeSignature #'stencil = ##f
          \clef bass
          <g,>1\fermata
        }
      >>
      \bar "|."
    } % relative
} % score


address@hidden suggested eliminating the simultaneous music
block << ... >> and using the StaffGroup directive to get the bar
lines to behave as I would like, but did not give a code example
of which specific bits of music should be structured within the
StaffGroup.

My first attempt at grokking his suggestion did not work.
Lilypond throws an error at the point where the parser sees the
\new StaffGroup.


\version "2.14.2"
\score {
% First N bars of single-staff music
  \new Staff { \relative c' { e1 } } % staff
% Followed consecutively by a final bar of dual-staff music
  \new StaffGroup {
    \new Staff = "treble" { <b d g>1\fermata }
    \new Staff = "bass" {
      \clef bass
      <g,>1\fermata
    } % bass staff
  } % StaffGroup
} % score


The following variation on that method comes close, with the bar lines
now appearing as desired, but the final bar of the treble staff doesn't
coincide with the final bar of the bass staff.  Indeed, the two staves
within the group don't contain the same number of bars, owing to the
nature of my problem: how to have N bars of single staff and one final
bar of dual staff.  The treble staff has N+1 bars and the bass staff
has only 1 bar, which doesn't seem like the correct way to tell lilypond
what I want.  Still, this example is almost as close as my original
example, it just solves a different 90% of the problem.

% This has the barlines as desired, but the final bars aren't simultaneous
\version "2.14.2"
\score {
  \new StaffGroup {
    \new Staff = "treble" \relative c' { e1 <b d g>1\fermata }
    \new Staff = "bass" {
      \override Staff.TimeSignature #'stencil = ##f
      \clef bass
      <g,>1\fermata
    } % bass staff
    \bar "|."
  } % StaffGroup
} % score


Can someone please post code that achieves the alignment of the
first example, and the spanned bar lines of the third example?


Thank you!


Jim



reply via email to

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