lilypond-user
[Top][All Lists]
Advanced

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

Re: Cleanly showing every measure number


From: Carl Sorensen
Subject: Re: Cleanly showing every measure number
Date: Mon, 9 Dec 2019 21:10:02 +0000
User-agent: Microsoft-MacOutlook/10.10.10.191111

 

 

From: Sam Bivens <address@hidden>
Date: Monday, December 9, 2019 at 12:37 PM
To: lilypond-user <address@hidden>
Subject: Cleanly showing every measure number

 

Hi everyone,

For pedagogical reasons, I want to include every measure number in my scores. I've been using the LSR's consistently left-aligned numbers available at http://lsr.di.unimi.it/LSR/Item?id=840

But this causes problems with slurs, ledger lines, etc., which push the measure numbers up high above the given measure (see the attached MWE).

Thus I have two related questions:

ยท         How might I adjust \consistentlyLeftAlignedMeasureNumbers to keep them consistently near the staff, no matter what the music is?

If you wish to keep them near the staff at the expense of having collisions, you can just set the outside-staff-priority to ##f:

\version "2.19.82"

\language "english"

consistentlyLeftAlignedBarNumbers = {

  \override Score.BarNumber.break-visibility = #end-of-line-invisible

  \override Score.BarNumber.self-alignment-X =

    #(lambda (grob)

       (let ((break-dir (ly:item-break-dir grob)))

         (if (= break-dir RIGHT) RIGHT LEFT)))

  \override Score.BarNumber #'break-align-symbols =

    #'(staff-bar clef)

    \override Score.BarNumber.outside-staff-priority=##f

}

 

global = {

  \key c \minor

  \time 12/8

}

 

right = \relative c'' {

  \global

  s2. ef8 f16 ef d ef \slashedGrace ef8^( g'8)-. f16\(-. ef-. d-. c-. |

  cf8 bf\) bff bff16 af af[ g] g16.\( f32 ef2.\) |

}

 

\score {

  \new Staff <<

    \consistentlyLeftAlignedBarNumbers

    \right

  >>

  \layout { }

}

 

But somehow I doubt this is what you wish to see.

I am not aware of any construct that will allow you to bring bar numbers close to the staff (by making them staff objects, rather than outside staff objects) but then require the music to move away from them to avoid collisions.

The problem you are running into is that BarNumbers are outside-staff objects, and notes and slurs are staff objects.  Collision resolution moves outside-staff objects vertically to clear the staff objects.

You can get one solution the problem by modifying BarNumber.space-alist.next-note:

\version "2.19.82"

\language "english"

 

consistentlyLeftAlignedBarNumbers = {

  \override Score.BarNumber.break-visibility = #end-of-line-invisible

  \override Score.BarNumber.self-alignment-X =

    #(lambda (grob)

       (let ((break-dir (ly:item-break-dir grob)))

         (if (= break-dir RIGHT) RIGHT LEFT)))

  \override Score.BarNumber #'break-align-symbols =

    #'(staff-bar clef)

    \override Score.BarNumber.outside-staff-priority=##f

    \override Score.BarLine.space-alist.next-note = #'(minimum-space . 3)

}

 

global = {

  \key c \minor

  \time 12/8

}

 

right = \relative c'' {

  \global

  s2. ef8 f16 ef d ef \slashedGrace ef8^( g'8)-. f16\(-. ef-. d-. c-. |

  cf8 bf\) bff bff16 af af[ g] g16.\( f32 ef2.\) |

}

 

\score {

  \new Staff <<

    \consistentlyLeftAlignedBarNumbers

    \right

  >>

  \layout { }

}

I'm not a huge fan of this, because it puts the bar number down in the music, when I think it should not be confused as part of the music.  Personally, I'd just omit the bar number when it doesn't fit.

HTH,

 

Carl

 


reply via email to

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