[NTG-context] LilyPond module for LilyPond 2.9.x

Henning Hraban Ramm hraban at fiee.net
Tue Oct 3 23:37:57 CEST 2006


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%
}%


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3574 bytes
Desc: not available
Url : http://www.ntg.nl/pipermail/ntg-context/attachments/20061003/565fdb42/attachment.bin 


More information about the ntg-context mailing list