ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* lilypond
@ 2007-07-03 15:59 Wolfgang Werners-Lucchini
  2007-07-06 20:25 ` lilypond Henning Hraban Ramm
  2007-08-27 10:28 ` lilypond Steffen Wolfrum
  0 siblings, 2 replies; 23+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-07-03 15:59 UTC (permalink / raw)
  To: ntg-context

Hallo!

I tryed the first wiki-example:
--------------------------------
There are some notes \lilypond{ \relative{bes a c b} } embedded in 
this line.
--------------------------------

With version 2.11.27 the lilypond option -b eps is unknown.
With version 2.10.25 the above example is a 3-page output:
(1) There are some notes
(2) lilypond-output 
(3) embedded in this line

Should I downgrad with lilypond?
Or what else I am doing wrong?

Wolfgang
___________________________________________________________________________________
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] 23+ messages in thread

* Re: lilypond
  2007-07-03 15:59 lilypond Wolfgang Werners-Lucchini
@ 2007-07-06 20:25 ` Henning Hraban Ramm
  2007-08-27 14:28   ` lilypond Mojca Miklavec
  2007-08-27 10:28 ` lilypond Steffen Wolfrum
  1 sibling, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2007-07-06 20:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Am 2007-07-03 um 17:59 schrieb Wolfgang Werners-Lucchini:

> I tryed the first wiki-example:
> --------------------------------
> There are some notes \lilypond{ \relative{bes a c b} } embedded in
> this line.
> --------------------------------
>
> With version 2.11.27 the lilypond option -b eps is unknown.
> With version 2.10.25 the above example is a 3-page output:
> (1) There are some notes
> (2) lilypond-output
> (3) embedded in this line
>
> Should I downgrad with lilypond?
> Or what else I am doing wrong?

Sorry, the publicly available LilyPond module is outdated. Try the  
attached one.

I delayed the publishing of my latest version because Ruby texexec  
had a bug that prevented lilypond from being called, I guess that's  
gone, but I had no time to check yet. And I didn't adapt the module  
to LilyPond 2.11, too. (2.10.2x should work.)

I don't know if inline LilyPond worked at any time, though; I never  
needed it.

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: 11483 bytes --]

%D \module
%D	[		 file=t-lilypond,
%D		    version=2007.05.23,
%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]
%C
%C	This module is in the public domain.

%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, but you should always use 
%D the latest stable version of LilyPond (this is tested with 2.10.23).
%D Before starting with the implementation, one or two examples are in order.
%D
%D \startbuffer[sample]
%D % Telemann, TWV 40:11
%D \startlilypond
%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, the module adds a version statement
%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 {\bfa Complete list of options:}
%D
%D \starttabulate[|l|l|l|]
%D	\NC	option\NC	default\NC	comment\NC\NR
%D	\HL
%D	\NC	staffsize\NC	20\NC	 in pt	\NC\NR
%D	\NC	indent\NC	0pt\NC	 first line indent	\NC\NR
%D	\NC	time\NC	yes\NC	 count time? (i.e. show time signature, set bars, split line)	\NC\NR
%D	\NC	clef\NC	yes\NC	 show clef?	\NC\NR
%D	\NC	linewidth\NC	\\localhsize\NC		\NC\NR
%D	\NC	betweensystemspace\NC	54pt\NC	space between systems	\NC\NR
%D	\NC	height\NC	\\textheight\NC		\NR
%D	\NC	align\NC	?\NC	 default depends on fragment=...	\NC\NR
%D	\NC	fragment\NC	no\NC		\NC\NR
%D	\NC	barnumbers\NC	no\NC	 show numbers of measures?	\NC\NR
%D	\NC	showempty\NC	no\NC	 drop empty staves?	\NC\NR
%D	\NC	seriffont\NC	"Century Schoolbook L"\NC	 font for e.g. lyrics	\NC\NR
%D	\NC	sansfont\NC	"LMSans10"\NC	 font for e.g. chords	\NC\NR
%D	\NC	monofont\NC	"Courier" \NC	 normally not used	\NC\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.:

\writestatus{loading}{LilyPond module}
\startmodule[lilypond]

\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.23"/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

\newcounter\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}]%
}

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

\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
	\doglobal\increment\lily!figures
	\def\lily!filename{\bufferprefix lilypond-\lily!figures}%\the
	%\writestatus{buffering}{\lily!filename}
	%\startmode[*\v!first]% 
	\def\obeyedlines{\string^^J}%
	\convertargument#2\to\ascii
	\expanded{%
	\setbuffer[lilypond-\lily!figures]%\the
	\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 pdfe\TeX\ is too old.
%D just change it to \type{\iftrue} then.
%D (\type{\ifeof18} checks whether \type{\write18} is disabled.)
	
	%\def\LP{echo LILYPOND \lily!filename.tmp}
	%\def\PDF{echo PStoPDF \lily!filename.eps}
	\edef\LP{texmfstart --ifchanged=\lily!filename .tmp --exec bin:lilypond -b eps -dno-gs-load-fonts -dinclude-eps-fonts \lily!filename .tmp}
	\edef\PDF{texmfstart --ifchanged=\lily!filename .eps pstopdf \lily!filename .eps}
	%\doprocesslilypond{\lily!filename}
	\ifeof18
		\writestatus{DEBUG-w18}{\LP}%
		\expanded{\installprogram{\LP}}%
		\doif\jobsuffix{pdf}{%
			\installprogram{\PDF}%
		}%
	\else
		\writestatus{DEBUG-EXE}{\LP}%
		\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
%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}

\stopmodule

\protect
%D End of file

[-- 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] 23+ messages in thread

* Re: lilypond
  2007-07-03 15:59 lilypond Wolfgang Werners-Lucchini
  2007-07-06 20:25 ` lilypond Henning Hraban Ramm
