lilypond-devel
[Top][All Lists]
Advanced

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

How to add measure counters?


From: Reinhold Kainhofer
Subject: How to add measure counters?
Date: Mon, 12 Sep 2011 21:03:59 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; i686; ; )

I'm currently investigating how to implement measure counters (Bug 146):
http://code.google.com/p/lilypond/issues/detail?id=146

Compared to multi-measure rest numbers and to percent repeat numbers, there is 
a little complication: There is no grob to attach the numbers to (the percent 
repeat iterator creates one music object with the correct length for each 
percent/number, and the multi-measure rest also has the rest as the proper 
grob to attach to), and it is not straightforward to find the correct bounds 
for creating a spanner for each measure.

My current idea is to
1) start counting with an \startMeasureCounter event or context property
2) add a Measure_counter_engraver, which will create those counters
3) in each measure, create a spanner spanning the whole measure
4) create a MeasureCounter as a child of that spanner (centered).

Now, I don't know how to create a spanner that spans exactly one measure in an 
engraver... There might note be a barline (and there might be mid-measure 
barlines), so acknowledging bar lines is not possible. There might also be no 
notes at all at the beginning of a measure (e.g. with longas there are three 
measures without a note).

Any idea how to implement this?

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

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