Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
LilyPond wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Printing only odd bar numbers
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
To print only the odd bar numbers you must set the <code>barNumberVisibility</code> * to a mode showing all bar numbers * based on a calculation of the bar numbers to be visible. Moreover, the <code>Score.BarNumber #'break-visibility</code> should be overridden e.g. to <code>#all-visible</code> This is best placed in a <code>\layout</code> block to keep the music part "clean". The first bar number can also be printed by inserting <code>\bar ""</code> before the music. <span class="small">This modulo function can also be used in a more general way!</span> <lilypond version="2.24.0"> %% http://lsr.di.unimi.it/LSR/Item?id=712 %LSR modified/updated by P.P.Schneider on Feb 15, 2014. \layout { \context { \Score barNumberVisibility = #all-bar-numbers-visible % this line hereunder is just to fix a v2.18.0 bug (P.P.Schneider Feb.2014) % (see : http://lilypond.1069038.n5.nabble.com/Bar-number-on-odd-bars-does-not-work-on-new-release-td157263.html) barNumberVisibility = #(lambda (n x) (= (modulo n 2) 1)) % for higher version use : %barNumberVisibility = #(modulo-bar-number-visible 2 1) % or 2 0 to see the even bar numbers \override BarNumber.break-visibility = #all-visible } } \new Staff { \bar "" \repeat unfold 8 { c'2 c' } } </lilypond> [[Category:Staff notation]]
Summary:
Please note that all contributions to LilyPond wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Meta:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Printing only odd bar numbers
Add topic