lilypond-user
[Top][All Lists]
Advanced

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

Re: unwanted barnumber


From: Thomas Morley
Subject: Re: unwanted barnumber
Date: Wed, 3 Oct 2012 22:33:42 +0200

2012/10/3 TaoCG <address@hidden>:
> TaoCG wrote
>>
>> thomasmorley65 wrote
>>> Sorry, forgot to answer all.
>>> Here again:
>>>
>>> 2012/10/3 TaoCG &lt;
>
>>> tao_lilyponduser@
>
>>> &gt;:
>>>> When I typeset a dashed barline in the middle of a bar lilypond prints
>>>> an
>>>> additional Barnumber in parentheses above it. Is there a way to avoid
>>>> this?
>>>
>>> Using:
>>>
>>> \relative c' {
>>>         \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
>>>         c1
>>>         d
>>>         e
>>>         c8 c c c \bar "dashed"
>>>         c c c c
>>>         \break
>>>         d1 e f
>>>         \bar "|."
>>> }
>>>
>>> I can't confirm your observation with any tested version.
>>> i.e "2.14.2", "2.16.0", "2.17.0"
>>>
>>> -Harm
>>>
>>> _______________________________________________
>>> lilypond-user mailing list
>
>>> lilypond-user@
>
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>> Ah sorry, it didn't occur to me that this might not be standard behaviour
>> (I suppose because of the parentheses, they make it look intentional).
>> I made a short snippet. Apparently the additional bar number is a result
>> of both of the overrides, comment out either and it will disappear. In my
>> score I use bar numbers every 5 measures.
>>
>> \version "2.16.0"
>>
>> {
>>   \override Score.BarNumber #'break-visibility = #end-of-line-invisible
>>   \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1)
>>   r2 \bar "dashed" r
>> }
>
> I got rid of the additional barnumber by setting the stencil to ##f just
> before the \bar command.
> Still if someone knows of an automatic way that would be great.
>
>
>
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/unwanted-barnumber-tp134059p134072.html
> Sent from the User mailing list archive at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Bit hackish, but you could use:

\version "2.16.0"

omitParenthesizedBarNumbers =
\override Score.BarNumber #'after-line-breaking =
  #(lambda (grob)
    (let* ((text (ly:grob-property grob 'text))
           (text-arg (caadr text))
           (bracket? (string-contains text-arg "(")))
    (if bracket?
      (ly:grob-set-property! grob 'stencil #f)
      #f)))

\layout {
        \context {
                \Score
                \omitParenthesizedBarNumbers
        }
}

{
  \override Score.BarNumber #'break-visibility = #end-of-line-invisible
  \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
  r1  r2  \bar "dashed" r r1 r r r r
}

HTH,
  Harm



reply via email to

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