lilypond-user
[Top][All Lists]
Advanced

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

Re: Expansion of score for different format


From: Carl Peterson
Subject: Re: Expansion of score for different format
Date: Fri, 10 May 2013 18:15:47 -0400

Okay, so I've been fairly successful in implementing and tweaking. I'm working  on the complementary function, to output a regular score with stacked verses for book layout. Here is my re-arrangement: 

#(define 
(make-my-scores parser location lyrics)
(if (not (null? lyrics))
(let* (
#{ \new Lyrics \lyricsto "sopranoAlto" { $(car lyrics) }  #}
      (make-my-scores parser location (cdr lyrics))
)
)
)
)
 
seqVerses =
#(define-void-function (parser location up down title composer passage meter lyricist copyright lyrics)
(ly:music? ly:music? string? string? string? scheme? scheme? scheme? list?)
(let*
(
(score 
#{
       \score {
<<
\new Staff="top" { $up }
  #(make-my-scores parser location lyrics)
\new Staff="bottom" { $down \pageBreak }
          >>
}
     #}
)
)
      (add-score parser score)
)
)

If I leave out #(make-my-scores parser location lyrics) in the main seqVerses function, I get the music just fine. However, when I add this, I get guile errors. What am I missing here? I'm sure there's something obvious that just isn't coming to mind.

Thanks,
Carl


On Wed, May 8, 2013 at 11:32 PM, Jay Anderson <address@hidden> wrote:
On Wed, May 8, 2013 at 12:27 PM, Carl Peterson <address@hidden> 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


reply via email to

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