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: Alexandre Araujo Moreira
Subject: Re: Generate pdf from scheme function
Date: Sun, 17 Mar 2013 23:46:29 -0300




On Sun, Mar 17, 2013 at 10:01 PM, David Kastrup <address@hidden> wrote:
Alexandre Araujo Moreira <address@hidden> writes:

> \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?

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

Probably more verbose than you care for, but at least you can get midi
and layout blocks in which is more than you can do using a music
function.


David, I tried what you said above (and some variations, as having a score around another score seemed odd) and I only managed to get syntax errors.

My original idea was based on believing a "scheme-function" in Lilypond was more-or-less like a macro in Scheme. Now I think I was wrong about that. Is there any facility in Lilypond that would allow me to write something like

\myMacro arg1 arg2 and have lilypond behave as if I had wrote the expansion of myMacro over arguments arg1 and arg2? If there is such a thing I can work out a way in which it could behave the way I want. Especially if I have anything like guile's syntax-case at my disposal.
 
--
David Kastrup


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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