Paul Morris <p...@paulwmorris.com> writes: > Simon Albrecht-2 wrote >> scoreSetup = >> #(define-music-function >> (parser location letter) >> (string?) >> #{ >> \score { >> \new Staff = "bassus" \with { instrumentName = "bassus" } >> % this is supposed to give the same result as @code{\bassK} for example… >> #(string->identifier (string-append "bass" $letter)) >> } >> #} >> ) > > I recently tried a music function like this. I wanted it to return a score, > but I always got: > > error: music function cannot return #<Score>
Ah, overlooked that one. > I wonder whether music functions can return a score at all, No, use define-scheme-function for that. With regard to using that scheme function as a score replacement then, it may conceivably work only with recent versions of 2.19. I think that I pulled some commits for that purpose into 2.18, but that will only get available with 2.18.2 I think. It's not really all that important as you can always leave out the \score, and then do use a music function and \score { \scoreSetup ... } as long as what you want in \scoreSetup does not include output or header definitions. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user