lilypond-user
[Top][All Lists]
Advanced

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

Decomposing Lilypond-book for makefile optimization?


From: Jeff Smith
Subject: Decomposing Lilypond-book for makefile optimization?
Date: Wed, 12 Jul 2006 10:53:58 -0600

Hi gang. I'm using lilypond-book to render some musical diagrams into a latex document. I'm having a problem for which I need help to solve.

My document has about 30 short musical compositions that are included as diagrams. They are also full compositions in their own right, so I want to use the stand-alone .ly files within my doc. (I hate the idea of having two versions of each .ly) So far so good. I can use \lilypondfile in my latex doc, preprocess with lilypond-book and everything is happy.

Except...

My document is quite lengthy. Every time I make a change to the master doc (the .lytex source), lilypond-book robotically goes along and recompiles all the lilypond files, even though they haven't changed. Needless to say, this creates a LOT of extra compile time, which I would rather avoid. Furthermore, due to the document's dependency on all the .ly files, if I only change one of those, then lilypond-book still runs, and stomps on all the intermediate latex files, which causes EVERYTHING to rebuild.

I have a clumsy workaround, in which I skip lilypond-book. Instead, I use \includegraphics in my .tex file, and I compile the .ly files separately, using some spiffy makefile wizardry to detect when they have changed. This works just fine.

Except...

To compile my .ly files into a graphics format suitable for the \includegraphics statement, I am currently doing "lilypond --png file.ly", then passing that to an autocrop tool that crops off the header, footer and borders, leaving me with an isolated block of music, much like the output I get from lilypond-book, which is then converted to EPS format. The problem is that, by going through PNG format, I get all kinds of unslick, grainy artifacts in the final EPS.

I've also tried to render using "lilypond --ps file.ly" which produces usable looking output, but it is still embedded in a full-page image. When I autocrop that, it just ends up looking horrible.

What I'd LIKE to do, is stick with my fancy makefile to compile the various .ly files as necessary, but use the same pipileine that lilypond-book uses to spit out its cropped EPS format images. I know it must be possible, because lilypond-book is doing it, but I don't speak python well enough to unravel HOW it does it.

Can anybody provide some pointers on how to get lilypond to spit out cropped EPS files? Are there some hidden command line switches that might do it?

--
Jeff Smith
Computer Science Dept.
University of Saskatchewan
reply via email to

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