lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom bar numbering format


From: Simon Albrecht
Subject: Re: Custom bar numbering format
Date: Sat, 7 Jul 2018 14:10:16 +0200

Hi David,

please read more carefully: the explanations in the manual are for that which Kyle said he can already do independently. Combining the two is the issue, which requires an approach like the one Noeck proposed.

Best, Simon


On 06.07.2018 23:32, David Kastrup wrote:
Kyle Baldwin <address@hidden> 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"]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]