lilypond-user
[Top][All Lists]
Advanced

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

Iterated batch output (exercise generator)


From: John Allsup
Subject: Iterated batch output (exercise generator)
Date: Tue, 27 Dec 2011 22:14:53 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

Hi,

Is there any way to iteratively generate multiple files within Lilypond
(so that I could have a function that
generates 10 separate pages).

I can do a
#(define output-suffix (string-append "A" (number->string num)))
\book {
    \header {
        title = #(string-append "Exercise A" (number->string num))
    }
    \score {
        \notesa
        \layout {
        }
    }
}
#(define output-suffix (string-append "B" (number->string num)))
\book {
    \header {
        title = #(string-append "Exercise B" (number->string num))
    }
    \score {
        \notesb
        \layout {
        }
    }
}

thing in a lilypond script, which generates files.  What I'd like is a
way to generate e.g. 10 or 11 files with the value determined by
changing the number 10 or 11 within the script.

Any thoughts, or does this require support from an external scripting
language?  I'm currently using a ruby script to write input into lilypond, but
wonder if I can manage something that only requires lilypond to work (so will
be more portable).

(I'm trying to generate random rhythm and note-reading exercises.)

Cheers,

John





reply via email to

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