lilypond-user
[Top][All Lists]
Advanced

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

Show (and increment) bar numbers only after a double bar


From: Olivier Biot
Subject: Show (and increment) bar numbers only after a double bar
Date: Thu, 1 Nov 2012 18:34:34 +0100

Hi all,

Is there a way to display and increment bar numbers only after a double bar?

Example:

\score {
....
      a16-.-\upbow b (c) d(c) b ( | % DO NOT count the following bar,
and DO NOT print the bar number here
      a) b (c) d(c) b-\laissezVibrer      \bar "||"
      a16 (b) c(d) c(b)      \bar "||"
      a (b c d c) b-.      \bar "||"
      a b c d c b      \bar "||"
      a (b c d) c (b)      \bar "||"
      a (b) c-. d-. c b      \bar "||"
....
}


So far I only found the following labor-intensive workaround:

      \once \override Score.BarLine #'glyph-name = "|" \bar "|"
      \once \set Score.barNumberVisibility = #(lambda (bar-number
measure-position) #f)
      \set Score.currentBarNumber =  1


The LilyPond internals documentation
(http://lilypond.org/doc/v2.16/Documentation/internals/tunable-context-properties)
tells me that "Score.barNumberVisibility" only takes the current bar
number and the position within the bar as arguments, not the bar glyph
name. So maybe my request won't ever work?

My current "hack" is illustrated in the example below:


%%% START OF SNIPPET
\score {
  \new Staff \with {\remove Time_signature_engraver \remove
Clef_engraver \remove Key_engraver} {
    \relative d' {
      % Prevent bar numbers at the end of a line and permit them elsewhere:
      \override Score.BarNumber  #'break-visibility = #end-of-line-invisible
      % Increase the size of the bar number by 2:
      \override Score.BarNumber  #'font-size = #2
      % Use bold font series:
      \override Score.BarNumber  #'font-series = #'bold
      % Use italic font shape:
      \override Score.BarNumber  #'font-shape = #'italic
      % Display bar number at eavery measure:
      \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1)
      % Render bar numbers in a circle:
      \override Score.BarNumber  #'stencil = #(make-stencil-circler
0.1 0.25 ly:text-interface::print)

     \override Score.BarNumber #'self-alignment-X = #LEFT
     \set Score.barNumberVisibility = #all-bar-numbers-visible
     % Display a bar at the start of a system. Note that this requires
an empty bar to work.
     \override Score.SystemStartBar #'collapse-height = #1
     \bar ""

      \key d \minor
      \clef bass
      \time 3/8
      % Hack: start first line with "thin" double lines
      \override Score.BarLine #'glyph-name = "||" \bar "|:"
      a16-.-\upbow b (c) d(c) b (
      \once \override Score.BarLine #'glyph-name = "|" \bar "|"
      \once \set Score.barNumberVisibility = #(lambda (bar-number
measure-position) #f)
      \set Score.currentBarNumber =  1
      a) b (c) d(c) b-\laissezVibrer
      a16 (b) c(d) c(b)
      a (b c d c) b-.
      a b c d c b
      a (b c d) c (b)
      a (b) c-. d-. c b
      \bar "||"
    }
  }
  \layout {
  }
}
%%% END OF SNIPPET


What should I do to improve this?

Best regards,

Olivier



reply via email to

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