@ 2007-08-27 10:28 ` Steffen Wolfrum
  1 sibling, 0 replies; 23+ messages in thread
From: Steffen Wolfrum @ 2007-08-27 10:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hallo Wolfgang,

ich hoffe es ist OK, dass ich mich direkt an Dich wende.
Deinem E-Mail an die Liste entnehme ich, dass Du an sich das Modul  
zum Laufen bekommen hast.

Bei mir kommt statt jedoch nur ein grauer Kasten mit dem Inhalt:

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

Irgendwie wird kein eps erzeugt, das Programm Lilpond.app nicht  
gefunden?

Kannst Du mir einen Tipp geben, wie Du das ganze installiert hast?


Danke!

Steffen






Am 03.07.2007 um 17:59 schrieb Wolfgang Werners-Lucchini:

> Hallo!
>
> I tryed the first wiki-example:
> --------------------------------
> There are some notes \lilypond{ \relative{bes a c b} } embedded in
> this line.
> --------------------------------
>
> With version 2.11.27 the lilypond option -b eps is unknown.
> With version 2.10.25 the above example is a 3-page output:
> (1) There are some notes
> (2) lilypond-output
> (3) embedded in this line
>
> Should I downgrad with lilypond?
> Or what else I am doing wrong?
>
> Wolfgang
> ______________________________________________________________________ 
> _____________
> 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] 23+ messages in thread

* Re: lilypond
  2007-07-06 20:25 ` lilypond Henning Hraban Ramm
@ 2007-08-27 14:28   ` Mojca Miklavec
  0 siblings, 0 replies; 23+ messages in thread
From: Mojca Miklavec @ 2007-08-27 14:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/6/07, Henning Hraban Ramm wrote:
> Am 2007-07-03 um 17:59 schrieb Wolfgang Werners-Lucchini:
>
> Sorry, the publicly available LilyPond module is outdated. Try the
> attached one.
>
> I delayed the publishing of my latest version because Ruby texexec
> had a bug that prevented lilypond from being called, I guess that's
> gone, but I had no time to check yet.

The module on the garden worked OK for me with lilypond 2.10.25, but
it failed (only slightly) when called with LuaTeX, that's why you need
an additional one-line patch.

> And I didn't adapt the module
> to LilyPond 2.11, too. (2.10.2x should work.)

To Steffen: if you're working with Mac (I'm not sure), the easiest way
is to install it with fink (of course you need to have fink installed
first.)
    fink install lilypond

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] 23+ messages in thread

* Re: Lilypond
  2014-06-12 17:37         ` Lilypond Henning Hraban Ramm
@ 2014-06-12 20:21           ` David Wooten
  0 siblings, 0 replies; 23+ messages in thread
From: David Wooten @ 2014-06-12 20:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Right! Got it.

On Jun 12, 2014, at 10:37 AM, Henning Hraban Ramm <texml@fiee.net> wrote:

> Am 2014-06-12 um 23:00 schrieb David Wooten <david@farwestmillwork.com>:
> 
>> Both examples (1st page & multipage insertion) place the snippet on its own page, e.g. this gives me a 3 page document w/ snippet on page 2:
> 
> The LilyPond settings are essential, otherwise LP produces whole pages, that’s not a problem of ConTeXt.
> Please read and follow the wiki.
> 
> Greetlings, 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2014-06-12 17:00       ` Lilypond David Wooten
@ 2014-06-12 17:37         ` Henning Hraban Ramm
  2014-06-12 20:21           ` Lilypond David Wooten
  0 siblings, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2014-06-12 17:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2014-06-12 um 23:00 schrieb David Wooten <david@farwestmillwork.com>:

> Both examples (1st page & multipage insertion) place the snippet on its own page, e.g. this gives me a 3 page document w/ snippet on page 2:

The LilyPond settings are essential, otherwise LP produces whole pages, that’s not a problem of ConTeXt.
Please read and follow the wiki.

