Jump to content

Printing bar numbers for broken measures: Difference between revisions

From LilyPond wiki
m New category
mNo edit summary
 
Line 1: Line 1:
By default a <code>BarNumber</code> of a broken measure is not repeated at the beginning of the new line. Use <code>first-bar-number-invisible-save-broken-bars</code> for <code>barNumberVisibility</code> to get a parenthesized <code>BarNumber</code> there.
By default, a bar number of a broken measure is not repeated at the beginning of the new line. Use <code>first-bar-number-invisible-save-broken-bars</code> for <code>barNumberVisibility</code> to get a parenthesized <code>BarNumber</code> there.


<lilypond version="2.24" full>
<lilypond version="2.24">
\layout {
\layout {
   \context {
   \context {
Line 11: Line 11:


\relative c' {
\relative c' {
   c1 | d | e | f2 \bar "" \break
   c1 | d | e | f2 \break
   fis | g1 | e2 \bar "" \break
   fis2 | g1 | e2 \break
   <>^"reenabled default"
   <>^"reenabled default"
   % back to default -
   % back to default -
Line 18: Line 18:
   \set Score.barNumberVisibility =  
   \set Score.barNumberVisibility =  
     #first-bar-number-invisible-and-no-parenthesized-bar-numbers
     #first-bar-number-invisible-and-no-parenthesized-bar-numbers
   es | d1 | c  
   es2 | d1 | c  
}
}
\paper { tagline = ##f }
</lilypond>
</lilypond>



Latest revision as of 15:40, 30 November 2025

By default, a bar number of a broken measure is not repeated at the beginning of the new line. Use first-bar-number-invisible-save-broken-bars for barNumberVisibility to get a parenthesized BarNumber there.

\version "2.24"

\layout {
  \context {
    \Score
    barNumberVisibility = #first-bar-number-invisible-save-broken-bars
    \override BarNumber.break-visibility = ##(#f #t #t)
  }
}

\relative c' {
  c1 | d | e | f2 \break
  fis2 | g1 | e2 \break
  <>^"reenabled default"
  % back to default -
  % \unset Score.barNumberVisibility would do so as well
  \set Score.barNumberVisibility = 
    #first-bar-number-invisible-and-no-parenthesized-bar-numbers
  es2 | d1 | c 
}