[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

Bar numbers

Bar numbers are printed by default at the start of the line. The number itself is a property that can be set by modifying the currentBarNumber property, although that is usually not necessary, i.e.

       \property Score.currentBarNumber = #217
     

To typeset Bar Numbers at regular intervals instead of at the beginning of each line, you need to change the grob property break-visibility as well as the translator property barNumberVisibility, as illustrated in the following example which also adds a box around the bar numbers:

     \property Score.BarNumber \override #'break-visibility =
       #end-of-line-invisible
     \property Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
     \property Score.BarNumber \override #'molecule-callback =
       #(make-molecule-boxer 0.1 0.25 0.25 Text_item::brew_molecule)
     \property Score.BarNumber \override #'font-relative-size = #0
     

[picture of music]

If you would like the bar numbers to appear at regular intervals, but not starting from measure zero, you can use the context function, set-bar-number-visibility, to automatically set barNumberVisibility so that the bar numbers appear at regular intervals, starting from the \applycontext:

     resetBarnum = \context Score \applycontext
       #(set-bar-number-visibility 4)
     ...
     \property Score.BarNumber \override #'break-visibility =
       #end-of-line-invisible
     \mark "A" \resetBarnum
     \repeat unfold 10 c1
     \mark \default \resetBarnum
     \repeat unfold 8 c
     

[picture of music]

See also BarNumber .

BUGS

Barnumbers can collide with the StaffGroup, if there is one at the top. To solve this, You have to twiddle with the padding property of BarNumber if your score starts with a StaffGroup .

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.