Le 3 sept. 09 à 10:47, Valentin Villenave a écrit :
On Fri, Jul 24, 2009 at 10:51 AM, Nicolas Sceaux<nicolas.sce...@free.fr
> wrote:
%% UNTESTED!
includeList =
#(define-music-function (parser location variable-names) (list?)
(make-sequential-music
(map (lambda (variable-name)
(let ((music (ly:parser-lookup parser (string->symbol
variable-name))))
(if (ly:music? music)
music
(make-music 'Music))))
variable-names)))
Hi Nicolas,
I've been trying to implement something based on your recent
discussion with Reinhold; I have a few questions though:
- why does scorify-music fail here?
- how can I add a \header block for each \score produced (I can't
figure out where to insert an add-text in this snippet)?
Reinhold has answered your questions.
As for why I use top level markup instead of score headers:
I don't generate scores as Reinhold does, and using a
\header block in an explicit \score is a bad idea when your
score is included at several places: you may not want to have
the same title.
Using current git, your example can be expressed as follows:
\include "italiano.ly"
Prologue = \relative {do re mi fa}
Ouverture = \relative {sol'1 }
Entracte = \relative {si''2 si}
#(define (make-this-music name)
(let ((music (ly:parser-lookup parser name)))
(if (ly:music? music)
music
(make-music 'Music 'void #t))))
includeList =
#(define-music-function (parser location variable-names) (list?)
(map (lambda (variable-name)
(let* ((music (make-this-music variable-name))
(score (scorify-music music parser))
(layout (ly:output-def-clone $defaultlayout))
(header (make-module))
(title (markup #:large (symbol->string variable-
name))))
(module-define! header 'piece title)
(ly:score-set-header! score header)
(ly:score-add-output-def! score layout)
(add-score parser score)))
variable-names)
(make-music 'Music 'void #t))
\includeList #'(Prologue Ouverture Entracte Dummy)
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user