2017-04-11 22:34 GMT+02:00 David Nalesnik
<address@hidden>:
Here's how you can determine the widths of measures. Note that I've
put everything on one line, so that the \once \override of the
NoteHead gives access to every column in the score. You can adjust
what alignment objects are used to gauge width by changing the symbol
in ly:paper-column::break-align-width (available as of 2.19.59).
Right now, it's BreakAlignment objects to give you an extent
considering all prefatory materials. staff-bar would give extents of
the bar lines.
\version "2.19.59"
\paper {
page-breaking = #ly:one-line-breaking
}
#(define (display-measure-widths grob)
(let* ((sys (ly:grob-system grob))
(cols (ly:grob-array->list (ly:grob-object sys 'columns)))
(nmpcs
(filter
(lambda (elt)
(and (grob::has-interface elt 'paper-column-interface)
(eq? #t (ly:grob-property elt 'non-musical))))
cols))
(widths
(map
(lambda (c) (ly:paper-column::break-align-width c
'(break-alignment)))
nmpcs))
(widths (sort widths (lambda (x y) (< (car x) (car y)))))
)
(pretty-print widths)))
{
\once \override NoteHead.after-line-breaking = #display-measure-widths
\repeat unfold 4 { c''8. c''16}
\repeat unfold 4 { c''4 }
c''1
c''2 c''2
\repeat unfold 64 { c''64 }
}
\layout {
\context {
\Score
\override SpacingSpanner.common-shortest-duration = #'()
}
}
Hope this helps with something!
David