ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* lilypond newbie
@ 2007-05-09 11:47 Steffen Wolfrum
  2007-05-09 13:19 ` Aditya Mahajan
  2007-05-09 21:31 ` Henning Hraban Ramm
  0 siblings, 2 replies; 22+ messages in thread
From: Steffen Wolfrum @ 2007-05-09 11:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

just out of curiosity I wanted to check whether my context could typeset music.
I found lilypond mentioned on the list, downloaded 
lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org, 
t-lilypond.pdf from ctan and 
t-lilypond.tex posted by Henning here.


When I typeset texexec test.test this test file ...

\usemodule[lilypond]

\starttext

\startlilypond 
% Telemann, TWV 40:11 
\version "2.6.3" 
\relative c’ { 
\set Staff.instrument = flute 
\key fis \minor 
\time 3/4 
\partial 4 
r8 fis’8 | fis4. cis8 a cis | fis, a cis fis a fis | 
b, d fis b d b | eis,, gis cis eis gis b, | 
a fis’ gis, fis’ cis eis | fis,4 r8 
a’ gis fis | e gis, a e’ fis cis | 
d fis, gis b e d | cis4 \trill r8 
cis b a | b dis e gis cis, b | 
a e’ dis fis b, a | gis4 \trill r8 
} 
\stoplilypond 

\stoptext


... the result is ...

name: dummy 
file: 
lilypond_2-lilypond-1 
state: unknown


What is missing?


Steffen

[OSX 10.4.9, Intel; ConTeXt  ver: 2007.01.12, TeX-Live2007]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-09 11:47 lilypond newbie Steffen Wolfrum
@ 2007-05-09 13:19 ` Aditya Mahajan
  2007-05-09 13:47   ` John R. Culleton
  2007-05-09 15:29   ` Steffen Wolfrum
  2007-05-09 21:31 ` Henning Hraban Ramm
  1 sibling, 2 replies; 22+ messages in thread
From: Aditya Mahajan @ 2007-05-09 13:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 9 May 2007, Steffen Wolfrum wrote:

> Hi,
>
> just out of curiosity I wanted to check whether my context could typeset music.
> I found lilypond mentioned on the list, downloaded
> lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org,
> t-lilypond.pdf from ctan and
> t-lilypond.tex posted by Henning here.
>
>
> When I typeset texexec test.test this test file ...
>
> ... the result is ...
>
> name: dummy
> file:
> lilypond_2-lilypond-1
> state: unknown
>
>
> What is missing?

Do you have write18 enabled? Check the wiki to see how to check if it 
is enabled, and how to enable it.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-09 13:19 ` Aditya Mahajan
@ 2007-05-09 13:47   ` John R. Culleton
  2007-05-09 15:29   ` Steffen Wolfrum
  1 sibling, 0 replies; 22+ messages in thread
From: John R. Culleton @ 2007-05-09 13:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wednesday 09 May 2007 09:19, Aditya Mahajan wrote:
> On Wed, 9 May 2007, Steffen Wolfrum wrote:
> > Hi,
> >
> > just out of curiosity I wanted to check whether my context could
> > typeset music. I found lilypond mentioned on the list, downloaded
> > lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org,
> > t-lilypond.pdf from ctan and
> > t-lilypond.tex posted by Henning here.
> >
> >
> > When I typeset texexec test.test this test file ...
> >
> > ... the result is ...
> >
> > name: dummy
> > file:
> > lilypond_2-lilypond-1
> > state: unknown
> >
> >
> > What is missing?
>
> Do you have write18 enabled? Check the wiki to see how to check if
> it is enabled, and how to enable it.
>
> Aditya

I typeset music using mup available for about $29 USD at 
www.arkkra.com. The support from  the authors is excellent and free 
updates occur once a year. I suppose it would be possible to embed a 
mup document source code in a tex document, write it to a file, and 
hte import the resulting ps file. But I use it as a pure stand alone 
creator. BTW it also will create  a midi file from the same source.  
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com



_________________________________________________________________
Need personalized email and website? Look no further. It's easy
with Doteasy $0 Web Hosting! Learn more at www.doteasy.com
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-09 13:19 ` Aditya Mahajan
  2007-05-09 13:47   ` John R. Culleton
@ 2007-05-09 15:29   ` Steffen Wolfrum
  1 sibling, 0 replies; 22+ messages in thread
From: Steffen Wolfrum @ 2007-05-09 15:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 9 May 2007 09:19:19 -0400 (EDT), Aditya Mahajan wrote:
> On Wed, 9 May 2007, Steffen Wolfrum wrote:
> 
>> Hi,
>> 
>> just out of curiosity I wanted to check whether my context could 
>> typeset music.
>> I found lilypond mentioned on the list, downloaded
>> lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org,
>> t-lilypond.pdf from ctan and
>> t-lilypond.tex posted by Henning here.
>> 
>> 
>> When I typeset texexec test.test this test file ...
>> 
>> ... the result is ...
>> 
>> name: dummy
>> file:
>> lilypond_2-lilypond-1
>> state: unknown
>> 
>> 
>> What is missing?
> 
> Do you have write18 enabled? Check the wiki to see how to check if it 
> is enabled, and how to enable it.


Yes, I do:

TeXExec | processing document 'lilypond_2.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | writing option file lilypond_2.top
TeXExec | using randomseed 870
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 \write18 enabled.
 %&-line parsing enabled.
 (/usr/local/texlive/2007/texmf/web2c/natural.tcx)