Greetlings, 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2014-06-11  8:51     ` Lilypond Henning Hraban Ramm
@ 2014-06-12 17:00       ` David Wooten
  2014-06-12 17:37         ` Lilypond Henning Hraban Ramm
  0 siblings, 1 reply; 23+ messages in thread
From: David Wooten @ 2014-06-12 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Jun 11, 2014, at 1:51 AM, Henning Hraban Ramm <texml@fiee.net> wrote:

> 
> Am 2014-06-11 um 00:26 schrieb David Wooten <dw@trichotomic.net>:
> 
>> Hi Hraban, thanks very much — yes I am able to get the first examples to work. Is there still a way to insert snippets/single lines of music between paragraphs?
> 
> Between paragraphs should just work like that.

Both examples (1st page & multipage insertion) place the snippet on its own page, e.g. this gives me a 3 page document w/ snippet on page 2:

\def\readPDFfile#1{\externalfigure[#1]}

\usemodule[filter]
\defineexternalfilter[lilypond]
    [continue=yes,
    readcommand=\readPDFfile,
    directory=lilytemp/, % directory for LilyPond's files
    output={\externalfilterbasefile.pdf},
    filtercommand={lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts -ddelete-intermediate-files -o"lilytemp/\externalfilterbasefile" "\externalfilterinputfile"}]

\starttext
\input zapf
\inlinelilypond{c d e f g a b c}
\input zapf
\stoptext

(same result for \startlilypond … \stoplilypond)

OS X Mavericks

> If you’d like to avoid \startlilypond … \stoplilypond, try \inlinelilypond{…}
> 
> If the one \include line is too much for your use case, you should look into how you can inject that automatically in the buffer file.
> 
> If you don’t want to include your lilypond settings file every time, follow the advise in filter’s docs regarding LaTeX package „skak“ („Prepend and append text“):
> http://modules.contextgarden.net/dl/t-filter/doc/context/third/filter/filter.txt
> 
> Please add your solution to the wiki!

I certainly will,

Thanks
David


> 
> Greetlings, 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2014-06-10 18:26   ` Lilypond David Wooten
@ 2014-06-11  8:51     ` Henning Hraban Ramm
  2014-06-12 17:00       ` Lilypond David Wooten
  0 siblings, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2014-06-11  8:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 2014-06-11 um 00:26 schrieb David Wooten <dw@trichotomic.net>:

> Hi Hraban, thanks very much — yes I am able to get the first examples to work. Is there still a way to insert snippets/single lines of music between paragraphs?

Between paragraphs should just work like that. 

If you’d like to avoid \startlilypond … \stoplilypond, try \inlinelilypond{…}

If the one \include line is too much for your use case, you should look into how you can inject that automatically in the buffer file.

If you don’t want to include your lilypond settings file every time, follow the advise in filter’s docs regarding LaTeX package „skak“ („Prepend and append text“):
http://modules.contextgarden.net/dl/t-filter/doc/context/third/filter/filter.txt

Please add your solution to the wiki!


Greetlings, 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2014-06-10  9:53 ` Lilypond Henning Hraban Ramm
@ 2014-06-10 18:26   ` David Wooten
  2014-06-11  8:51     ` Lilypond Henning Hraban Ramm
  0 siblings, 1 reply; 23+ messages in thread
From: David Wooten @ 2014-06-10 18:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hraban, thanks very much — yes I am able to get the first examples to work. Is there still a way to insert snippets/single lines of music between paragraphs?

Cheers,
David

On Jun 10, 2014, at 2:53 AM, Henning Hraban Ramm <texml@fiee.net> wrote:

> Am 2014-06-09 um 04:31 schrieb David Wooten <dw@trichotomic.net>:
> 
>> Greetings all, it’s been quite a while since I tried to use lilypond snippets in a context file. Looks like we’re now using the filter module… can someone post a small working example file to get me started? —there are a number of different & some incomplete approaches to be found, none of which work :)
> 
> There’s really just one approach, just different setups of the filter module:
> http://wiki.contextgarden.net/LilyPond
> 
> Did the first example work at all? Do you have LilyPond installed, and calling „lilypond“ works?
> 
> Greetlings, 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2014-06-08 22:31 Lilypond David Wooten
@ 2014-06-10  9:53 ` Henning Hraban Ramm
  2014-06-10 18:26   ` Lilypond David Wooten
  0 siblings, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2014-06-10  9:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 2014-06-09 um 04:31 schrieb David Wooten <dw@trichotomic.net>:

> Greetings all, it’s been quite a while since I tried to use lilypond snippets in a context file. Looks like we’re now using the filter module… can someone post a small working example file to get me started? —there are a number of different & some incomplete approaches to be found, none of which work :)

There’s really just one approach, just different setups of the filter module:
http://wiki.contextgarden.net/LilyPond

Did the first example work at all? Do you have LilyPond installed, and calling „lilypond“ works?

Greetlings, 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Lilypond
@ 2014-06-08 22:31 David Wooten
  2014-06-10  9:53 ` Lilypond Henning Hraban Ramm
  0 siblings, 1 reply; 23+ messages in thread
From: David Wooten @ 2014-06-08 22:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Greetings all, it’s been quite a while since I tried to use lilypond snippets in a context file. Looks like we’re now using the filter module… can someone post a small working example file to get me started? —there are a number of different & some incomplete approaches to be found, none of which work :)

Kind regards,
David
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2011-08-22 13:59                 ` Lilypond Henning Hraban Ramm
@ 2011-08-22 15:18                   ` Aditya Mahajan
  0 siblings, 0 replies; 23+ messages in thread
From: Aditya Mahajan @ 2011-08-22 15:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1191 bytes --]

On Mon, 22 Aug 2011, Henning Hraban Ramm wrote:

> Am 2011-08-22 um 03:53 schrieb Aditya Mahajan:
>> @Hraban: Long story short, the filter module is working again. Can you test 
>> the dev branch from the latest git version?
>
> Thank you!
> LilyPond ist called, but your approach of including the LaTeX file fails, 
> since you don’t define \linebreak from:

I need bigger test files :)

I find creating TeX macros to parse the latex output easier than 
understanding what lilypond creates (there is very little documentation 
about what goes on behind the scenes). Even the generated latex output is 
horrible, but, at least, I understand what it does.

> """
> \includegraphics{test1-temp-lilypond-0-1}%
> \ifx\betweenLilyPondSystem \undefined
> \linebreak
> \else
> \expandafter\betweenLilyPondSystem{1}%
> \fi
> """

Can you send me the complete example?

