At 09:24 11/12/2003, you wrote:

So instead of Hans restarting a new Music Notation project, Hans should
make lilypond team using Context instead of LaTeX ;-)

i'm not that sure (remembering a talk) that th lilypond team is that fond on tex -)


Also I noted that :
- Lilypond is NOT a TeX macro, it only seems to be a
  dedicated (powerfull) subset of TeX (but allow input of TeX macro)

it uses the \ as escape (as tex and rtf do)


- Lilypond make use of TeX for page breaking and other stuff

So How to use Lilypond with ConTeXt?
1 - use Lilypond as an independant tool for building short
    (less or equal to one page) as pdf figure and
    include them in context as external figure
    (that is the way I'll do, because I'm not clever
    enought to do much more :-)

if there is a clean way to generate a cropped piece of music, this is actually simple:


There is a mechanism in context for processign snippets, something along the lines:

\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication
{\bgroup
\bgroup
\let\f!temporaryextension\c!tex
\setbuffer[\@@texapp]%
\ifx\starttext\undefined
\pdfoutput=1
\pdfcompresslevel=9
\hsize0pt
\vsize0pt
#2\relax% preamble
\ifdim\hsize=0pt \hsize20cm\fi
\ifdim\vsize=0pt \vsize20cm\fi
\output{}
\parindent=0pt
\everypar{}
\hoffset=-1in
\voffset=\hoffset
\setbox0\vbox{#3}
\ifdim\wd0<1in \message{[warning: width<1in]}\fi
\ifdim\ht0<1in \message{[warning: height<1in]}\fi
\pdfpageheight=\ht0
\pdfpagewidth=\wd0
\box0
\expandafter \bye
\else
\starttext
#2% preamble
\startTEXpage[#1]%
\topskip\zeropoint
\setbox\scratchbox\hbox{#3}%
\saveTEXapplication02% dimensions
\box\scratchbox
\stopTEXpage
\expandafter \stoptext
\fi
\endbuffer
\egroup
% \doifelse\jobsuffix{dvi}\donetrue\donefalse
% \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}%
\executesystemcommand{texexec --tex=pdftex --format=plain \bufferprefix\@@texapp.tex}%
% \ifdone % eps
% \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}%
% \else % pdf
% \executesystemcommand{dvips \bufferprefix\@@texapp}%
% \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
% \fi
% \restoreTEXapplication % dimensions
\setbox\scratchbox\hbox
{\expanded{\externalfigure
% [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi]
[\bufferprefix\@@texapp.pdf]
[\c!object=\v!nee]}}%
% \setbox\scratchbox\hbox
% {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}%
% \wd\scratchbox\dimen0
% \ht\scratchbox\dimen2
% \dp\scratchbox\zeropoint
\ruledhbox\bgroup
\box\scratchbox
\egroup
\egroup}


\def\startMUSICTEX
  {\dosingleempty\dostartMUSICTEX}

\long\def\dostartMUSICTEX[#1]#2\stopMUSICTEX
  {\startTEXapplication[#1]
     {\input musicnft\relax
      \input musictex\relax
      \hsize5cm}#2%
   \stopTEXapplication}

\protect

\starttext

\starthiding

\startMUSICTEX
  \def\nbinstruments{1}\relax % a single instrument
  \generalmeter{\meterfrac{4}{4}}\relax % 4/4 meter chosen
  \debutextrait % starting real score
  \normal % normal 12 pt note spacing
  \temps\Notes\ibu0f0\qh0{cge}\tbu0\qh0g\enotes
  \finextrait % terminate excerpt
\stopMUSICTEX

\startMUSICTEX
  \def\nbinstruments{3}\relax % a single instrument
  \debutextrait % starting real score
  \temps
    \Notes\ibu0f0\qh0{cge}\tbu0\qh0g\enotes
    \Notes\ibu0f0\qh0{cge}\tbu0\qh0g\enotes
  \finextrait % terminate excerpt
\stopMUSICTEX

\stophiding

\startMUSICTEX
 \generalsignature{1}%
 \def\nbinstruments{1}%
\debutextrait
 \NOtes\zsong{Au }\qu g\enotes
 \NOtes\zsong{clair }\qu g\enotes
 \NOtes\zsong{de }\qu g\enotes
 \NOtes\zsong{la }\qu h\enotes
 \finextrait
\stopMUSICTEX

\stoptext

Willi has played with this and maybe the two of you can figure out what this should look like for lilypond.

2 - make Lilypond team understand how ConTeXt is much
    more interesting as automatic formatic tool for
    creating pdf than LaTeX is!

go ahead ...


3 - Allow using lilypond inside ConTeXt with
          \startmusic
      \stopmusic
        I think this method would be much like typesetting
    chimical
    Hans has not to be developping a nex package, just
    using one that already exist

see a few lines back


Also I think Lilipond could interest much more people
that the only short xTeX poeple user.
But Lilipond in not as easy to install (to many LaTeX
dependancy).

which is strange since there is not much latex needed for music


So the Lilypond tead could be interested by the new future
alternative ConTeXt-live CDROM distribution ;-)

ConTeXt-live (alias LaTeX-3: the only "nothing to install"
TeX based type system that allow to do :
- Mathematical,
- graphical (Metapost),
- Chimical,
- Musical
hight quality pdf documentation or web based presentation!!!



P.S.
I don't (yet) use  Lilypond, but I looked after some text based
Music notation for my wife.
I thought first to MusixTex (too eavy, too old) then the abc format
(which could be import as ps/pdf figure), then I found that
lilypond was closely related to TeX.
So it's probably the choice I'll do.

i suggest that you mail a bit with Willi Egger (also on this list) in order to sort out how to proceed; i can hack tha macros once i know what needs to be done


Hans

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to