I don't know what's going wrong with this snippet:
\version "2.24"
multiDynScoresDoc = #(define-void-function
(filename title staves)
(string? string? list?)
(toplevel-book-handler #{
\book {
\bookOutputName #filename
\header {
title = #title
}
$@(map
(lambda (staff) (#{
\score {
$staff
}
#}))
staves
)
}
#})
)
staffA = \new Staff { \time 2/4 a8 a8 a8 a8 }
staffB = \new Staff { \time 2/4 b8 b8 b8 b8 }
staffC = \new Staff { \time 2/4 c8 c8 c8 c8 }
\multiDynScoresDoc #"test" "Test" #(list
staffA staffB staffC
)
Lilypond output:
GNU LilyPond 2.24.3 (running Guile 2.2)
Processing `./test.ly'
Parsing...
./test.ly:14:8: error: Guile signaled an error for the expression beginning here
$
@(map
Wrong type to apply: #<Score>
./test.ly:30:1: error: error in #{ ... #}
\multiDynScoresDoc #"test" "Test" #(list
fatal error: failed files: "./test.ly"