> In my test case (where I include the "one system per file" patch) I can 
> \def\linebreak{\relax} and get a nice multi-page score.

and also send the "one system per file" patch (is it just including 
lilypond-book-preamble.ly?). I'll add \let\linebreak\donothing to 
lilypond::setups.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-22  1:53               ` Lilypond Aditya Mahajan
@ 2011-08-22 13:59                 ` Henning Hraban Ramm
  2011-08-22 15:18                   ` Lilypond Aditya Mahajan
  0 siblings, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2011-08-22 13:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2011-08-22 um 03:53 schrieb Aditya Mahajan:
> @Hraban: Long story short, the filter module is working again. Can  
> you test the dev branch from the latest git version?

Thank you!
LilyPond ist called, but your approach of including the LaTeX file  
fails, since you don’t define \linebreak from:

"""
\includegraphics{test1-temp-lilypond-0-1}%
\ifx\betweenLilyPondSystem \undefined
   \linebreak
\else
   \expandafter\betweenLilyPondSystem{1}%
\fi
"""

In my test case (where I include the "one system per file" patch) I  
can \def\linebreak{\relax} and get a nice multi-page score.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2011-08-21 22:14             ` Lilypond Aditya Mahajan
  2011-08-21 22:24               ` Lilypond Hans Hagen
@ 2011-08-22  1:53               ` Aditya Mahajan
  2011-08-22 13:59                 ` Lilypond Henning Hraban Ramm
  1 sibling, 1 reply; 23+ messages in thread
From: Aditya Mahajan @ 2011-08-22  1:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1280 bytes --]

On Sun, 21 Aug 2011, Aditya Mahajan wrote:

> On Sun, 21 Aug 2011, Henning Hraban Ramm wrote:
>
>> - even if I rename the buffer file, LilyPond isn’t run.
>> 
>> t-filter        > current filter : lilypond
>> t-filter        > base file : test1-temp-lilypond
>> t-filter        > input file : test1-temp-lilypond.tmp
>> t-filter        > output file :
>> t-filter        > command :
>
> With the latest version, I also get this. Strange.

This took a while to debug. The internal representation of the namespace 
macros has changed in MkIV.

\definenamespace[whatever][...]
\definewhatever[something][key=value]

now defines a macro \whatever:something:key rather than 
\whateversomethingkey (note the extra colon). In the filter module, I had:

\getparameters[\externalfilter::namespace#1][\s!parent=\externalfilter::namespace,#2]

which fails in MkIV. To get a working solution in both MkII and MkIV I 
need:

\setupexternalfilter[#1][\s!parent=\externalfilter::namespace,#2]

@Hans and Wolfgang: Is it possible to change the internnal representation 
in mult-aux.mkii so that MkII and MkIV are consistent again?

@Hraban: Long story short, the filter module is working again. Can you 
test the dev branch from the latest git version?

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-21 22:24               ` Lilypond Hans Hagen
@ 2011-08-21 22:32                 ` Aditya Mahajan
  0 siblings, 0 replies; 23+ messages in thread
From: Aditya Mahajan @ 2011-08-21 22:32 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1054 bytes --]

On Mon, 22 Aug 2011, Hans Hagen wrote:

> On 22-8-2011 00:14, Aditya Mahajan wrote:
>> On Sun, 21 Aug 2011, Henning Hraban Ramm wrote:
>> 
>>> Current version doesn’t work at all:
>>> - it writes the buffer with doubled filename and extension parts, i.e.
>>> from foo.tex "foo-foo-temp-lilypond.tmp.tmp", but looks for
>>> "foo-temp-lilypond.tmp".
>> 
>> The \savebuffer command has changed!!!
>
> well, you wanted a jobname as prefix -)

In MkII, not MkIV :)

> (in mkii that only happens with the \protectbuffers flag is set, in mkiv 
> always)
>
> Just tell me what you expect

My preference is for \savebuffer[...][filename] to write contents in 
filename. No funny prefix or suffix.

If you have to add prefix and suffixes, please make it configurable (like 
\bufferprefix and \f!temporaryfilenameextension in MkII). With the current 
MkIV implementation, I cannot directly write the buffer to a file in 
another directory. Of course, I can work around using file.move, but that 
is adding one extra step.

Aditya



[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-21 22:14             ` Lilypond Aditya Mahajan
@ 2011-08-21 22:24               ` Hans Hagen
  2011-08-21 22:32                 ` Lilypond Aditya Mahajan
  2011-08-22  1:53               ` Lilypond Aditya Mahajan
  1 sibling, 1 reply; 23+ messages in thread
From: Hans Hagen @ 2011-08-21 22:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22-8-2011 00:14, Aditya Mahajan wrote:
> On Sun, 21 Aug 2011, Henning Hraban Ramm wrote:
>
>> Current version doesn’t work at all:
>> - it writes the buffer with doubled filename and extension parts, i.e.
>> from foo.tex "foo-foo-temp-lilypond.tmp.tmp", but looks for
>> "foo-temp-lilypond.tmp".
>
> The \savebuffer command has changed!!!

well, you wanted a jobname as prefix -)

(in mkii that only happens with the \protectbuffers flag is set, in mkiv 
always)

Just tell me what you expect

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2011-08-21 12:07           ` Lilypond Henning Hraban Ramm
  2011-08-21 18:25             ` Lilypond Henning Hraban Ramm
@ 2011-08-21 22:14             ` Aditya Mahajan
  2011-08-21 22:24               ` Lilypond Hans Hagen
  2011-08-22  1:53               ` Lilypond Aditya Mahajan
  1 sibling, 2 replies; 23+ messages in thread
