lilypond-user
[Top][All Lists]
Advanced

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

Re: bar numbers above StaffGroups


From: Thomas Morley
Subject: Re: bar numbers above StaffGroups
Date: Sun, 1 Jun 2014 16:25:07 +0200

2014-06-01 14:23 GMT+02:00 Orm Finnendahl <address@hidden>:
> Hi,
>
>  I'm trying to print bar numbers not only at the top of the score, but
> also above selected groups, (like brass, percussion, strings, etc.).
>
> The code below does the trick, but the bar numbers are both printed in
> columns above the topmost staff. Is there a canonical way to get them
> printed directly above the StaffGroup?
>
> I know there is a workaround by inserting an empty staff as topmost
> staff of the group with Staff_symbol_engraver and such removed,
> BarNumberEngraver enabled for that staff, keeping it alive and
> reducing its height to 0. But I guess that wouldn't work very well if
> notes on the topmost visible staff of that StaffGroup are sticking out
> at the top: All bar numbers of the StaffGroup in that line then would
> get printed way above the staff.
>
> --
> Orm
>
> \version "2.19.5"
>
> music = { \relative c' { \repeat unfold 16 { c4 d e f } } }
>
> \score {
>   <<
>     \new Staff { \music }
>     \new Staff { \music }
>     \new StaffGroup = "mygroup" \with {
>       \consists "Bar_number_engraver"
>     }
>     {
>     <<
>     \new Staff { \music }
>     \new Staff { \music }
>     >>
>   }
>   >>
>
>   \layout{
>     \context {
>       \Score
>       \override BarNumber.break-visibility = ##(#t #t #t)
>     }
>   }
> }
>
>
>
> Using "\consists "Bar_number_engraver"" doesn't seem to do anything if
> defined in a StaffGroup, but works for staffs. This is disadvantegous
> as the barnumbers above the topmost staff in a group disappear if the
> staff gets removed with \removeEmptyStaves.
>
> Below are some snippets to show what I'm talking about. Is there a way
> to make this work for a Staffgroup?
>
> --
> Orm



A first idea:

\version "2.19.5"

my-with =
\with {
      \override BarNumber.break-visibility = ##(#t #t #f)
      \consists "Bar_number_engraver"
      \consists "Staff_collecting_engraver"
      \override BarNumber.after-line-breaking = ##f
    }

mI = \relative c' { \repeat unfold 16 { c4 d e f } }
mII = \relative c' { \repeat unfold 16 s1 }

\score {
  <<
    \new Staff { \transpose c cis \mI }
    \new Staff { \transpose c d \mI }
    \new StaffGroup = "mygroup" \my-with
    {
    <<
    \new Staff { \transpose c ees \mI }
    \new Staff { \transpose c e \mI }
    >>
  }
  >>

  \layout{
    \context {
      \Score
      \override BarNumber.break-visibility = ##(#t #t #t)
    }
    \context {
      \Staff
      \RemoveEmptyStaves
      \override VerticalAxisGroup.remove-first = ##t
    }
  }
}


Though, playing around with \mI and \mII you'll notice the BArNumbers
are not removed but overlay each other, while empty staves are
removed.


Cheers,
  Harm



reply via email to

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