2015-07-12 15:15 GMT+02:00 H. S. Teoh <hst...@quickfur.ath.cx>: > On Sun, Jul 12, 2015 at 08:40:37PM +1000, Andrew Bernard wrote: >> Hi T, >> >> Is this actually a question about Scheme programming, or a question >> about how to generate parts from a full score? > > About Scheme. I know how to generate parts from a full score, but it > involves a lot of repetitive copy-n-paste, which I hope to avoid by > factoring out the common parts into Scheme functions. > > > [...] >> On 12 July 2015 at 12:18:17, H. S. Teoh (hst...@quickfur.ath.cx) wrote: >> >> Is it possible to use Scheme to generate \score blocks? What's the >> correct syntax for doing this? I'm working on a set of Scheme functions >> to facilitate working with orchestral scores, and I'd like a way to loop >> over a list of instrument names and generate \score blocks for the >> corresponding instrument parts. >> > > -- > Живёшь только однажды.
Probably something at the lines of: \version "2.19.22" one = { c''1 } two = { d''1 } my-name = #(ly:parser-output-name) write-scores = #(define-void-function (parser location scores) (list?) (ly:book-process (ly:make-book-part (map ly:make-score (reverse scores))) $defaultpaper $defaultlayout my-name)) \write-scores #(list one two) HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user