[NTG-context] LilyPond module for LilyPond 2.9.x
Mojca Miklavec
mojca.miklavec.lists at gmail.com
Tue Oct 3 23:59:54 CEST 2006
On 10/3/06, Henning Hraban Ramm wrote:
> Hello again, I'm still stuck with the counter problem, unfortunately
> I got no response...
>
> ConTeXts writes out all the LilyPond pieces as "myfile-lilypond-
> #.tmp", sequential numbered.
> Then it should run LilyPond and epstopdf on the snippets, but runs
> them always only on no.1
> I.e. the counter doesn't behave like it should. Why?
>
> I think, these are the regarding code snippets (sorry, can't think of
> a minimal example for I don't understand the code by Christopher):
>
> \unprotect
> \def\??lily{lilypond-}
> %...
> \newcount\lily!figures
> %...
> \long\def\dodostartlilypond[#1]#2\stoplilypond{%
> \egroup% from \dostartlilypond
> \bgroup%
> %...
> \global\advance\lily!figures\plusone
> \startmode[*\v!first]%
> \def\obeyedlines{\string^^J}%
> \convertargument#2\to\ascii
> \expanded{%
> \setbuffer[lilypond-\the\lily!figures]%
> %>> here it works, all buffers are numbered
> % ...
> \ascii%
> \ifundefined{\??lily fragment}\else\lily!fragmentsuffix\fi
> }% expanded
> \endbuffer%
>
> \def\LP{texmfstart --exec bin:lilypond -b eps -dno-gs-load-fonts -
> dinclude-eps-fonts }
> \def\PDF{texmfstart --ifchanged=}
>
> %>> here the counter is always 1
> \ifeof18
> \installprogram{\LP\bufferprefix lilypond-\the\lily!figures.tmp}%
> %>> can someone explain this "installprogram"?
> \doif\jobsuffix{pdf}{%
> \installprogram{\PDF\bufferprefix lilypond-\the\lily!
> figures.eps pstopdf \bufferprefix lilypond-\the\lily!figures.eps}%
> }%
> \else
> \executesystemcommand{\LP\bufferprefix lilypond-\the\lily!
> figures.tmp}%
> \doif\jobsuffix{pdf}{%
> \executesystemcommand{\PDF\bufferprefix lilypond-\the\lily!
> figures.eps pstopdf \bufferprefix lilypond-\the\lily!figures.eps}%
> }%
> \fi
> \stopmode% only first run
> \doifelse\jobsuffix{pdf}
> {\edef\lily!img{\bufferprefix lilypond-\the\lily!figures.pdf}}%
> {\edef\lily!img{\bufferprefix lilypond-\the\lily!figures.eps}}%
>
> \ifvmode
> \getfiguredimensions[\bufferprefix lilypond-\the\lily!
> figures.pdf]%
> %>> here it works again, image no.# is not found (besides no.1)
> \leavevmode%
> \newdimen\FigWidth
> \FigWidth=\figurewidth
> \ifdim\FigWidth>\localhsize
> \!!dimena=\localhsize
> \advance\!!dimena by-\FigWidth
> \noindent\hskip\!!dimena
> \fi
> \fi
> \externalfigure[\lily!img]%
> \egroup%
> }%
I cannot test since lilypond is not working properly on my computer,
but I get the proper numbers.
Here's an excerpt from the log file (I changed lilypond to echo):
systems : begin file test1 at line 2
<test1-lilypond-1.tmp>
system(echo test1-lilypond-1.tmp)...executed.
system(epstopdf test1-lilypond-1.eps)...executed.
(C:\Programi\MikTeX\tex\context\base\pdfr-ec.tex)
figures : figure test1-lilypond-1 can not be found
color : mpcmyk color space is supported
color : mpspot color space is supported
color : system rgb is local activated
<test1-lilypond-2.tmp>
system(echo test1-lilypond-2.tmp)...executed.
system(epstopdf test1-lilypond-2.eps)...executed.
Mojca
More information about the ntg-context
mailing list