From: Aditya Mahajan @ 2011-08-21 22:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 837 bytes --]

On Sun, 21 Aug 2011, Henning Hraban Ramm wrote:

> Current version doesn’t work at all:
> - it writes the buffer with doubled filename and extension parts, i.e. from 
> foo.tex "foo-foo-temp-lilypond.tmp.tmp", but looks for 
> "foo-temp-lilypond.tmp".

The \savebuffer command has changed!!!

\starttext
\startbuffer[abc]
test
\stopbuffer

\savebuffer[abc][name.ext]
\stoptext

now creates a file \jobname-name.ext, rather than name.ext.

I'll provide a work around.

> - even if I rename the buffer file, LilyPond isn’t run.
>
> t-filter        > current filter : lilypond
> t-filter        > base file : test1-temp-lilypond
> t-filter        > input file : test1-temp-lilypond.tmp
> t-filter        > output file :
> t-filter        > command :

With the latest version, I also get this. Strange.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-21 12:07           ` Lilypond Henning Hraban Ramm
@ 2011-08-21 18:25             ` Henning Hraban Ramm
  2011-08-21 22:14             ` Lilypond Aditya Mahajan
  1 sibling, 0 replies; 23+ messages in thread
From: Henning Hraban Ramm @ 2011-08-21 18:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2011-08-21 um 14:07 schrieb Henning Hraban Ramm:

>>> I don’t know a solution for line breaking of scores - if you’d set  
>>> LilyPond’s page size to ConTeXt’s remaining space, it would stay  
>>> the same for the second page. Perhaps we can get single lines  
>>> (systems) and let ConTeXt to the page breaking. I’ll look into that.
>> OK.
> I’m waiting for answers from the LP ML.

Got an answer:

If you include the scheme functions from share/lilypond/current/ly/ 
lilypond-book-preamble.ly, you get one file per system, if you don’t  
use a \book block within lilypond.
The system count is in foo-systems.count, i.e. read the number from  
that file and use \externalfigure so often.

This additional processing takes a lot of time, so we should only do  
it if we really need page breaking - best make it an option (split=yes).


>>>> Do you know how lilypond numbers its output files. In some cases  
>>>> I get filename-1.pdf sometimes not. Can I force it to always give  
>>>> filename-1.pdf or always give filename.pdf

IME there’s always a filename.pdf; you get filename-1.pdf for your  
first page; if you use the preamble quoted above, you’ll get  
filename-1.pdf etc. for every system.



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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2011-08-20  8:19         ` Lilypond Aditya Mahajan
  2011-08-21  1:22           ` Lilypond David Wooten
@ 2011-08-21 12:07           ` Henning Hraban Ramm
  2011-08-21 18:25             ` Lilypond Henning Hraban Ramm
  2011-08-21 22:14             ` Lilypond Aditya Mahajan
  1 sibling, 2 replies; 23+ messages in thread
From: Henning Hraban Ramm @ 2011-08-21 12:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2011-08-20 um 10:19 schrieb Aditya Mahajan:
>
>>> The other thing is to be able to change linespace, papersize,  
>>> offset, etc using parameters, so that one can say:
>>> \startlilypond[linespace=...]
>>> ...
>>> \stoplilypond
>>> This will require some lua side processing.
>>
>> You mean, translate ConTeXt-style settings to LilyPond settings,  
>> like we did with the old module?
> Yes.
>> That wouldn’t make much sense. LilyPond just has too much settings.  
>> And most of them you can set in different ways. To fully support  
>> this, you’d need a complete LilyPond parser including Scheme. And a  
>> small set of settings is never the right set for everyone.
> OK.

Or we support the same set of options as lilypond-book (the LaTeX  
module), see http://lilypond.org/doc/v2.14/Documentation/usage/music-fragment-options

>
>> Ok, there are a few settings that we could translate, e.g. set  
>> ConTeXt’s main fonts also for LilyPond.
>
> Agreed. Does anyone know how to get the name of the current font in  
> MkIV?
>
>> We don’t need LilyPond's layout settings, as long as we go the  
>> \externalfigure path.
>
> But I think that at least automatic paper size settings (set paper  
> size to be equal to text area) are needed.

I wouldn’t try to adapt LilyPond’s paper size, but only set line width  
and use lilypond-book mode to get cropped scores. Otherwise we would  
need to account for margins and place the score with negative offset  
etc.

At least for full scores it would make sense to synchronize:
- line width to \textwidth
- fonts: #(define fonts (make-pango-font-tree "TeX Gyre Schola"  
"LMSans10" "LMTypewriter10 Regular" (/ 14 20)))
   I’d even suggest to set Schola as ConTeXt’s default font in t- 
lilypond.
- staff size according to body font (staff size 14 matches bodyfont  
8.5pt)

General settings:
- no point-and-click: #(ly:set-option (quote no-point-and-click))
- no headers/footers/titles/pagination
- ragged bottom
- no indents (but that might be a matter of taste, since it’s LilyPond  
default to indent the first line)
- keep lyrics inside line: \override PaperColumn #'keep-inside-line =  
##t

Everything else is just a matter of taste and design, I guess.

>> I don’t know a solution for line breaking of scores - if you’d set  
>> LilyPond’s page size to ConTeXt’s remaining space, it would stay  
>> the same for the second page. Perhaps we can get single lines  
>> (systems) and let ConTeXt to the page breaking. I’ll look into that.
> OK.

