ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* fret-diagrams in Lilypond + ConTeXt
@ 2007-09-07 21:49 Mikael Persson
  2007-09-11  0:53 ` Arthur Reutenauer
  0 siblings, 1 reply; 10+ messages in thread
From: Mikael Persson @ 2007-09-07 21:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I have problems getting fret-diagrams working in Lilypond+ConTeXt. The
following works in lilypond

\markup \fret-diagram #"s:0.75;f:1;6-x;5-x;4-o;3-2-1;2-3-3;1-2-2;"

However, the following does not work in ConTeXt:

\usemodule[lilypond]
\starttext
\startlilypond
\markup \fret-diagram #"s:0.75;f:1;6-x;5-x;4-o;3-2-1;2-3-3;1-2-2;"
\stoplilypond
\stoptext

I have
ConTeXt  ver: 2007.08.08 14:35 MKII  fmt: 2007.8.26  int: english/english
Lilypond version 2.10.5 and the
Lilypond ConTeXt module t-lilypond-2007.09.02.zip

The examples on the wiki works well, and the problem seems to be that
\fret-diagram is written as \fret -diagram (note the space) in the
.tmp file, and thus producing the error(?)

Any ideas?

Best regards, Micke P
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-07 21:49 fret-diagrams in Lilypond + ConTeXt Mikael Persson
@ 2007-09-11  0:53 ` Arthur Reutenauer
  2007-09-11 21:13   ` Henning Hraban Ramm
  2007-09-13  8:14   ` Mojca Miklavec
  0 siblings, 2 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2007-09-11  0:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Any ideas?

  This is a catcode problem.  Surround \start ... \stoplilypond with

	\catcode`\-=11

  and

	\catcode`\-=12

  Then you will probably experience a Lilypond problem because the line
of code you type (\markup \fret-diagram ...) apparently isn't a
legitimate Lilypond stand-alone score and you need to place it on the
page with \mark, for example.  But even then Lilypond is not so happy
and complains that there is no note on the page, and you'd better put
some there.

  To sum up, the following works for me:

---- cut after

\usemodule[lilypond]
\starttext

\catcode`\-=11
\startlilypond
d'' ^ \markup { \fret-diagram #"s:0.75;6-x;5-x;4-o;3-2;2-3;1-2;" }
\stoplilypond
\catcode`\-=12

\stoptext

---- cut before

  Have fun!

  Note for Hraban: this problem is apparently special to markups, that
