Gianmaria Lari <address@hidden> writes:
> This is just an example.
> I would like that my scheme function "test " generates a midi file with the
> name I passed to it.
> This is what I have been able to do. It compiles but it does not work:
>
> \version "2.19.82"
> test = #(define-void-function (music filename) (ly:music? string?)
> #(add-score
> #{
> \book {
> \bookOutputName $filename
> \score $music
> \midi{}
> } #} ) )
>
> \test {a b} "MyFile"
>
> Any mistakes?
Sure. add-score wants a score and you feed it a book. Maybe you want
print-book-with-defaults instead?
Right :)
Ok, tried to substitute "add-score" with "print-book-with-defaults" but I didn't see any midi file in the default folder. But print-book-with-defaults works for midi output?
This is the code I tried:
\version "2.19.82"
test = #(define-void-function (music filename) (ly:music? string?)
#(print-book-with-defaults
#{
\book {
\bookOutputName $filename
\score $music
\midi{}
} #} ) )
\test {a b} "MyFile"
Thank you, g.