On Wed, May 8, 2013 at 12:27 PM, Carl Peterson <[email protected]> wrote:
> If something doesn't already exist, I suppose the question would be whether
> there's a way to accomplish this by Scheme?
Yes, I do something similar. This might help get you started:
========================================
\version "2.17.16"
#(define (make-my-scores parser location up down lyrics verse)
(if (not (null? lyrics))
(let* ((verseStr (string-append (number->string verse) "."))
(score
#{
\score
{
<<
\new Staff="top" { \new Voice="soprano" { \clef treble $up } }
\new Staff="bottom" { \new Voice="tenor" { \clef bass $down } }
\new Lyrics \with { alignAboveContext = "bottom" }
\lyricsto "soprano" { \set stanza = $verseStr $(car lyrics) }
>>
}
#}))
(add-score parser score)
(make-my-scores parser location up down (cdr lyrics) (+ verse 1)))))
seqVerses =
#(define-void-function (parser location up down lyrics) (ly:music?
ly:music? list?)
(make-my-scores parser location up down lyrics 1))
soprano = \relative c' { c4 c c c | }
tenor = \relative c { c4 c c c | }
verseOne = \lyricmode { a b c d }
verseTwo = \lyricmode { e f g h }
\seqVerses \soprano \tenor #(list verseOne verseTwo)
========================================
I think you're better off writing two separate functions instead of a
big if/else block: one for one score with multiple verses and another,
like the above, for multiple scores each with one verse.
-----Jay
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user