lilypond-user
[Top][All Lists]
Advanced

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

Re: printing bar numbers on every odd measure


From: Alexander Kobel
Subject: Re: printing bar numbers on every odd measure
Date: Wed, 22 Sep 2010 12:16:06 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8

On 2010-09-22 12:06, Alexander Kobel wrote:
On 2010-09-22 11:47, -Eluze wrote:
On Tue, Sep 21, 2010 at 01:31:00PM -0700, -Eluze wrote:
there is also this (quite hidden& undocumented, but working!):

\override Score.BarNumber #'break-visibility = #end-of-line-invisible
\set Score.barNumberVisibility = #(modulo-bar-number-visible 2 1 )

added!

however i didn't manage to build an example where also the very first
barnumber is printed - this seems only to work when the
currentBarNumber is
explicitly set to>1

Muah, still easier is the following (without the need to change Score.barNumberVisibility again after the first bar):

%% from your mails and http://lsr.dsi.unimi.it/LSR/Item?id=504
\score {
  \new Staff {
%% The following are equivalent, but the second variant is more general:
    %% Change 2 to d in "(modulo n 2)" to show every d-th barnumber.
    %% E.g. with d=4, {1, 5, 9, 13, ...} will be shown.

    %% \set Score.barNumberVisibility = #(lambda (n) (odd? n))
    \set Score.barNumberVisibility = #(lambda (n) (= (modulo n 2) 1))
    \bar "" %% This is necessary for the first bar number to be printed.
    \repeat unfold 40 { c'4 c' c' c' }
  }

  \layout {
    \context {
      \Score
      \override BarNumber #'break-visibility = #end-of-line-invisible
    }
  }
}


Cheers,
Alexander



reply via email to

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