I've been following this, and just tested the latest version on OSX...
quite nice guys!
Perhaps the -V flag can be set to not open the image after it is done?
This utility will be great for mass creating images (as most command
line tools are), but having Preview open each one up will get very
tiring... perhaps if the is no -V passed in, that step can be skipped?
Again - quite nice!
Josh
On Sep 19, 2008, at 2:20 PM, Jonathan Kulp wrote:
Ok I've caught on to your version-control comments at the top and
have started adding to them. This time I added two things to the
script:
1) recognition of the computer's OS (only Linux or Mac at this
point), and appropriate changes to the commands to accommodate.
After this change, the script works exactly the same (from user's
perspective) on both my Ubuntu and Mac OSX 10.4 systems :) I used
to have to keep separate versions of the script for each one.
2) added a "known issue" comment that the script doesn't handle
spaces in directory names. It fails at line 43 (cd $currentdir) if
the directory of the lilypond source file has a space in the name.
Patrick Horgan wrote:
Jonathan Kulp wrote:
Patrick! It's all working beautifully now.
I must say that you are most awesomely cool. How wonderful to find
someone that digs in in the best linux/Unix tradition and puts
together a string of programs to achieve a desired result. Hats
off to you.
Working on this script is making me understand the genius of the
Unix model. Someone with no programming experience like me can make
something that gets a job done using a bunch of tiny tools. Really
fun!
... much cool stuff elided...
p.s. now that we have a tool with a version number, I might try
learning how to write a brief manpage for it. Good idea?
A most excellent idea! manedit is your friend. Complete wysiwyg
man editor. Its help has a complete and easy tutorial. On ubuntu
it's just *sudo apt-get install manedit*. Since you're doing that
I'm adding a -a (about) with your name and mine, some more comments
so others can modify it more easily, and will call it version
1.1.1. I also added a -V=viewer, so I could use, for example
evince if the output format was ps. N.B. evince doesn't display
transparency so if you use it with transparent gifs or pngs you
might think the transparency gone, but it's not.
Cool. I'll try this after the kids are in bed tonight.
One feature it really needs is an ability to handle the
situation where the output for file.ly is for example, file-
page1.png and file-page2.png. You'd have to get a wildcard list of
things that matched $STEM*.png and loop over them to do the
conversions, then something like $viewer $STEM*.$FORMAT & at the
end. That would make it work as it currently does for most things,
there'd just be one thing in the list, but still work for the case
where there's something there. A generic wildcard is best because
someone might have done a #(define output-suffix "blablabla") and
we want to support that case too. eog will bring up all the pages
and let you page up and page down through them, and evince will
bring a a window for each file. There's enough examples in the
script so that you could figure out how to do it if you would. We
could call it 1.1.2;) If you don't have time let me know and I'll
get to it sometime. If you do, change the version in the script,
add to the changelog at the top and send me a copy:) Maybe we
could donate it to the lilypond project.
Patrick
Yes. I haven't thought much about multiple-page documents yet
because for me the object of the script is to produce small images
of musical examples to use in a research paper or on a website. Are
there situations where you want multiple-page examples with
whitespace cropped like this? I could see where it'd be nice to
make a longer document's background transparent. It's certainly
worth a try to deal with a longer file. The more flexible the
script is, the better, after all. I'll poke around with it this
weekend, perhaps.
Most recent version attached.
Jon
--
Jonathan Kulp
http://www.jonathankulp.com
<lilytoimage.txt>_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user
******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/
“Every composer – at all times and in all cases – gives his own
interpretation of how modern society is structured: whether actively
or passively, consciously or unconsciously, he makes choices in this
regard. He may be conservative or he may subject himself to continual
renewal; or he may strive for a revolutionary, historical or social
palingenesis." - Luigi Nono
*/
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user