lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme function returning two scores


From: David Kastrup
Subject: Re: scheme function returning two scores
Date: Sun, 25 Feb 2018 14:50:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> Yes, I tried it but didn't work.... did I made a mistake?
>
> \version "2.19.81"
>
> myScore = #(define-scheme-function (music) (ly:music?) #{
>   \bookpart {
>     \score { $music \layout{} }
>     \score { \unfoldRepeats $music \midi{}}
>   } #} )
>
> \myScore {\repeat percent 2 {c' d' e' f'}}
> \myScore {\repeat percent 2 {g c' c' c'}}
>
>
> I also tried bookpart inside a book
>
> \version "2.19.81"
>
> myScore = #(define-scheme-function (music) (ly:music?) #{
>   \bookpart {
>     \score { $music \layout{} }
>     \score { \unfoldRepeats $music \midi{}}
>   } #} )
>
> \book {
> \myScore {\repeat percent 2 {c' d' e' f'}}
> \myScore {\repeat percent 2 {g c' c' c'}}
> }

Interesting.  Looks like books/bookparts as scheme function values are
not handled in the parser.  Probably worth a bug report.

In the mean time, you could define a void function and let it just call
toplevel-score-handler on your scores.  Of course, this would no longer
allow you to place those scores in a book or bookpart.

-- 
David Kastrup



reply via email to

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