I’m waiting for answers from the LP ML.

>> But I don’t know how we can make it "right" WRT LilyPond snippets -  
>> I’d want to align a note systems’s base line with ConTeXt’s text  
>> baseline, but the height and clipping of a snippet depends on the  
>> visible elements. Without some picture analysis (or runtime data  
>> from LilyPond, that doesn’t exist AFAIK) you need to adjust your  
>> snippets manually.
>
> Does lilypond-book handle this at all? It does not appear to.  
> Manually adjusting each inline snippet will be too much work, IMO.

Probably.

>>> Do you know how lilypond numbers its output files. In some cases I  
>>> get filename-1.pdf sometimes not. Can I force it to always give  
>>> filename-1.pdf or always give filename.pdf
>>
>> LilyPond adds a number to EPS, if there’s more that one page.
>> But in my songbook setup, I always get a filename-temp-lilypond- 
>> ##.eps plus an identical filename-temp-lilypond-##-1.eps
>>
>> When you order more than one \midi{} in several \score blocks, the  
>> first MIDI file is unnumbered, the second gets number 1 etc.;  
>> didn’t try with different \layout blocks yet.
>>
>> Seems like I must do some tests with multipage scores.
>
> Look at the current version on github. It should be able to handle  
> multi-page snippets.


Problem is, if a multi-page score starts somewhere mid-page, e.g.  
below a title, LilyPond doesn’t know to break early enough.

Please use -dno-gs-load-fonts i.e. *don’t* let GhostScript load its  
own fonts, since all needed fonts are in the (E)PS anyway, that makes  
processing faster.

Current version doesn’t work at all:
- it writes the buffer with doubled filename and extension parts, i.e.  
from foo.tex "foo-foo-temp-lilypond.tmp.tmp", but looks for "foo-temp- 
lilypond.tmp".
- even if I rename the buffer file, LilyPond isn’t run.

t-filter        > current filter : lilypond
t-filter        > base file : test1-temp-lilypond
t-filter        > input file : test1-temp-lilypond.tmp
t-filter        > output file :
t-filter        > command :