somehow the minus signs loses his letterhood when used in a markup.
The fault lies obviously with Lilypond, since when I try to compile the
following exact line (with the added curly braces):

  { \markup \fret-diagram #"s:0.75;f:1;6-x;5-x;4-o;3-2-1;2-3-3;1-2-2;" }

Lilypond seems to suddenly forget that the minus is part of the command
and complains about an “unknown escaped string: `\fret'”.

  I have no idea what to do in t-lilypond to fix it.  Maybe you know?

	Arthur
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-11  0:53 ` Arthur Reutenauer
@ 2007-09-11 21:13   ` Henning Hraban Ramm
  2007-09-11 22:50     ` Arthur Reutenauer
  2007-09-12  9:16     ` Mikael Persson
  2007-09-13  8:14   ` Mojca Miklavec
  1 sibling, 2 replies; 10+ messages in thread
From: Henning Hraban Ramm @ 2007-09-11 21:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-09-11 um 02:53 schrieb Arthur Reutenauer:

>   Note for Hraban: this problem is apparently special to markups, that
> somehow the minus signs loses his letterhood when used in a markup.
> The fault lies obviously with Lilypond, since when I try to compile  
> the
> following exact line (with the added curly braces):
>
>   { \markup \fret-diagram #"s:0.75;f:1;6-x;5-x;4-o; 
> 3-2-1;2-3-3;1-2-2;" }
>
> Lilypond seems to suddenly forget that the minus is part of the  
> command
> and complains about an “unknown escaped string: `\fret'”.
>
>   I have no idea what to do in t-lilypond to fix it.  Maybe you know?

Sorry, the catcode code is not by me, and I understand it only partly  
- I'm able to write PostScript and a lot of other languages, but TeX  
and Scheme are too obscure for me. Perhaps we can re-implement the  
module in Lua...

If you come up with a fix, I'll gladly put it in the module.

(There's still a lot more to be fixed/extended; since I'll have to  
finish my songbook soon, I'll have to cope with some of that...)

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

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-11 21:13   ` Henning Hraban Ramm
@ 2007-09-11 22:50     ` Arthur Reutenauer
  2007-09-12  9:16     ` Mikael Persson
  1 sibling, 0 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2007-09-11 22:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> If you come up with a fix, I'll gladly put it in the module.

  I'll really don't know for the moment but I may have a look at it some
day ...

	Arthur
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-11 21:13   ` Henning Hraban Ramm
  2007-09-11 22:50     ` Arthur Reutenauer
@ 2007-09-12  9:16     ` Mikael Persson
  2007-09-13  1:41       ` Arthur Reutenauer
  1 sibling, 1 reply; 10+ messages in thread
From: Mikael Persson @ 2007-09-12  9:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9/11/07, Henning Hraban Ramm <hraban@fiee.net> wrote:
> Am 2007-09-11 um 02:53 schrieb Arthur Reutenauer:
>
> >   Note for Hraban: this problem is apparently special to markups, that
> > somehow the minus signs loses his letterhood when used in a markup.
> > The fault lies obviously with Lilypond, since when I try to compile
> > the
> > following exact line (with the added curly braces):
> >
> >   { \markup \fret-diagram #"s:0.75;f:1;6-x;5-x;4-o;
> > 3-2-1;2-3-3;1-2-2;" }
> >
> > Lilypond seems to suddenly forget that the minus is part of the
> > command
> > and complains about an "unknown escaped string: `\fret'".
> >
> >   I have no idea what to do in t-lilypond to fix it.  Maybe you know?
>
> Sorry, the catcode code is not by me, and I understand it only partly
> - I'm able to write PostScript and a lot of other languages, but TeX
> and Scheme are too obscure for me. Perhaps we can re-implement the
> module in Lua...
>
> If you come up with a fix, I'll gladly put it in the module.
>
> (There's still a lot more to be fixed/extended; since I'll have to
> finish my songbook soon, I'll have to cope with some of that...)
>
> Greetlings from Lake Constance!
> Hraban
> ---

Arthur, tanks for your kind reply! I'll try it when I get home. It was
a bit confusing with the - for me, but I should have tried the catcode
solution! Actually, I want to typeset only fret-diagrams, no notes.
Maybe I should look that up in the Lilypond manual (if it is
possible). The lacking of {}'s was because of the error I got without
them.

Hraban, thanks for bringing a nice module!

/Micke P
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-12  9:16     ` Mikael Persson
@ 2007-09-13  1:41       ` Arthur Reutenauer
  0 siblings, 0 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2007-09-13  1:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Maybe I should look that up in the Lilypond manual (if it is
> possible).

  I guess you should. Look for the general documentation on markups
because that's what you need here. As for the braces, it seems
extremely weird to me and I have not been able to draw any general
conclusion about it, but you may try.

  I've wikified the entire discussion, in the hope that someone could
sort it out in the future.

	Arthur
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-11  0:53 ` Arthur Reutenauer
  2007-09-11 21:13   ` Henning Hraban Ramm
@ 2007-09-13  8:14   ` Mojca Miklavec
  2007-09-13 10:55     ` Arthur Reutenauer
  2007-09-14 17:09     ` Henning Hraban Ramm
  1 sibling, 2 replies; 10+ messages in thread
From: Mojca Miklavec @ 2007-09-13  8:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9/11/07, Arthur Reutenauer wrote:
> > Any ideas?
>
>   This is a catcode problem.  Surround \start ... \stoplilypond with
>
>         \catcode`\-=11
>
>   and
>
>         \catcode`\-=12
>
>   Then you will probably experience a Lilypond problem because the line
> of code you type (\markup \fret-diagram ...) apparently isn't a
> legitimate Lilypond stand-alone score and you need to place it on the
> page with \mark, for example.  But even then Lilypond is not so happy
> and complains that there is no note on the page, and you'd better put
> some there.
>
>   To sum up, the following works for me:
>
> ---- cut after
>
> \usemodule[lilypond]
> \starttext
>
> \catcode`\-=11
> \startlilypond
> d'' ^ \markup { \fret-diagram #"s:0.75;6-x;5-x;4-o;3-2;2-3;1-2;" }
> \stoplilypond
> \catcode`\-=12
>
> \stoptext
>
> ---- cut before
>
>   I have no idea what to do in t-lilypond to fix it.  Maybe you know?

For some strange reason it works here if I replace
    /catcode`/-=/@@letter
by
    /catcode`/-=11
in t-lilypond.tex.

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

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-13  8:14   ` Mojca Miklavec
@ 2007-09-13 10:55     ` Arthur Reutenauer
  2007-09-14 17:09     ` Henning Hraban Ramm
  1 sibling, 0 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2007-09-13 10:55 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

> For some strange reason it works here if I replace
>     /catcode`/-=/@@letter
> by
>     /catcode`/-=11
> in t-lilypond.tex.

  Strange indeed. This may hint that \@@letter is defined to something
else that what we want at that point ...
___________________________________________________________________________________
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] 10+ messages in thread

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-13  8:14   ` Mojca Miklavec
  2007-09-13 10:55     ` Arthur Reutenauer
@ 2007-09-14 17:09     ` Henning Hraban Ramm
  2007-09-14 21:46       ` Arthur Reutenauer
  1 sibling, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2007-09-14 17:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-09-13 um 10:14 schrieb Mojca Miklavec:

> For some strange reason it works here if I replace
>     /catcode`/-=/@@letter
> by
>     /catcode`/-=11
> in t-lilypond.tex.

Should I change it in the module or is it not save?

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

* Re: fret-diagrams in Lilypond + ConTeXt
  2007-09-14 17:09     ` Henning Hraban Ramm
@ 2007-09-14 21:46       ` Arthur Reutenauer
  0 siblings, 0 replies; 10+ messages in thread
From: Arthur Reutenauer @ 2007-09-14 21:46 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

On Fri, Sep 14, 2007 at 07:09:02PM +0200, Henning Hraban Ramm wrote:
> Am 2007-09-13 um 10:14 schrieb Mojca Miklavec:
> 
> > For some strange reason it works here if I replace
> >     /catcode`/-=/@@letter
> > by
> >     /catcode`/-=11
> > in t-lilypond.tex.
> 
> Should I change it in the module or is it not save?

  I'm convinced it is very safe, but as far as I'm concerned I've not
been able to reproduce this behaviour; could anyone please confirm what
Mojca says above?

	Arthur
___________________________________________________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2007-09-14 21:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-07 21:49 fret-diagrams in Lilypond + ConTeXt Mikael Persson
2007-09-11  0:53 ` Arthur Reutenauer
2007-09-11 21:13   ` Henning Hraban Ramm
2007-09-11 22:50     ` Arthur Reutenauer
2007-09-12  9:16     ` Mikael Persson
2007-09-13  1:41       ` Arthur Reutenauer
2007-09-13  8:14   ` Mojca Miklavec
2007-09-13 10:55     ` Arthur Reutenauer
2007-09-14 17:09     ` Henning Hraban Ramm
2007-09-14 21:46       ` Arthur Reutenauer

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