lilypond-user
[Top][All Lists]
Advanced

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

Re: Generate pdf from scheme function


From: Jay Anderson
Subject: Re: Generate pdf from scheme function
Date: Sun, 17 Mar 2013 20:23:53 -0700

On Sun, Mar 17, 2013 at 3:57 PM, Alexandre Araujo Moreira
<address@hidden> wrote:
> Is there anyway I can write something similar to simpleMusic (in usage),
> where it'll automatically generate the pdf given the notes? Later I plan to
> add other outputs (controlled by cmdline parameters), so having this kind of
> usage would be very helpful.

This may get you further:

===========================
\version "2.17.10"

makePDF =
#(define-void-function (parser location music pdf-filename) (ly:music? string?)
  (let ((book #{
    \book
    {
      \bookOutputName $pdf-filename
      \score
      {
        \new Staff { $music }
      }
    } #}))
    (print-book-with-defaults parser book)))

\makePDF \relative c' {c4 d e f} "one"
\makePDF \relative c' {f4 e d c} "two"
===========================

This generates two files: 'one.pdf' and 'two.pdf'.

-----Jay



reply via email to

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