Greetlings from Lake Constance
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lilypond
  2011-08-20  8:19         ` Lilypond Aditya Mahajan
@ 2011-08-21  1:22           ` David Wooten
  2011-08-21 12:07           ` Lilypond Henning Hraban Ramm
  1 sibling, 0 replies; 23+ messages in thread
From: David Wooten @ 2011-08-21  1:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Aditya & Hraban,

I'm very glad to see improved Lilypond integration being discussed. I can't offer too much besides moral support, but would just point out one solution I've found for proper width/alignment of a snippet with extra-staff material (e.g. a piano staff marker { ): If the ConTeXt textwidth is equal to the Lilypond line-width, aligning the float to the right gives you a snippet nicely aligned with flush text (extra-staff material being pushed towards the left margin). 

Something like this (as in the example in the garden):

\def\readlilypondoutput#1{\setupfloats[location=right,frame=off]\placefigure[]{}}{\externalfigure[#1]}}

Regards,
David


On Aug 20, 2011, at 1:19 AM, Aditya Mahajan wrote:

> On Fri, 19 Aug 2011, Henning Hraban Ramm wrote:
> 
>> Am 2011-08-19 um 17:08 schrieb Aditya Mahajan:
>> 
>> But - can you even support different setups, say
>> 
>> \startlilypondpreamble
>> global settings for everything
>> \stoplilypondpreamble
>> 
>> \startlilypondpreamble[snippet]
>> global settings for snippets
>> \stoplilypondpreamble
>> 
>> \startlilypondpreamble[fullscore]
>> global settings for full scores
>> \stoplilypondpreamble
>> 
>> \startlilypond[setup=fullscore]
>> the score
>> \stoplilypond
>> 
>> etc.
> 
> Yes. I can support the following syntax:
> 
> \startbuffer[snippets] ... \stopbuffer
> 
> \startbuffer[fullscore] ... \stopbuffer
> 
> \startbuffer[common] ... \stopbuffer
> 
> \startlilypond[bufferbefore={snippets,common}, bufferafter={....}]
> .... \stoplilypond
> 
> (In fact, provide similar support for anything defined using the filter module).
> 
>>> The other thing is to be able to change linespace, papersize, offset, etc using parameters, so that one can say:
>>> \startlilypond[linespace=...]
>>> ...
>>> \stoplilypond
>>> This will require some lua side processing.
>> 
>> You mean, translate ConTeXt-style settings to LilyPond settings, like we did with the old module?
> 
> Yes.
> 
>> That wouldn’t make much sense. LilyPond just has too much settings. And most of them you can set in different ways. To fully support this, you’d need a complete LilyPond parser including Scheme. And a small set of settings is never the right set for everyone.
> 
> OK.
> 
>> Ok, there are a few settings that we could translate, e.g. set ConTeXt’s main fonts also for LilyPond.
> 
> Agreed. Does anyone know how to get the name of the current font in MkIV?
> 
>> We don’t need LilyPond's layout settings, as long as we go the \externalfigure path.
> 
> But I think that at least automatic paper size settings (set paper size to be equal to text area) are needed.
> 
>> I don’t know a solution for line breaking of scores - if you’d set LilyPond’s page size to ConTeXt’s remaining space, it would stay the same for the second page. Perhaps we can get single lines (systems) and let ConTeXt to the page breaking. I’ll look into that.
> 
> OK.
> 
>> But I don’t know how we can make it "right" WRT LilyPond snippets - I’d want to align a note systems’s base line with ConTeXt’s text baseline, but the height and clipping of a snippet depends on the visible elements. Without some picture analysis (or runtime data from LilyPond, that doesn’t exist AFAIK) you need to adjust your snippets manually.
> 
> Does lilypond-book handle this at all? It does not appear to. Manually adjusting each inline snippet will be too much work, IMO.
> 
>>> Do you know how lilypond numbers its output files. In some cases I get filename-1.pdf sometimes not. Can I force it to always give filename-1.pdf or always give filename.pdf
>> 
>> LilyPond adds a number to EPS, if there’s more that one page.
>> But in my songbook setup, I always get a filename-temp-lilypond-##.eps plus an identical filename-temp-lilypond-##-1.eps
>> 
>> When you order more than one \midi{} in several \score blocks, the first MIDI file is unnumbered, the second gets number 1 etc.; didn’t try with different \layout blocks yet.
>> 
>> Seems like I must do some tests with multipage scores.
> 
> Look at the current version on github. It should be able to handle multi-page snippets.
> 
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


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

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-19 20:18       ` Lilypond Henning Hraban Ramm
@ 2011-08-20  8:19         ` Aditya Mahajan
  2011-08-21  1:22           ` Lilypond David Wooten
  2011-08-21 12:07           ` Lilypond Henning Hraban Ramm
  0 siblings, 2 replies; 23+ messages in thread
From: Aditya Mahajan @ 2011-08-20  8:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3422 bytes --]

On Fri, 19 Aug 2011, Henning Hraban Ramm wrote:

> Am 2011-08-19 um 17:08 schrieb Aditya Mahajan:
>
> But - can you even support different setups, say
>
> \startlilypondpreamble
> global settings for everything
> \stoplilypondpreamble
>
> \startlilypondpreamble[snippet]
> global settings for snippets
> \stoplilypondpreamble
>
> \startlilypondpreamble[fullscore]
> global settings for full scores
> \stoplilypondpreamble
>
> \startlilypond[setup=fullscore]
> the score
> \stoplilypond
>
> etc.

Yes. I can support the following syntax:

\startbuffer[snippets] ... \stopbuffer

\startbuffer[fullscore] ... \stopbuffer

\startbuffer[common] ... \stopbuffer

\startlilypond[bufferbefore={snippets,common}, bufferafter={....}]
.... 
\stoplilypond

(In fact, provide similar support for anything defined using the filter 
module).

>> The other thing is to be able to change linespace, papersize, offset, etc 
>> using parameters, so that one can say:
>> \startlilypond[linespace=...]
>> ...
>> \stoplilypond
>> This will require some lua side processing.
>
> You mean, translate ConTeXt-style settings to LilyPond settings, like we did 
> with the old module?

Yes.

> That wouldn’t make much sense. LilyPond just has too much settings. And most 
> of them you can set in different ways. To fully support this, you’d need a 
> complete LilyPond parser including Scheme. And a small set of settings is 
> never the right set for everyone.

OK.

> Ok, there are a few settings that we could translate, e.g. set ConTeXt’s main 
> fonts also for LilyPond.

Agreed. Does anyone know how to get the name of the current font in MkIV?

> We don’t need LilyPond's layout settings, as long as we go the 
> \externalfigure path.

But I think that at least automatic paper size settings (set paper 
size to be equal to text area) are needed.

> I don’t know a solution for line breaking of scores - if you’d set LilyPond’s 
> page size to ConTeXt’s remaining space, it would stay the same for the second 
> page. Perhaps we can get single lines (systems) and let ConTeXt to the page 
> breaking. I’ll look into that.

OK.

> But I don’t know how we can make it "right" WRT LilyPond snippets - I’d want 
> to align a note systems’s base line with ConTeXt’s text baseline, but the 
> height and clipping of a snippet depends on the visible elements. Without 
> some picture analysis (or runtime data from LilyPond, that doesn’t exist 
> AFAIK) you need to adjust your snippets manually.

Does lilypond-book handle this at all? It does not appear to. Manually 
adjusting each inline snippet will be too much work, IMO.

>> Do you know how lilypond numbers its output files. In some cases I get 
>> filename-1.pdf sometimes not. Can I force it to always give filename-1.pdf 
>> or always give filename.pdf
>
> LilyPond adds a number to EPS, if there’s more that one page.
> But in my songbook setup, I always get a filename-temp-lilypond-##.eps plus 
> an identical filename-temp-lilypond-##-1.eps
>
> When you order more than one \midi{} in several \score blocks, the first MIDI 
> file is unnumbered, the second gets number 1 etc.; didn’t try with different 
> \layout blocks yet.
>
> Seems like I must do some tests with multipage scores.

Look at the current version on github. It should be able to handle 
multi-page snippets.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lilypond
  2011-08-19 15:08     ` Lilypond (Re: buffer names in MKII) Aditya Mahajan
@ 2011-08-19 20:18       ` Henning Hraban Ramm
  2011-08-20  8:19         ` Lilypond Aditya Mahajan
  0 siblings, 1 reply; 23+ messages in thread
From: Henning Hraban Ramm @ 2011-08-19 20:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2011-08-19 um 17:08 schrieb Aditya Mahajan:

