lilypond-user
[Top][All Lists]
Advanced

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

Generate pdf from scheme function


From: Alexandre Araujo Moreira
Subject: Generate pdf from scheme function
Date: Sun, 17 Mar 2013 19:57:08 -0300

Hello, everyone.

I've been playing with lilypond to write simple, one-instrument, scores for learning for a few weeks now, and figured I could automate some of the tedious layout configuration I apply to all my scores with a simple scheme function. Unfortunately things aren't going very well. Let me describe my problem.

I wrote a scheme function with (define-scheme-function), with the following code:

\version "2.16.2"
simpleMusic =
#(define-scheme-function (parser location melody) (ly:music?)
   #{
    \score {
      $melody
      \layout {}
    }
  #})
\simpleMusic { c1 }

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.

My idea is to extend the parameters later (add title, composer, or anything else that is interesting to me) and apply a few transformations to the melody parameter (for example, unfold repeats while generating midi).

The problem is, I thought what I wrote above would be enough to have it generate the outputs declared inside the function (in this case, the \layout), but it seems it doesn't work that way.

Thanks,
Alexandre Araujo Moreira.

reply via email to

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