On Mon, Apr 8, 2013 at 7:20 PM, Carl Peterson <[email protected]> wrote:
> Is there a property or counter buried somewhere in Lilypond/Scheme for a
> running count of score contexts? This is for a hymnal/psalter project where
> I want to number the songs but don't want to deal with integrating lilypond
> output into something else (like LaTeX).

You can create your own counter.
============
\version "2.17.15"

#(define count 0)
#(define (get-next)
  (set! count (+ 1 count))
  count)
#(define (numbered-title title)
  (string-append (number->string (get-next)) ". " title))

\paper
{
  print-all-headers = ##t
}

\score
{
  \new Staff \relative c' { c4 c c c }
  \header
  {
    title = #(numbered-title "A")
  }
}

\score
{
  \new Staff \relative c' { c4 c c c }
  \header
  {
    title = #(numbered-title "B")
  }
}

\score
{
  \new Staff \relative c' { c4 c c c }
  \header
  {
    title = #(numbered-title "C")
  }
}
============

This is quick and dirty, but it might work for what you need.

Another option is to generate your scores from a function. This way
you can generate them in a loop passing in the counter. This would be
more complicated.

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to