Kyle Baldwin <g.pit.k...@gmail.com> writes: > I'm trying to get Lilypond to replicate the way that I number scores > personally. > > When I number my own scores, the bars that get numbers are > > 1) The first bar of every staff/system > 2) Every 10 bars Regardless of location > > I can do these two things independently, but am having problems getting > them to work together. The biggest problem I have is that > Score.barNumberVisibility doesn't seem to record its own position in the > system. Does anyone have an idea of how I could accomplish this?
Bar numbers can be typeset at regular intervals instead of just at the beginning of every line. To do this the default behavior must be overridden to permit bar numbers to be printed at places other than the start of a line. This is controlled by the ‘break-visibility’ property of ‘BarNumber’. This takes three values which may be set to ‘#t’ or ‘#f’ to specify whether the corresponding bar number is visible or not. The order of the three values is ‘end of line visible’, ‘middle of line visible’, ‘beginning of line visible’. In the following example bar numbers are printed at all possible places: \relative c' { \override Score.BarNumber.break-visibility = ##(#t #t #t) \set Score.currentBarNumber = #11 % Permit first bar number to be printed \bar "" c1 | c | c | c | \break c1 | c | c | c | } [image src="lilypond/5f/lily-65039a1d.png" alt="[image of music]" text="image of music"] Selected Snippets ................. _Printing the bar number for the first measure_ By default, the first bar number in a score is suppressed if it is less than or equal to ‘1’. By setting ‘barNumberVisibility’ to ‘all-bar-numbers-visible’, any bar number can be printed for the first measure and all subsequent measures. Note that an empty bar line must be inserted before the first note for this to work. \layout { indent = 0 ragged-right = ##t } \relative c' { \set Score.barNumberVisibility = #all-bar-numbers-visible \bar "" c1 | d | e | f \break g1 | e | d | c } [image src="lilypond/ad/lily-527f7481.png" alt="[image of music]" text="image of music"] _Printing bar numbers at regular intervals_ Bar numbers can be printed at regular intervals by setting the property ‘barNumberVisibility’. Here the bar numbers are printed every two measures except at the end of the line. \relative c' { \override Score.BarNumber.break-visibility = #end-of-line-invisible \set Score.currentBarNumber = #11 % Permit first bar number to be printed \bar "" % Print a bar number every second measure \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2) c1 | c | c | c | c \break c1 | c | c | c | c } [image src="lilypond/25/lily-572e320e.png" alt="[image of music]" text="image of music"] _Printing bar numbers with changing regular intervals_ The bar number interval can be changed by changing the context function ‘{set-bar-number-visibility}’. \relative c' { \override Score.BarNumber.break-visibility = #end-of-line-invisible \context Score \applyContext #(set-bar-number-visibility 4) \repeat unfold 10 c'1 \context Score \applyContext #(set-bar-number-visibility 2) \repeat unfold 10 c } [image src="lilypond/96/lily-4ba74002.png" alt="[image of music]" text="image of music"] -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user