entering extended mode
(./lilypond_2.tex

ConTeXt  ver: 2007.01.12 15:56 MKII  fmt: 2007.4.3  int: english/english

...
systems         : system commands are enabled
system          : module lilypond loaded
(./t-lilypond.tex) (./lilypond_2.tuo) (./lilypond_2.tuo) (./lilypond_2.tuo)
(./lilypond_2.tuo) (./lilypond_2.tuo) (./lilypond_2.tuo) (./lilypond_2.tuo)
(./lilypond_2.tuo) (./lilypond_2.tuo) (./lilypond_2.tuo)
(/usr/local/texlive/2007/texmf-dist/tex/context/base/sort-def.tex)
(/usr/local/texlive/2007/texmf-dist/tex/context/base/sort-lan.tex)
(./lilypond_2.tuo) (./lilypond_2.tuo)
(/usr/local/texlive/2007/texmf-dist/tex/context/base/pdfr-def.tex)PsToPdf | file lilypond_2-lilypond-1.eps does not exist

systems         : begin file lilypond_2 at line 3
figures         : figure lilypond_2-lilypond-1.pdf can not be found
color           : mpcmyk color space is supported
color           : mpspot color space is supported
color           : system rgb is local activated
...
systems         : end file lilypond_2 at line 23
 ){/usr/local/texlive/2007/texmf-dist/fonts/enc/dvips/lm/lm-ec.enc}</usr/local/
texlive/2007/texmf-dist/fonts/type1/public/lm/lmr12.pfb></usr/local/texlive/200
7/texmf-dist/fonts/type1/public/lm/lmtt8.pfb>
Output written on lilypond_2.pdf (1 page, 38475 bytes).
Transcript written on lilypond_2.log.
TeXUtil | parsing file lilypond_2.tui
TeXUtil | shortcuts : 169
TeXUtil | expansions: 308
TeXUtil | reductions: 0
TeXUtil | divisions : 0
TeXUtil | loaded files: 1
TeXUtil | temporary files: 0
TeXUtil | commands: 23
TeXUtil | programs: 0
TeXUtil | tuo file saved
TeXExec | runtime: 1.383958


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-09 11:47 lilypond newbie Steffen Wolfrum
  2007-05-09 13:19 ` Aditya Mahajan
@ 2007-05-09 21:31 ` Henning Hraban Ramm
  2007-05-10  7:36   ` Steffen Wolfrum
  1 sibling, 1 reply; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-09 21:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]

Am 2007-05-09 um 13:47 schrieb Steffen Wolfrum:

\enableregime[utf]
> \usemodule[lilypond]
>
> \starttext
>
> \startlilypond
> % Telemann, TWV 40:11
> \version "2.6.3"

far tool old! use the latest LilyPond 2.10.x!
(the module works only with LilyPond > 2.8, as mentioned on the wiki  
page)

> \relative c’ {

You've always ’ instead of ' -- that can't work!
We need code, not typography!

> \set Staff.instrument = flute
> \key fis \minor
> \time 3/4
> \partial 4
> r8 fis’8 | fis4. cis8 a cis | fis, a cis fis a fis |
> b, d fis b d b | eis,, gis cis eis gis b, |
> a fis’ gis, fis’ cis eis | fis,4 r8
> a’ gis fis | e gis, a e’ fis cis |
> d fis, gis b e d | cis4 \trill r8

I'm not completely sure, but I think the \trills should be attached  
to the previous note.

> cis b a | b dis e gis cis, b |
> a e’ dis fis b, a | gis4 \trill r8
> }
> \stoplilypond
>
> \stoptext

Probably you will experience further problems as soon as you use more  
than one LilyPond snippet - at the moment the Ruby texexec doesn't  
process more than one, the old Perl texexec does, though.
Aditya is hunting the bug (I hope).

Please find attached my latest version of t-lilypond (has some more  
options).

BTW I always check my LilyPond code with LilyPond first - the call  
via ConTeXt is far too slow for debugging!
And you wouldn't blame ConTeXt or the poor module for your errorneous  
LP code.

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

[-- Attachment #2: t-lilypond.tex --]
[-- Type: application/octet-stream, Size: 10966 bytes --]

%D \module
%D	[		 file=t-lilypond,
%D		    version=2007.05.09,
%D		         title=\CONTEXT\ User Modules,
%D		   subtitle=Lilypond Connections (Music Typesetting),
%D		    author=Christopher Creutzig \& Henning Hraban Ramm,
%D	                 date=\currentdate,
%D	          copyright=Christopher Creutzig]

%M \usemodule[lilypond]

%D This module serves to include LilyPond music directly in the
%D \CONTEXT\ source, just as \METAPOST\ code can be.
%D It should work from LilyPond version 2.8 (checked with 2.10).
%D Before starting with the implementation, one or two examples are in order.
%D
%D \startbuffer[sample]
%D \startlilypond
%D % Telemann, TWV 40:11
%D 
%D \relative c' {
%D \set Staff.instrumentName = flute
%D \key fis \minor
%D \time 3/4
%D \partial 4
%D 
%D	 r8 fis'8 | fis4. cis8 a cis | fis, a cis fis a fis |
%D	 b, d fis b d b | eis,, gis cis eis gis b, |
%D	 a fis' gis, fis' cis eis | fis,4 r8
%D	 a' gis fis | e gis, a e' fis cis |
%D	 d fis, gis b e d | cis4 \trill r8
%D	 cis b a | b dis e gis cis, b |
%D	 a e' dis fis b, a | gis4 \trill r8
%D }
%D \stoplilypond
%D \stopbuffer
%D
%D The input
%D
%D \typebuffer[sample]
%D
%D is typeset as
%D
%D \getbuffer[sample]
%D
%D \type{\startlilypond} accepts options, as in\crlf
%D \type{\startlilypond[staffsize=24, linewidth=14cm, indent=5cm, time=no,clef=no]}:
%D 
%D \nobreak
%D \startlilypond[staffsize=24,linewidth=14cm,indent=5cm,time=no,clef=no]
%D \version "2.10.23" % not necessary
%D \relative c' {
%D \set Staff.instrumentName = flute
%D \key fis \minor
%D \time 3/4
%D \partial 4
%D	 r8 fis'8 | fis4. cis8 a cis | fis, a cis fis a fis |
%D	 b, d fis b d b | eis,, gis cis eis gis b, |
%D	 a fis' gis, fis' cis eis | fis,4 r8
%D	 a' gis fis | e gis, a e' fis cis |
%D	 d fis, gis b e d | cis4 \trill r8
%D	 cis b a | b dis e gis cis, b |
%D	 a e' dis fis b, a | gis4 \trill r8
%D }
%D \stoplilypond
%D
%D It is also possible to mix text and music:
%D \lower 8.2pt\hbox{\lilypond[fragment=true,staffsize=16,time=no]{g'}} is a g.
%D
%D {\bf Complete list of options:}
%D
%D \starttabulate
%D	\NC	option\NC	default\NC	comment\NR\HL
%D	\NC	staffsize\NC	20\NC	 in pt	\NR
%D	\NC	indent\NC	0pt\NC	 first line indent	\NR
%D	\NC	time\NC	yes\NC	 count time? (i.e. show time signature, set bars, split line)	\NR
%D	\NC	clef\NC	yes\NC	 show clef?	\NR
%D	\NC	linewidth\NC	\\localhsize\NC		\NR
%D	\NC	betweensystemspace\NC	54pt\NC	space between systems	\NR
%D	\NC	height\NC	\\textheight\NC		\NR
%D	\NC	align\NC	?\NC	 default depends on fragment=...	\NR
%D	\NC	fragment\NC	no\NC		\NR
%D	\NC	barnumbers\NC	no\NC	 show numbers of measures?	\NR
%D	\NC	showempty\NC	no\NC	 drop empty staves?	\NR
%D	\NC	seriffont\NC	"Century Schoolbook L"\NC	 font for e.g. lyrics	\NR
%D	\NC	sansfont\NC	"LMSans10"\NC	 font for e.g. chords	\NR
%D	\NC	monofont\NC	"Courier" \NC	 normally not used	\NR
%D \stoptabulate
%D
%D TODO: The \type{\lower} in the example above should not be necessary.
%D
%D TODO: Proper support for multipage results.
%D
%D TODO: lilypond -> \CONTEXT.
%D
%D \page
%D Now for the implementation.	As usual, we use a prefix for buffers,
%D \type{\getparameters} etc.:

\unprotect
\def\??lily{lilypond-}

%D Define the text snippets to be placed around fragments.
%D Since lilypond uses similar syntax to \TeX, we must do some catcode fiddling.
\def\lily!slash{/}

\bgroup
\catcode`\/=\@@escape
/catcode`/\=/@@other
/catcode`/#=/@@other
/catcode`/<=/@@begingroup
/catcode`/>=/@@endgroup
/catcode`/{=/@@other
/catcode`/}=/@@other
/catcode`/%=/@@other
/catcode`/-=/@@letter
/gdef/lily!fragmentprefix<
/string^^J
/string^^J
{/string^^J
% ly snippet contents follows:/string^^J
>

/gdef/lily!fragmentsuffix</string^^J
% end ly snippet/string^^J
}/string^^J
>

