[Top][All Lists]

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

Re: Center a number above a measure

From: David Nalesnik
Subject: Re: Center a number above a measure
Date: Sun, 8 Apr 2012 18:00:40 -0500


2012/3/28 Colin Hall <address@hidden>

> On Wed, Mar 28, 2012 at 05:02:49PM +0100, James wrote:
> > hello,
> >
> > 2012/3/28 Clément Ryder <address@hidden>:
> > ...etc.
> >
> > So it seems that this is really the enhancement request stated before
> >
> > http://code.google.com/p/lilypond/issues/detail?id=146 (if not
> > exactly, in essence).
> Both enhancement requests are on the same general topic, which is
> automated counting of items (e.g. bars) in the music that are repeated.
> This recent request from Clement, as Xavier pointed out, calls for
> slightly more advanced features than the one which resulted in issue
> 146.
> > I just don't see any value in poo-pooing useful suggestions, (complex
> > or otherwise), for a problem that we already know about and is not
> > implemented 'elegantly' in the code.
> >
> > Eventually you just end up irritating people and they stop helping.
> Understood, but I'm ok with the comments. Xavier's suggestion of using
> that context property was a good one.
> In summary then:
> Lilypond does not have a feature for automated counting of arbitrary
> items. See issue trackers 2445 and 146 for more information.
> Code has been contributed for making a start on implementing this
> feature. See the issue trackers above.
> You can get a "1" above a single bar of full measure rest using this
> syntax:
> {
>  \set restNumberThreshold = #0
>  R1 | R1 | R1 |
> }
> Lilypond does not support counting the first item of a percent repeat.
> I hope Clement will prepare a simple documentation suggestion to make the
> role
> of restNumberThreshold clearer.
> Cheers,
> Colin.
> --
> Colin Hall
> _______________________________________________
> bug-lilypond mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-lilypond

I've come up with the following Scheme engraver which allows you to create
a counter above measures (whether they are associated with repeated music
or not). This should work in 2.14.2, too, provided that you adjust the
position of \measureCounterStart and \measureCounterEnd.

Basically, it creates spanners attached on both sides to a
NonMusicalPaperColumn. (Originally, I used BarLines--not sure which is the
better approach.) For the spanner, I've defined a new grob, MeasureCounter.

It would be nice to be able to control what prefatory items to consider
when centering (for example, between bars alone, between time signature and
clef change, etc.), but I have no idea how to proceed with this. (I believe
Harm's functions allow you this control. How to do this with an engraver?)

I acknowledge NoteColumns so that the number will move out of the way of
notes, but I can't figure out how to (gracefully) include only those
columns within a given measure--I'm getting the first note-column of the
next measure into my 'elements array. This, of course, messes with vertical
and horizontal positioning. Any thoughts?

Another problem is that the spacing between systems isn't adjusted.

Anyway, I hope that I'm on the right track with this, and I'd welcome any


P.S.  I realize that the function define-event-class is problematic at the
moment . . .

Attachment: measureCounterEngraver.ly
Description: Binary data

reply via email to

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