On Tue, 18 Dec 2018 at 16:23, David Kastrup <d...@gnu.org> wrote:

> Gianmaria Lari <gianmarial...@gmail.com> 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.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to