generating graphic examples

2009-07-28 Thread Josh Nichols
I want to be able to generate graphic musical examples without getting it
formatted on a giant paper-formatted .pdf or .png.  How do I accomplish
this?


I cannot find anything in the manual which allows this.
-
Josh Nichols

SDG
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: generating graphic examples

2009-07-28 Thread Francisco Vila
2009/7/28 Josh Nichols josh.d.nich...@gmail.com:
 I want to be able to generate graphic musical examples without getting it
 formatted on a giant paper-formatted .pdf or .png.  How do I accomplish
 this?



add this block

\paper{
  indent=0\mm
  line-width=120\mm
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
}

and call lilypond this way on myfile.ly:

lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly

 I cannot find anything in the manual which allows this.

http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program/Alternate-methods-of-mixing-text-and-music.html#Inserting-LilyPond-output-into-other-programs

-- 
Francisco Vila. Badajoz (Spain)
www.paconet.org


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: generating graphic examples

2009-07-28 Thread Alexander Kobel

Josh Nichols wrote:
I want to be able to generate graphic musical examples without getting 
it formatted on a giant paper-formatted .pdf or .png.  How do I 
accomplish this?



I cannot find anything in the manual which allows this.


I assume you basically want to trim your output to the really used space.
I guess there should be an option to do so, since it's done for the 
snippets in the documentation, and it might well be the clip-systems 
option. However, this one does exactly nothing for me (2.12.1), or I 
just can't use it correctly.


If you have ImageMagick ready, for PNGs you can just call
convert -trim original.png trimmed.png

If you want trimmed PDF and/or EPS files and are on one of the common 
Unices with ImageMagick/GraphicsMagick, GhostScript and xpdf-utils 
installed, have a look at the attached Makefile.
Note that I don't simply use the above command for the PNGs, but convert 
the PDF to PNG instead; this way, the sizes of both images are exactly 
the same (up to the resolution).
If you remove the -l option from the ps2eps call in line 16, the PDF 
should be trimmed tight; with it, there is a white border of about 1pt 
around it.


I have no idea what this does to multipage files, by the way.


HTH,
Alexander
TARGETS=halleluja
RESOLUTION=600
GS=gs -q -dNOPAUSE -dBATCH

.PHONY: all clean

all:$(addsuffix .pdf,$(TARGETS)) \
$(addsuffix -trimmed.pdf,$(TARGETS)) \
$(addsuffix -trimmed.png,$(TARGETS)) \
$(addsuffix -trimmed-no-bg.png,$(TARGETS)) 

%-trimmed.pdf:  %.pdf
cp -f $ $@;
pdftops $@;
rm -f $*-trimmed.eps;
ps2eps -l $*-trimmed.ps;
epstopdf $*-trimmed.eps;
rm -f $*-trimmed.ps;

%.pdf: %.ly
lilypond $;

%-trimmed.png:  %-trimmed.pdf
convert -density $(RESOLUTION)x$(RESOLUTION) -units PixelsPerInch 
-colorspace Gray -depth 8 $ $@;

%-trimmed-no-bg.png:%-trimmed.png
convert -channel R $ -channel A -size 1x256 gradient:black-none -clut 
$@;

%.png:  %.ly
lilypond -dresolution=$(RESOLUTION) --png $;

clean: $(addsuffix .CLEAN,$(TARGETS))

%.CLEAN:
rm -f $*-fixed.ps $*-fixed.eps $*.bbox;
rm -f $*.ps $*.pdf $*.png $*-trimmed.eps $*-trimmed.pdf $*-trimmed.png 
$*-trimmed-no-bg.png $*.midi;
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: generating graphic examples

2009-07-28 Thread Jonathan Kulp
Josh,

If these other methods don't work for you, and if you're running Linux or
Mac OSX, then I have a bash script that does exactly what you want.  See
this thread for more info:

http://article.gmane.org/gmane.comp.gnu.lilypond.general/41125

Jon

On Tue, Jul 28, 2009 at 10:40 AM, Josh Nichols josh.d.nich...@gmail.comwrote:

 I want to be able to generate graphic musical examples without getting it
 formatted on a giant paper-formatted .pdf or .png.  How do I accomplish
 this?


 I cannot find anything in the manual which allows this.
 -
 Josh Nichols

 SDG

 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 http://lists.gnu.org/mailman/listinfo/lilypond-user




-- 
Jonathan Kulp
http://www.jonathankulp.com
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user