Hi there,

I'm trying to pass a list of scores to a book generating function and
I have a few questions.
Please see example post scriptum.
How should I structure (syntax) my score list?
I did some trials and (only) errors…

How should I iterate over said list?
I'm not quite sure how to "unfold" the score if that makes any sense.
I am using (display (car score-list)) just to figure out what is going on.

Good day
-- 
Pierre-Luc Gauthier

%%%%%%%%%%%%%%%%%
\version "2.21.0"

scoreI = \score {
  {\key cis \major ces''4}
  \layout {}
}

scoreII = \score {
  {\key ces \major cis''4}
  \layout {}
}

bookFunc = #
(define-void-function
 (score-list filename)
 (list?  string?)
 (ly:book-process #{
   \book {

     \score {
       {c'4}
       \layout {}
     }

     %$(for-each score-list
     %   (lambda (score)
     %     $score
     %     ))

   }
   #} #{ \paper {} #} #{ \layout {} #}
   (string-append "Part-" filename)))

\bookFunc #'(scoreI scoreII) "fileName"
\version "2.21.0"

scoreI = \score {
  {\key cis \major ces''4}
  \layout {}
}

scoreII = \score {
  {\key ces \major cis''4}
  \layout {}
}

bookFunc = #
(define-void-function
 (score-list filename)
 (list?  string?)
 (ly:book-process #{
   \book {

     \score {
       {c'4}
       \layout {}
     }

     %$(for-each score-list
     %   (lambda (score)
     %     $score
     %     ))

   }
   #} #{ \paper {} #} #{ \layout {} #}
   (string-append "Part-" filename)))

\bookFunc #'(scoreI scoreII) "fileName"
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to