lilypond-user
[Top][All Lists]
Advanced

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

Re: Generation of Notation Videos with Lilypond Tool Chain


From: Knut Petersen
Subject: Re: Generation of Notation Videos with Lilypond Tool Chain
Date: Tue, 14 Jun 2016 10:27:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0

Three months ago you wrote:

A weakness of the approach is that the page turning times
for the score are gained by parsing the Postscript output
file of lilypond.  This approach is fragile and might break
when the font set is changed or whenever lilypond changes
its rendering philosophy.

David Nalesnik demonstrated how to teach lilypond to generate a list of bar numbers at line breaks,
see his original message at https://lists.gnu.org/archive/html/bug-lilypond/2015-01/msg00051.html.

Add the following code to the top of your ly file:
============================

#(define out (open-output-file "line-breaks.txt"))

#(define (display-breaks grob)
   (if (and (grob::has-interface grob 'paper-column-interface)
            (eq? #t (ly:grob-property grob 'non-musical)))
       (if (eq? 1 (ly:item-break-dir grob))
           (let* ((location (ly:grob-property grob 'rhythmic-location))
                  (m (car location)))
             (format out "Line beginning at measure ~a~%" m)))
       (ly:message "Need NonMusicalPaperColumn grob to determine line breaks.")))

Then activate the code as shown below:
========================

\score {
   [...]
    \layout{
        \context {
            \Score
            \override NonMusicalPaperColumn #'after-line-breaking = #display-breaks
        }
    }
}

Best regards,

Knut

reply via email to

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