lilypond-user
[Top][All Lists]
Advanced

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

Re: Bar numbers under the music rather than above?


From: Mats Bengtsson
Subject: Re: Bar numbers under the music rather than above?
Date: Tue, 19 Nov 2013 14:50:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0


On 11/19/2013 02:17 PM, address@hidden wrote:
Hi,

2013/11/18 ryanmichaelmcclure<address@hidden>:
>Also (forgive my double email), would it be possible to format bar numbers?
>For example, making those that are not at the beginning of lines smaller or
>larger? This is one thing I've sort of been ignoring but the time has come
>that I finally ask -.-
Ah, that was the first thing i tried to do with Scheme, quite some
time ago.  I remember it took me over an hour to do this (and i was
just trying to adapt some existing code that i found...)
Here it is:

\override Score.BarNumber #'stencil =
#(lambda (grob)
     (let ((break-dir (ly:item-break-dir grob)))
       (set! (ly:grob-property grob 'font-size)
             (if (= break-dir RIGHT)
                 -1
                 -3))
       (ly:text-interface::print grob)))

You should be able to adapt it to do other things, for example set
direction.  If you have trouble, ask.

There's no need for any Scheme programming at all. Just add another Bar_number_engraver to the bottom stave, that takes care of the bar line numbers within each line. Then you can also easily adjust the formatting fot eh two separately. Example:

\version "2.16.0"

violin = \relative c' {\repeat unfold 20 {c d e f | g f e d | }}
viola = \relative c'{\clef alto \repeat unfold 20 {g b c d | e d c b | }}
bass = \relative c {\clef bass \repeat unfold 20 {c2 e | g g, | }}

\score{
\new StaffGroup <<
\new Staff {\override Score.BarNumber #'font-size = #+3  \violin }
\new Staff \viola
\new Staff \with{
    \consists "Bar_number_engraver"
    \override BarNumber #'direction = #down
    \override BarNumber #'font-size = #0
    \override BarNumber #'break-visibility = #begin-of-line-invisible }
    \bass
>>
}


    /Mats



reply via email to

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