/gdef/lily!prefix</string^^J
/string^^J
#(ly:set-option (quote no-point-and-click))/string^^J
/string^^J
\version "2.10.99"/string^^J
#(define version-seen? #t)/string^^J
\layout {/string^^J
/iflily!time/else
% switch off time signature (i.e. only one line, no bars)/string^^J
	ragged-last = ##t/string^^J
	\context { \Score timing = ##f }/string^^J
	\context { \Staff \remove "Time_signature_engraver" }/string^^J
/string^^J/fi
/iflily!barnumbers/else
% switch off bar numbers/string^^J
	\context { \Score \remove "Bar_number_engraver" }/string^^J
/fi
/string^^J
/iflily!showempty/else
% drop empty staves/string^^J
	\context { \RemoveEmptyStaffContext }/string^^J
	\context { \Score \override VerticalAxisGroup #'remove-first = ##t }/string^^J
/fi
/string^^J
/iflily!clef/else
% switch off clef sign/string^^J
	\context { \Staff \remove "Clef_engraver" }/string^^J
/fi
/string^^J
	#(define fonts
		(make-pango-font-tree
		/lilypond-seriffont/space
		/lilypond-sansfont/space
		/lilypond-monofont/space
	(/lily!slash/space/lilypond-staffsize/space 20)))/string^^J
/string^^J
}/string^^J
\paper {/string^^J
	#(define dump-extents #t)/string^^J
	ragged-right = /iflily!align ##f/else ##t/fi/string^^J
	indent = /withoutpt/the/lily!indent\pt/string^^J
	line-width = /withoutpt/the/lily!linewidth\pt/string^^J
	vsize = /withoutpt/the/lily!vsize\pt/string^^J
	printpagenumber = ##f/string^^J
	oddFooterMarkup=##f/string^^J
	oddHeaderMarkup=##f/string^^J
	bookTitleMarkup = ##f/string^^J
	scoreTitleMarkup = ##f/string^^J
	ragged-bottom=##t/string^^J
	ragged-last-bottom=##t/string^^J
	between-system-padding = #0/string^^J
	between-system-space = /withoutpt/the/lily!betweensystemspace\pt/string^^J
}/string^^J
>

/gdef/lily!hash<#>
/egroup

\newdimen\lily!linewidth
\newdimen\lily!vsize
\newdimen\lily!indent
\newdimen\lily!betweensystemspace
\newif\iflily!align
\newif\iflily!clef
\newif\iflily!time
\newif\iflily!barnumbers
\newif\iflily!showempty

\newcount\lily!figures

%D Again, as usual, there is a \type{\setuplilypond} command
%D that accepts the same parameters as \type{\lilypond} and
%D \type{\startlilypond} do in their optional argument.

\def\setuplilypond{%
  \start\catcode`\#=\@@other%
  \dosingleempty\dosetuplilypond%
}

\def\dosetuplilypond[#1]{%
  \stop% restore \catcode`\#
  \getparameters[\??lily][#1]%
}

%D We set the following defaults:
\setuplilypond
	[staffsize=20,
	indent=0pt,
	betweensystemspace=54pt,
	time=\v!yes,
	clef=\v!yes,
	align=?,% default depends on fragment=...
	fragment=\v!no,
	barnumbers=\v!no,
	showshowemptyempty=\v!no,
	seriffont="Century Schoolbook L", % LilyPond default font
	sansfont="LMSans10",
	monofont="Bitstream Vera Sans Mono",
	]

%D If you want to know which fonts of your system LilyPond can see
%D with which names, try \type{lilypond -dshow-available-fonts any}.
%D (The 3rd parameter is necessary, but can be anything.)
%D There are a lot of restrictions, e.g. no fonts from the TeX tree (don't know why),
%D only one face per font file etc.

%D \type{\startlilypond} is a multistage implementation, because
%D end-of-line characters must be treated specially in the
%D \type{\startlilypond}\textellipsis\type{\stoplilypond} range.
\def\startlilypond{%
	\dosingleempty\dostartlilypond%
}

\def\dostartlilypond[#1]{%
 	\bgroup%
	\obeylines%
	\catcode`\#=\@@other%
	\dodostartlilypond[{#1}]%
}

\long\def\dodostartlilypond[#1]#2\stoplilypond{%
	\egroup% from \dostartlilypond
	\bgroup%
%D The default of the \type{linewidth} parameter is the local \type{\hsize}.
	\setlocalhsize
	\getparameters[\??lily][linewidth=\the\localhsize,height=\the\textheight,#1]%
	\lily!linewidth\dimexpr\getvalue{\??lily linewidth}\relax
	\lily!vsize\dimexpr\getvalue{\??lily height}\relax
	\lily!indent\dimexpr\getvalue{\??lily indent}\relax
	\lily!betweensystemspace\dimexpr\getvalue{\??lily betweensystemspace}\relax
%D The default of \type{align} depends on whether we typeset a fragment:
	\@EAEAEA\doifelse\getvalue{\??lily align}{\v!yes}%
		\lily!aligntrue\lily!alignfalse
	\@EAEAEA\doif\getvalue{\??lily fragment}{\v!no}{%
		\@EAEAEA\doif\getvalue{\??lily align}?
			\lily!aligntrue
	}%
	\@EAEAEA\doifelse\getvalue{\??lily time}\v!yes
		\lily!timetrue\lily!timefalse
	\@EAEAEA\doifelse\getvalue{\??lily barnumbers}\v!yes
		\lily!barnumberstrue\lily!barnumbersfalse
	\@EAEAEA\doifelse\getvalue{\??lily showempty}\v!yes
		\lily!showemptytrue\lily!showemptyfalse
	\@EAEAEA\doifelse\getvalue{\??lily clef}\v!yes
		\lily!cleftrue\lily!cleffalse
%D We are using a counter to keep the different lilypond pieces
%D separate.	This allows to typeset them only once, during the
%D first run.
%D
%D TODO: This won't work any longer once we pass the remaining
%D vertical space to lilypond.
	\global\advance\lily!figures\plusone
	\def\lily!filename{\bufferprefix lilypond-\the\lily!figures}
	%\startmode[*\v!first]% 
	\def\obeyedlines{\string^^J}%
	\convertargument#2\to\ascii
	\expanded{%
	\setbuffer[lilypond-\the\lily!figures]%
	\lily!prefix
	\lily!hash(set-global-staff-size \getvalue{\??lily staffsize})\string^^J%
	\ifundefined{\??lily fragment}\else\lily!fragmentprefix\fi
	%% TODO: Option "packed"
	\ascii%
	\ifundefined{\??lily fragment}\else\lily!fragmentsuffix\fi
	}% expanded
	\endbuffer%
%D Generating a pdf directly always creates a whole page, so we generate eps first.
%D
%D If \type{\ifeof18} creates an error for you, your pdfetex is too old.
%D just change it to \iftrue then.	 (\type{\ifeof18} checks whether \type{\write18}
%D is disabled.)
	
	%\def\LP{echo LILYPOND \lily!filename.tmp}
	%\def\PDF{echo PStoPDF \lily!filename.eps}
	\def\LP{texmfstart --ifchanged=\lily!filename.tmp --exec bin:lilypond -b eps -dno-gs-load-fonts -dinclude-eps-fonts \lily!filename.tmp}
	\def\PDF{texmfstart --ifchanged=\lily!filename.eps pstopdf \lily!filename.eps}
	\ifeof18
		\installprogram{\LP}%
		\doif\jobsuffix{pdf}{%
			\installprogram{\PDF}%
		}%
	\else
		\executesystemcommand{\LP}%
		\doif\jobsuffix{pdf}{%
			\executesystemcommand{\PDF}%
		}%
	\fi
	%\stopmode% only first run
	\doifelse\jobsuffix{pdf}
		{\def\lily!img{\lily!filename.pdf}}%
		{\def\lily!img{\lily!filename.eps}}%
%D
%D TODO: Get the relevant dimension directly from lilypond,
%D to place the instrument name into the left margin for
%D short snippets as well.
%D If we are not in the middle of some text, we have to check
%D whether lilypond created an image that is wider than requested:
%D It places the instrument names in the left margin.
%D
	\ifvmode
		\getfiguredimensions[\lily!filename.pdf]%
		\leavevmode%
		\newdimen\FigWidth
		\FigWidth=\figurewidth
		\ifdim\FigWidth>\localhsize
			\!!dimena=\localhsize
			\advance\!!dimena by-\FigWidth
			\noindent\hskip\!!dimena
		\fi
	\fi
	\externalfigure[\lily!img]%
	\egroup%
}%

%D For short snippets, we define an inline alternative to
%D our start/stop pair:
\def\lilypond{\dosingleempty\dolilypond}

\def\dolilypond[#1]#2{\startlilypond[#1]#2\stoplilypond}

\protect
%D End of file

%%% snippet clipboard %%%

% no longer needed:
%%#(set! toplevel-score-handler print-score-with-defaults)/string^^J
%%#(set! toplevel-music-handler 
%	(lambda (p m) 
%	(if (not (eq? (ly:music-property m 'void) #t)) 
%			(print-score-with-defaults 
%			p (scorify-music m p)))))/string^^J

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #4: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-09 21:31 ` Henning Hraban Ramm
@ 2007-05-10  7:36   ` Steffen Wolfrum
  2007-05-10 13:44     ` Arthur Reutenauer
  2007-05-29 11:10     ` lilypond newbie Piotr Kopszak
  0 siblings, 2 replies; 22+ messages in thread
From: Steffen Wolfrum @ 2007-05-10  7:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 9 May 2007 23:31:00 +0200, Henning Hraban Ramm wrote:
> Am 2007-05-09 um 13:47 schrieb Steffen Wolfrum:
> 
> \enableregime[utf]
>> \usemodule[lilypond]
>> 
>> \starttext
>> 
>> \startlilypond
>> % Telemann, TWV 40:11
>> \version "2.6.3"
> 
> far tool old! use the latest LilyPond 2.10.x!
> (the module works only with LilyPond > 2.8, as mentioned on the wiki page)
> 
>> \relative c’ {
> 
> You've always ’ instead of ' -- that can't work!
> We need code, not typography!


Pardon?! 

The example you refer to is from the recent version of "t-lilypond.pdf" from ctan
as I wrote in my initial posting (see below).

As I had to start somewhere, I thought it's a good start to use the most recent versions of
lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org, 
t-lilypond.pdf from ctan and 
t-lilypond.tex that you have posted here last week.


I have no idea why this leads to statements like "far tool old" and "We need code, not typography!".

But it seems something is wrong here.

Steffen





On Wed, 9 May 2007 13:47:53 +0200, Steffen Wolfrum wrote:
...
> I found lilypond mentioned on the list, downloaded 
> lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org, 
> t-lilypond.pdf from ctan and 
> t-lilypond.tex posted by Henning here.
> 
> 
> When I typeset texexec test.test this test file ...
> 
> \usemodule[lilypond]
> 
> \starttext
> 
> \startlilypond 
> % Telemann, TWV 40:11 
> \version "2.6.3" 
> \relative c’ { 
> \set Staff.instrument = flute 
> \key fis \minor 
> \time 3/4 
> \partial 4 
> r8 fis’8 | fis4. cis8 a cis | fis, a cis fis a fis | 
> b, d fis b d b | eis,, gis cis eis gis b, | 
> a fis’ gis, fis’ cis eis | fis,4 r8 
> a’ gis fis | e gis, a e’ fis cis | 
> d fis, gis b e d | cis4 \trill r8 
> cis b a | b dis e gis cis, b | 
> a e’ dis fis b, a | gis4 \trill r8 
> } 
> \stoplilypond 
> 
> \stoptext



Steffen

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-10  7:36   ` Steffen Wolfrum
@ 2007-05-10 13:44     ` Arthur Reutenauer
  2007-05-10 19:02       ` Henning Hraban Ramm
  2007-05-29 11:10     ` lilypond newbie Piotr Kopszak
  1 sibling, 1 reply; 22+ messages in thread
From: Arthur Reutenauer @ 2007-05-10 13:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

	Hallo Steffen,

> I have no idea why this leads to statements like "far tool old" and
> "We need code, not typography!".

  You have two different problems:

  * The version of the Lilypond module on CTAN isn't actually that new
since it dates back to September 2005 (according to the date of
t-lilypond.pdf). Now even without that date, we can spot it in the code
since it mentions the version of Lilypond it was typed for (this is a
general request in Lilypond); in that case it's 2.6; so Hraban meant
your code was old, not your executable (current version is 2.10).

 * You probably copypasted the code from the PDF, and the quotes were
interpreted as a “nice quotes” from Unicode (U+2019 RIGHT SINGLE
QUOTATION MARK), not a plain ASCII quote. This of course is a problem
since the right single quotation mark isn't part of the Lilypond markup
at all, but it's “typography”, so to say.

  In any case, just take the example from the file Hraban just posted
and it should solve both problems (it does here). And Hraban should
probably add a \version statement to his sample code ;-)
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-10 13:44     ` Arthur Reutenauer
@ 2007-05-10 19:02       ` Henning Hraban Ramm
  2007-05-10 20:05         ` Aditya Mahajan
  2007-05-11 16:31         ` Mojca Miklavec
  0 siblings, 2 replies; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-10 19:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-05-10 um 15:44 schrieb Arthur Reutenauer:
>   * The version of the Lilypond module on CTAN isn't actually that new
> since it dates back to September 2005 (according to the date of
> t-lilypond.pdf). Now even without that date, we can spot it in the  
> code
> since it mentions the version of Lilypond it was typed for (this is a
> general request in Lilypond); in that case it's 2.6; so Hraban meant
> your code was old, not your executable (current version is 2.10).

I meant both ;-)

I didn't even knew there was a version of t-lilypond on CTAN  
(overlooked that in Steffen's post).
(It's a known problem that ConTeXt versions on CTAN are often  
outdated, too.)
I should update the contextgarden version, but I wanted to wait if  
Aditya could find the error with Ruby texexec and clean up the code a  
bit.

>   In any case, just take the example from the file Hraban just posted
> and it should solve both problems (it does here). And Hraban should
> probably add a \version statement to his sample code ;-)

I was tired of the version statements in every snippet, so I let the  
module add a version statement.

It's impossible to take care of different LilyPond versions in one  
module, so I always try to stick with (and change syntax for) the  
latest - "always" meaning "everytime I work at a songbook".

LilyPond is a rather fast moving target, like ConTeXt, so some code  
becomes old very soon...

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-10 19:02       ` Henning Hraban Ramm
@ 2007-05-10 20:05         ` Aditya Mahajan
  2007-05-11 16:31         ` Mojca Miklavec
  1 sibling, 0 replies; 22+ messages in thread
From: Aditya Mahajan @ 2007-05-10 20:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Thu, 10 May 2007, Henning Hraban Ramm wrote:

> Am 2007-05-10 um 15:44 schrieb Arthur Reutenauer:
>>   * The version of the Lilypond module on CTAN isn't actually that new
>> since it dates back to September 2005 (according to the date of
>> t-lilypond.pdf). Now even without that date, we can spot it in the
>> code
>> since it mentions the version of Lilypond it was typed for (this is a
>> general request in Lilypond); in that case it's 2.6; so Hraban meant
>> your code was old, not your executable (current version is 2.10).
>
> I meant both ;-)
>
> I didn't even knew there was a version of t-lilypond on CTAN
> (overlooked that in Steffen's post).
> (It's a known problem that ConTeXt versions on CTAN are often
> outdated, too.)
> I should update the contextgarden version, but I wanted to wait if
> Aditya could find the error with Ruby texexec and clean up the code a
> bit.

Sorry for being the bottleneck, but I have been awfully busy this week.

Maybe, you should go ahead and update the module at garden. When I get the 
chance to test the changes that I was thinking about, a new version will 
need to be uploaded anyways.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-10 19:02       ` Henning Hraban Ramm
  2007-05-10 20:05         ` Aditya Mahajan
@ 2007-05-11 16:31         ` Mojca Miklavec
  2007-05-14  7:45           ` Steffen Wolfrum
  1 sibling, 1 reply; 22+ messages in thread
From: Mojca Miklavec @ 2007-05-11 16:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Patrick Gundlach

On 5/10/07, Henning Hraban Ramm wrote:
>
> I didn't even knew there was a version of t-lilypond on CTAN
> (overlooked that in Steffen's post).

You cannot escape the big brother ;)

> (It's a known problem that ConTeXt versions on CTAN are often
> outdated, too.)

If we're speaking about ConTeXt, that's partly intentional. (It gets
updated only when Taco explicitely submits it - when he thinks the
version is less buggy that on average.)

If you're speaking about the modules: updates to CTAN are curretly
manual. CTAN team asked for rsync access to the modules. Now they have
it, but didn't respond yet. I guess it's not automatic yet ... but
should become so sooner or later.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-11 16:31         ` Mojca Miklavec
@ 2007-05-14  7:45           ` Steffen Wolfrum
  2007-05-14 21:39             ` Henning Hraban Ramm
  0 siblings, 1 reply; 22+ messages in thread
From: Steffen Wolfrum @ 2007-05-14  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

So, after extensive testing (with support from Arthur) using the lilypond-module (as described) just doesn't work at all.

What to do now? 

As it seems to be a question of several parts working / not working together, who feels "responsible"?


Steffen




On Fri, 11 May 2007 18:31:10 +0200, Mojca Miklavec wrote:
> On 5/10/07, Henning Hraban Ramm wrote:
>> 
>> I didn't even knew there was a version of t-lilypond on CTAN
>> (overlooked that in Steffen's post).
> 
> You cannot escape the big brother ;)
> 
>> (It's a known problem that ConTeXt versions on CTAN are often
>> outdated, too.)
> 
> If we're speaking about ConTeXt, that's partly intentional. (It gets
> updated only when Taco explicitely submits it - when he thinks the
> version is less buggy that on average.)
> 
> If you're speaking about the modules: updates to CTAN are curretly
> manual. CTAN team asked for rsync access to the modules. Now they have
> it, but didn't respond yet. I guess it's not automatic yet ... but
> should become so sooner or later.
> 
> Mojca
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an 
> entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-14  7:45           ` Steffen Wolfrum
@ 2007-05-14 21:39             ` Henning Hraban Ramm
  2007-05-23 21:38               ` installprogram problem (was: lilypond newbie) Henning Hraban Ramm
  0 siblings, 1 reply; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-14 21:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-05-14 um 09:45 schrieb Steffen Wolfrum:

> So, after extensive testing (with support from Arthur) using the  
> lilypond-module (as described) just doesn't work at all.
> What to do now?
> As it seems to be a question of several parts working / not working  
> together, who feels "responsible"?

Did you try old Perl texexec?
(As I wrote several times, LilyPond doesn't get called - or one time  
at max - with Ruby texexec.)
But it seems to need one "Ruby" run afterwards.

Sorry, I can't help you further, I just don't understand most of the  
TeX internals needed.



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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem (was: lilypond newbie)
  2007-05-14 21:39             ` Henning Hraban Ramm
@ 2007-05-23 21:38               ` Henning Hraban Ramm
  2007-05-24  8:37                 ` installprogram problem Taco Hoekwater
  0 siblings, 1 reply; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-23 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-05-14 um 23:39 schrieb Henning Hraban Ramm:

> Did you try old Perl texexec?
> (As I wrote several times, LilyPond doesn't get called - or one time
> at max - with Ruby texexec.)
> But it seems to need one "Ruby" run afterwards.

I tried to track down my problem with texexec calling LilyPond.
In the module it says (at the moment):

...
	\def\LP{texmfstart --ifchanged=\lily!filename .tmp --exec  
bin:lilypond -b eps -dno-gs-load-fonts -dinclude-eps-fonts \lily! 
filename .tmp}
	\def\PDF{texmfstart --ifchanged=\lily!filename .eps pstopdf \lily! 
filename .eps}
	
	\ifeof18
		\writestatus{DEBUG-w18}{\LP}
		\installprogram{\LP}%
		\doif\jobsuffix{pdf}{%
			\installprogram{\PDF}%
		}%
	\else
...

So I get lots of messages like:
"""
DEBUG-w18       : texmfstart --ifchanged=prd_kanons-lilypond-16.tmp -- 
exec bin:
lilypond -b eps -dno-gs-load-fonts -dinclude-eps-fonts prd_kanons- 
lilypond-16.t
mp
"""

That means, the counter and the definition of \lily!filename are  
working.

But the execution of LilyPond (and pstopdf) is postponed, and at that  
later time, \lily!filename is always "prd_kanons-lilypond-1" (counter  
always 1), resulting in lots of identical messages:
"""
TeXUtil | running texmfstart --ifchanged=prd_kanons-lilypond-1.tmp -- 
exec bin:lilypond -b eps -dno-gs-load-fonts -dinclude-eps-fonts  
prd_kanons-lilypond-1.tmp
"""

So I guess the command or counter or whatever in \installprogram is  
expanded at runtime.
I tried \expanded, but it didn't help.

Maybe you have a clue?




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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-23 21:38               ` installprogram problem (was: lilypond newbie) Henning Hraban Ramm
@ 2007-05-24  8:37                 ` Taco Hoekwater
  2007-05-24 10:57                   ` Henning Hraban Ramm
  0 siblings, 1 reply; 22+ messages in thread
From: Taco Hoekwater @ 2007-05-24  8:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Hi,

Henning Hraban Ramm wrote:
> 
> So I guess the command or counter or whatever in \installprogram is  
> expanded at runtime.
> I tried \expanded, but it didn't help.

> Maybe you have a clue?

You have to run \installprogram{} on each separate, expanded
commandline.

Best wishes, Taco


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24  8:37                 ` installprogram problem Taco Hoekwater
@ 2007-05-24 10:57                   ` Henning Hraban Ramm
  2007-05-24 11:41                     ` Taco Hoekwater
  0 siblings, 1 reply; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-24 10:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 469 bytes --]

2007/5/24, Taco Hoekwater <taco@elvenkind.com>:
>
> > So I guess the command or counter or whatever in \installprogram is
> > expanded at runtime.
> > I tried \expanded, but it didn't help.
>
> You have to run \installprogram{} on each separate, expanded
> commandline.


I thought that was what I do.
\installcommand is run after every buffer.
I also tried \expanded{\installcommand{\LP}} and
\installcommand{\expanded{\LP}}, but neither did help.

Greetlings, Hraban

[-- Attachment #1.2: Type: text/html, Size: 748 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24 10:57                   ` Henning Hraban Ramm
@ 2007-05-24 11:41                     ` Taco Hoekwater
  2007-05-24 17:22                       ` Henning Hraban Ramm
  0 siblings, 1 reply; 22+ messages in thread
From: Taco Hoekwater @ 2007-05-24 11:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Henning Hraban Ramm wrote:
> 2007/5/24, Taco Hoekwater <taco@elvenkind.com>:
>>
>> > So I guess the command or counter or whatever in \installprogram is
>> > expanded at runtime.
>> > I tried \expanded, but it didn't help.
>>
>> You have to run \installprogram{} on each separate, expanded
>> commandline.
> 
> 
> I thought that was what I do.
> \installcommand is run after every buffer.
> I also tried \expanded{\installcommand{\LP}} and
> \installcommand{\expanded{\LP}}, but neither did help.

You probably should \edef \LP then?
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24 11:41                     ` Taco Hoekwater
@ 2007-05-24 17:22                       ` Henning Hraban Ramm
  2007-05-24 20:00                         ` Aditya Mahajan
  0 siblings, 1 reply; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-24 17:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-05-24 um 13:41 schrieb Taco Hoekwater:
>>>> So I guess the command or counter or whatever in \installprogram is
>>>> expanded at runtime.
>>>> I tried \expanded, but it didn't help.
>>> You have to run \installprogram{} on each separate, expanded
>>> commandline.
>> I thought that was what I do.
>> \installcommand is run after every buffer.
>> I also tried \expanded{\installcommand{\LP}} and
>> \installcommand{\expanded{\LP}}, but neither did help.
> You probably should \edef \LP then?

With \expanded{} I always get "incomplete iffalse", \edef doesn't  
change anything.

I tried to "outsource" the command and dropped the \ifeof18 (because  
\executesystemcommand doesn't seem to do anything anyway):

\def\doprocesslilypond#1{%
	\edef\LPFN{#1}%
	\writestatus{DEBUG-w18}{\LPFN}%
	\installprogram{texmfstart --ifchanged=\LPFN.tmp --exec bin:lilypond  
-b eps -dno-gs-load-fonts -dinclude-eps-fonts \LPFN.tmp}%
	\doif\jobsuffix{pdf}{%
		\installprogram{texmfstart --ifchanged=\LPFN.eps pstopdf \LPFN.eps}%
	}%
}

Still the same: \writestatus writes the right filename (enumerated),  
but the latter is always called with no.1
Of course I first tried just using #1 and only \def\LPFN.

As you wrote:
>>> You have to run \installprogram{} on each separate, expanded
>>> commandline.
perhaps you did overlook that, even if \installprogram is "run" after  
every buffer, the execution is postponed to the end of the texexec  
run - I'm rather sure the number get forgotten on the way of this  
postponing, but everything I tried to expand the number, failed.
But I don't really know what I'm doing while I try to program in TeX...
HELP!

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24 17:22                       ` Henning Hraban Ramm
@ 2007-05-24 20:00                         ` Aditya Mahajan
  2007-05-25  6:50                           ` Henning Hraban Ramm
  2007-05-25 16:59                           ` Hans Hagen
  0 siblings, 2 replies; 22+ messages in thread
From: Aditya Mahajan @ 2007-05-24 20:00 UTC (permalink / raw)
  To: ntg-context

Hi,

There is a bug in texutil.rb Here is a simple test. Create test.tex

\def\runprogram#1%
  {\installprogram{echo "#1"}}

\starttext

\runprogram{test}
\runprogram{test again}

\stoptext


and texexec it. Everything is fine at the TeX end, the tui file says
e p {echo "test"}
e p {echo "test again"}

However, the output says

TeXUtil | programs: 2
TeXUtil | tuo file saved
TeXUtil | running echo "test"
"test"
TeXUtil | running echo "test"
"test"
TeXExec | runtime: 0.892

that is, the first command was run both times.
Looking into texutil.rb, I think that the bug is in the definition of 
Myextras::finalizer method. In /scritps/ruby/base/texutil.rb change


  def MyExtras::finalizer(logger)
unless (ENV["CTX.TEXUTIL.EXTRAS"] =~ /^(no|off|false|0)$/io) || 
(ENV["CTX_TEXUTIL_EXTRAS"] =~ /^(no|off|false|0)$/io) then
          @@programs.each do |p|
              cmd = @@programs[p.to_i] #AM: why p.to_i              
#AM: p is the name of the program, hence a string
              #AM: p.to_i evaluates to 0 always, explaining the bug
              logger.report("running #{cmd}")
              system(cmd)
          end
      end
  end


to

  def MyExtras::finalizer(logger)
unless (ENV["CTX.TEXUTIL.EXTRAS"] =~ /^(no|off|false|0)$/io) || 
(ENV["CTX_TEXUTIL_EXTRAS"] =~ /^(no|off|false|0)$/io) then
          @@programs.each do |cmd|
              logger.report("running #{cmd}")
              system(cmd)
          end
      end
  end


and everything runs correctly. Hraban, I have not tested this with 
lilypond, but this may be part of the problem there.

Aditya

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24 20:00                         ` Aditya Mahajan
@ 2007-05-25  6:50                           ` Henning Hraban Ramm
  2007-05-25 16:59                           ` Hans Hagen
  1 sibling, 0 replies; 22+ messages in thread
From: Henning Hraban Ramm @ 2007-05-25  6:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-05-24 um 22:00 schrieb Aditya Mahajan:

> and everything runs correctly. Hraban, I have not tested this with
> lilypond, but this may be part of the problem there.

Thank you very much, Aditya, that is the WHOLE problem!

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-24 20:00                         ` Aditya Mahajan
  2007-05-25  6:50                           ` Henning Hraban Ramm
@ 2007-05-25 16:59                           ` Hans Hagen
  2007-05-25 17:35                             ` Aditya Mahajan
  1 sibling, 1 reply; 22+ messages in thread
From: Hans Hagen @ 2007-05-25 16:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> Hi,
>
> There is a bug in texutil.rb Here is a simple test. Create test.tex
>
>   
strange indeed, mayb esome leftover from the perl version 

fixed; thanks 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: installprogram problem
  2007-05-25 16:59                           ` Hans Hagen
@ 2007-05-25 17:35                             ` Aditya Mahajan
  0 siblings, 0 replies; 22+ messages in thread
From: Aditya Mahajan @ 2007-05-25 17:35 UTC (permalink / raw)
  To: ntg-context

Quoting Hans Hagen <pragma@wxs.nl>:

> Aditya Mahajan wrote:
>> Hi,
>>
>> There is a bug in texutil.rb Here is a simple test. Create test.tex
>>
>>
> strange indeed, mayb esome leftover from the perl version
>
> fixed; thanks

The to_i in def MyExtras::writer also looks suspicious. The tuo file 
has wrong information

% programs: 2
%
% echo "test" (echo "test")
% echo "test again" (echo "test")

I think that def MyExtras::writer can be simplified to

def MyExtras::writer(logger,handle)
    handle << logger.banner("programs: #{@@programs.size}")
    @@programs.each do |p|
#     handle << "% #{p} (#{@@programs[p.to_i]})\n"
      handle << "% #{p}\n"
    end
end

or maybe the slightly more informative

def MyExtras::writer(logger,handle)
    handle << logger.banner("programs: #{@@programs.size}")
    @@programs.each_with_index do |cmd, p|
#     handle << "% #{p} (#{@@programs[p.to_i]})\n"
      handle << "% #{p+1} (#{cmd})\n"
    end
end

BTW, using p as a variable name is not a good idea in ruby. p prints 
out the output of inspect, and is useful while debugging programs. 
Compare

a = /ad?/
b = a.match("Dad")
puts b
p b
puts b.inspect

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lilypond newbie
  2007-05-10  7:36   ` Steffen Wolfrum
  2007-05-10 13:44     ` Arthur Reutenauer
@ 2007-05-29 11:10     ` Piotr Kopszak
  1 sibling, 0 replies; 22+ messages in thread
From: Piotr Kopszak @ 2007-05-29 11:10 UTC (permalink / raw)
  To: ntg-context

On Thu, May 10, 2007 at 09:36:15AM +0200, Steffen Wolfrum wrote:
> On Wed, 9 May 2007 23:31:00 +0200, Henning Hraban Ramm wrote:
> > Am 2007-05-09 um 13:47 schrieb Steffen Wolfrum:
> > 
> > \enableregime[utf]
> >> \usemodule[lilypond]
> >> 
> >> \starttext
> >> 
> >> \startlilypond
> >> % Telemann, TWV 40:11
> >> \version "2.6.3"
> > 
> > far tool old! use the latest LilyPond 2.10.x!
> > (the module works only with LilyPond > 2.8, as mentioned on the wiki page)
> > 
> >> \relative c? {
> > 
> > You've always ? instead of ' -- that can't work!
> > We need code, not typography!
> 
> 
> Pardon?! 
> 
> The example you refer to is from the recent version of "t-lilypond.pdf" from ctan
> as I wrote in my initial posting (see below).
> 
> As I had to start somewhere, I thought it's a good start to use the most recent versions of
> lilypond-2.10.23-1.darwin-x86.tar.bz2 from lilypond.org, 
> t-lilypond.pdf from ctan and 
> t-lilypond.tex that you have posted here last week.
> 
> 
> I have no idea why this leads to statements like "far tool old" and "We need code, not typography!".
> 
> But it seems something is wrong here.
> 
> Steffen


I also had my first brush with the lilypond module recently and also
started with the example included in the manual. I don't know if I'm
right (having no idea about module's inner workings) but it seems that the
offending command is

\version "2.6.3"

after removing it everything went surprisingly smooth. 

Piotr

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-05-29 11:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-09 11:47 lilypond newbie Steffen Wolfrum
2007-05-09 13:19 ` Aditya Mahajan
2007-05-09 13:47   ` John R. Culleton
2007-05-09 15:29   ` Steffen Wolfrum
2007-05-09 21:31 ` Henning Hraban Ramm
2007-05-10  7:36   ` Steffen Wolfrum
2007-05-10 13:44     ` Arthur Reutenauer
2007-05-10 19:02       ` Henning Hraban Ramm
2007-05-10 20:05         ` Aditya Mahajan
2007-05-11 16:31         ` Mojca Miklavec
2007-05-14  7:45           ` Steffen Wolfrum
2007-05-14 21:39             ` Henning Hraban Ramm
2007-05-23 21:38               ` installprogram problem (was: lilypond newbie) Henning Hraban Ramm
2007-05-24  8:37                 ` installprogram problem Taco Hoekwater
2007-05-24 10:57                   ` Henning Hraban Ramm
2007-05-24 11:41                     ` Taco Hoekwater
2007-05-24 17:22                       ` Henning Hraban Ramm
2007-05-24 20:00                         ` Aditya Mahajan
2007-05-25  6:50                           ` Henning Hraban Ramm
2007-05-25 16:59                           ` Hans Hagen
2007-05-25 17:35                             ` Aditya Mahajan
2007-05-29 11:10     ` lilypond newbie Piotr Kopszak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).