Next: , Previous: Rehearsal marks, Up: Preparing parts


8.2.4 Bar numbers

Bar numbers are printed by default at the start of the line. The number itself is stored in the currentBarNumber property, which is normally updated automatically for every measure.

     
     \repeat unfold 4 {c4 c c c} \break
     \set Score.currentBarNumber = #50
     \repeat unfold 4 {c4 c c c}

[image of music]

Bar numbers may only be printed at bar lines; to print a bar number at the beginning of a piece, an empty bar line must be added

     
     \set Score.currentBarNumber = #50
     \bar ""
     \repeat unfold 4 {c4 c c c} \break
     \repeat unfold 4 {c4 c c c}

[image of music]

Bar numbers can be typeset at regular intervals instead of at the beginning of each line. This is illustrated in the following example, whose source is available as input/test/bar-number-regular-interval.ly

[image of music]

Bar numbers can be removed entirely by removing the Bar number engraver from the score.

     
     \layout {
       \context {
         \Score
         \remove "Bar_number_engraver"
       }
     }
     \relative c''{
     c4 c c c \break
     c4 c c c
     }

[image of music]

See also

Program reference: BarNumber.

Examples: input/test/bar-number-every-five-reset.ly, and input/test/bar-number-regular-interval.ly.

Bugs

Bar numbers can collide with the StaffGroup bracket, if there is one at the top. To solve this, the padding property of BarNumber can be used to position the number correctly.


Next: , Previous: Rehearsal marks, Up: Preparing parts

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.