lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating score with unfolded repeats in scheme


From: David Kastrup
Subject: Re: Creating score with unfolded repeats in scheme
Date: Mon, 09 Sep 2024 23:27:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Morten Lemvigh <morten.lemvigh@gmail.com> writes:

> So the question is: what have I misunderstood? :-)
>
> Best regards,
> Morten
>
> \version "2.24.2"
>
> choirScore = \score {
>     \new Staff {
>         \relative c' {
>             \repeat volta 2 {
>                 c d e f
>             }
>         }
>     }
> }
>
> make-rehearsal =
> #(define-scheme-function
>   (the-score)
>   (ly:score?)
>   (ly:make-score (unfold-repeats-fully (ly:score-music the-score))))
>
> new-score = #(make-rehearsal choirScore)
> \new-score

If you define the function with define-scheme-function instead of
#(define ...), why not call it as

new-score = \make-rehearsal \choirScore

?  That's just a detail.  The main problem is that ly:make-score is an
internal function that does not do the full required job of creating a
score from unprepared music.

To get the full preparation necessary, use scorify-music instead of
ly:make-music .  It uses ly:make-music internally but does other
required things.

-- 
David Kastrup



reply via email to

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