lilypond-user
[Top][All Lists]
Advanced

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

Re: Suggestions for macro tools to generate .ly files


From: Pedro Kroger
Subject: Re: Suggestions for macro tools to generate .ly files
Date: Mon, 11 Oct 2004 22:36:34 -0300
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

"Jack O'Quin" <address@hidden> writes:

> Since I've already created dozens of these little files and will be
> creating hundreds or even thousands more, I want some tools to ease
> the chore.  

that's really a good idea. I did something like that in the past using
Finale (there was no lilypond at that time) and the result was an
awfully unmaintainable thing. If the thing is really big as you say I'd
generate everything pragmatically.

> But, should I do it all within lilypond using SCHEME?  (I know SCHEME,
> but not the internals of lilypond.)  Or, should I use something like
> the LaTeX \newcommand{}?  M4?  Emacs lisp?

using scheme inside lilypond is not a bad idea, but OTHO if you use a
program to generate the files (let say python, scheme, or perl) you
don't have to depend on a specific version of lilypond. And probably you
can upgrade to newer lily versions more easily (because you don't
depend on how lilypond works internally).

> I could write a stand-alone script to expand that into the full .ly
> file.

that's what I'd do. I'd generate one .ly file for each example, have
each .ly file generate an eps file and insert those in a (probably also
program-generated) LaTeX document.

> Conceptually, something like this should suffice...
>
>    %% B-flat major arpeggio, second inversion
>    \exercise{f-1  bf-1 \pos{3} d-3 f-1  bf-1 \pos{7} d-1 |
>              f-4 d-1 bf-2 f-2 \pos{5} d-1 bf-2 |}

If I'd use (stand alone) scheme I'd try to come out with something like:
(imagine all notes are string-quoted :-))

(exercise f-1 bf-1
          (pos 3 d-3 f-1 bf-1)
          (pos 7 d-1 f-4 d-1 bf-2 f-2))

or you could implement in python having "exercise" and "pos" as
functions. Or yet, I'd use some of the python parser modules and create
a tiny-small language for the job. The latter, besides fun :-), would
probably be more maintainable (if the thing is really huge) than using.

Another thing: I advice you to upgrade to lilypond 2.3.x ASAP. It's
really stable now and beautifier than ever :-)

Pedro Kroger





reply via email to

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