>> I don't understand what you're planning,
>
> I am planning to add features so that you can say:
>
> \startlilypondpreamble
>  global settings
> \stoplilypondpreamble

Ah, that's great - at the moment I just import the same settings.ly  
file into every score of a songbook.

But - can you even support different setups, say

\startlilypondpreamble
  global settings for everything
\stoplilypondpreamble

\startlilypondpreamble[snippet]
  global settings for snippets
\stoplilypondpreamble

\startlilypondpreamble[fullscore]
  global settings for full scores
\stoplilypondpreamble

\startlilypond[setup=fullscore]
the score
\stoplilypond

etc.

> The other thing is to be able to change linespace, papersize,  
> offset, etc using parameters, so that one can say:
> \startlilypond[linespace=...]
> ...
> \stoplilypond
> This will require some lua side processing.

You mean, translate ConTeXt-style settings to LilyPond settings, like  
we did with the old module?
That wouldn’t make much sense. LilyPond just has too much settings.  
And most of them you can set in different ways. To fully support this,  
you’d need a complete LilyPond parser including Scheme. And a small  
set of settings is never the right set for everyone.

Ok, there are a few settings that we could translate, e.g. set  
ConTeXt’s main fonts also for LilyPond.

We don’t need LilyPond's layout settings, as long as we go the  
\externalfigure path.
I don’t know a solution for line breaking of scores - if you’d set  
LilyPond’s page size to ConTeXt’s remaining space, it would stay the  
same for the second page. Perhaps we can get single lines (systems)  
and let ConTeXt to the page breaking. I’ll look into that.

But I don’t know how we can make it "right" WRT LilyPond snippets -  
I’d want to align a note systems’s base line with ConTeXt’s text  
baseline, but the height and clipping of a snippet depends on the  
visible elements. Without some picture analysis (or runtime data from  
LilyPond, that doesn’t exist AFAIK) you need to adjust your snippets  
manually.

> Do you know how lilypond numbers its output files. In some cases I  
> get filename-1.pdf sometimes not. Can I force it to always give  
> filename-1.pdf or always give filename.pdf

LilyPond adds a number to EPS, if there’s more that one page.
But in my songbook setup, I always get a filename-temp-lilypond-##.eps  
plus an identical filename-temp-lilypond-##-1.eps

When you order more than one \midi{} in several \score blocks, the  
first MIDI file is unnumbered, the second gets number 1 etc.; didn’t  
try with different \layout blocks yet.

Seems like I must do some tests with multipage scores.

> Which OSes do you have access to?

Normally I work on OSX Intel 10.5.8; I've access to Windows 7/64 and  
Ubuntu/Debian machines.


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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* lilypond
@ 2007-08-26 22:35 Hans Hagen
  0 siblings, 0 replies; 23+ messages in thread
From: Hans Hagen @ 2007-08-26 22:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Mojca Miklavec

Mojca,

cn you check this module for things like

		\leavevmode%
		\newdimen\FigWidth
		\FigWidth=\figurewidth
		\ifdim\FigWidth>\localhsize
			\!!dimena=\localhsize
			\advance\!!dimena by-\FigWidth
			\noindent\hskip\!!dimena
		\fi

(1) defining dimens this way will create new ones every time since 
registers are defined global

(2) there is no need for the intermediate dimen anyway

(3) use dontleavehmode instead of leavevmode

(4) things can be simplified to:


\ifdim\figurewidth>\localhsize
   \dontleavehmode\hskip\dimexpr\localhsize-\figurewidth\relax
\fi

-----------------------------------------------------------------
                                           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] 23+ messages in thread

end of thread, other threads:[~2014-06-12 20:21 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03 15:59 lilypond Wolfgang Werners-Lucchini
2007-07-06 20:25 ` lilypond Henning Hraban Ramm
2007-08-27 14:28   ` lilypond Mojca Miklavec
2007-08-27 10:28 ` lilypond Steffen Wolfrum
2007-08-26 22:35 lilypond Hans Hagen
2011-08-18 22:32 buffer names in MKII Mojca Miklavec
2011-08-18 21:29 ` Aditya Mahajan
2011-08-19  7:53   ` Henning Hraban Ramm
2011-08-19 15:08     ` Lilypond (Re: buffer names in MKII) Aditya Mahajan
2011-08-19 20:18       ` Lilypond Henning Hraban Ramm
2011-08-20  8:19         ` Lilypond Aditya Mahajan
2011-08-21  1:22           ` Lilypond David Wooten
2011-08-21 12:07           ` Lilypond Henning Hraban Ramm
2011-08-21 18:25             ` Lilypond Henning Hraban Ramm
2011-08-21 22:14             ` Lilypond Aditya Mahajan
2011-08-21 22:24               ` Lilypond Hans Hagen
2011-08-21 22:32                 ` Lilypond Aditya Mahajan
2011-08-22  1:53               ` Lilypond Aditya Mahajan
2011-08-22 13:59                 ` Lilypond Henning Hraban Ramm
2011-08-22 15:18                   ` Lilypond Aditya Mahajan
2014-06-08 22:31 Lilypond David Wooten
2014-06-10  9:53 ` Lilypond Henning Hraban Ramm
2014-06-10 18:26   ` Lilypond David Wooten
2014-06-11  8:51     ` Lilypond Henning Hraban Ramm
2014-06-12 17:00       ` Lilypond David Wooten
2014-06-12 17:37         ` Lilypond Henning Hraban Ramm
2014-06-12 20:21           ` Lilypond David Wooten

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).