Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Piero Faustini wrote:

 I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
 lily-book knows how to break music lines (or pages) in a given latex 
 environment, 

Are you sure? 

As I understand the docs of lilypond-book, it is a preprocessor that
works by extracting snippets of lilypond notation, transforming them to
EPS or PDF graphics and inserting a graphic-loading command in their
place.

 but it can't guess if this environment will change after LaTeX 
 compile. I mean: I'm writing a komascript book using some packages
 which can alter heavily the shape of the text, such as BibLaTeX, by
 adding more text.  This is the reason why my LyX's LaTeX run up to 4
 times when compiling, and everything works ok. Can lilypond-book give
 instructions at the beginning of this process? 

No.

But if used according to its specification (small musical examples in a
book), LaTeX should handle them nice. If I remember right, you can also
place the lilypond snipped inside a flaot.

 Can it be run more than once between Latex runs just to refine 
 the process? 

Not that I know of.


Günter



Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Helge Hafting wrote:

 I don't know if it's possible, but the ideal solution (for me) would be 
 some kind of lilypond environment (somewhat like the math environment), 
 where you can type in your lilypond code directly. 

This could be done, best in a lilypond.module.

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.

This is rather hard. With lilypond-book, you will have to live with
the source code in LyX.

 Support for lilypond-book would be interesting. And sure - if you 
 volunteer to do some work then you will get it faster.

 This process can be divided into several steps, you won't have to do it 
 all at once.

 1. Work on the support for lilypond-book.
 This will have LyX create latex output as usual,
 then, add code to run lilypond-book on the produced file
 Finally, let LyX run latex/pdflatex on the file produced, as usual.
 So this step is mostly about inserting an invocation
 of lilypond-book into the existing workflow.

We have an example of latex-preprocessing with the literate
programming (noweb) support. It is already (ab)used for R code with
sweave. I would very much like a generalisation, where a module could
trigger such preprocessing an set the preprocessor. 

Idea:

In the module:

  Style Lilypond
...
ExportsTo  lilytex
  End  

- Would call the created LaTeX source filename.lilytex.

In the Converters:

   LilyTeX - LaTeX (plain):  lilypond-book $$i $$a
   
 At this point, use a new document settings to decide whether
 lyx should do this lilypond-book step or not. Many lyx documents
 have no lilypond content, and many lyx users don't have lilypond.

This is why I want to define the Lilypond style in a module. This
would also allow combination with any (?) document class.


 2. With lilypond-book working, start on the lilypond environment.
 first figure out if it ought to be a inset, a layout module, or
 whatever. I guess an inset will be the way.
 Then add the rule about how LyX produces latex code when processing
 a lilypond inset. This is easy - just output \begin{lilypond}
 followed by the inset contents, followed by \end{lilypond}

 At this point, you have working lilypond-book!

This step can even be tried before the first step -- if you export to
latex and run lilypond-book and latex by hand.

 3. Some fine-tuning. Remove the document setting that specifies if this
 is a lilypond document. Instead, add logic so that LyX will run
 lilypond-book whenever the document contains a lilypond inset.
 You can perhaps make use of similiar logic that add latex packages
 on an as-needed basis.

As stated above, I would prefer a generalization of the code for
literate programming.

 4. The preview. Arrange so Lyx runs the inset content through
 lilypond, and display the resulting .png if this succeeds.
 I am not sure how to do this part, but look at how it is done
 for math and graphichs insets.

If a preview is important, it might be simpler to go a completely
different route: amend the external inset so that it allows in-place
editing of the source instead of relying on an external file.

Günter



Re: Lilypond integration

2009-04-01 Thread Jürgen Spitzmüller
Guenter Milde wrote:

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.
 
 This is rather hard. With lilypond-book, you will have to live with
 the source code in LyX.

Actually, I think implementing instant preview to InsetFlex (and make it 
customizable by a layout flag) should not be too hard, and it would be a 
valuable goal also for other custom inset (think of a tipa inset).

Jürgen




Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-04-01, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.

 This is rather hard. With lilypond-book, you will have to live with
 the source code in LyX.

 Actually, I think implementing instant preview to InsetFlex (and make it 
 customizable by a layout flag) should not be too hard, and it would be a 
 valuable goal also for other custom inset (think of a tipa inset).

The problem here is that the preview has to be generated with lilypond,
not LaTeX. This is usually the realm of the external inset.

However, the user wanted to edit the source code inside LyX instead of an
external file. Maybe it is simpler to allow inline source in an
external inset than external preview in an InsetFlex.

Günter



Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Piero Faustini wrote:

 I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
 lily-book knows how to break music lines (or pages) in a given latex 
 environment, 

Are you sure? 

As I understand the docs of lilypond-book, it is a preprocessor that
works by extracting snippets of lilypond notation, transforming them to
EPS or PDF graphics and inserting a graphic-loading command in their
place.

 but it can't guess if this environment will change after LaTeX 
 compile. I mean: I'm writing a komascript book using some packages
 which can alter heavily the shape of the text, such as BibLaTeX, by
 adding more text.  This is the reason why my LyX's LaTeX run up to 4
 times when compiling, and everything works ok. Can lilypond-book give
 instructions at the beginning of this process? 

No.

But if used according to its specification (small musical examples in a
book), LaTeX should handle them nice. If I remember right, you can also
place the lilypond snipped inside a flaot.

 Can it be run more than once between Latex runs just to refine 
 the process? 

Not that I know of.


Günter



Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Helge Hafting wrote:

 I don't know if it's possible, but the ideal solution (for me) would be 
 some kind of lilypond environment (somewhat like the math environment), 
 where you can type in your lilypond code directly. 

This could be done, best in a lilypond.module.

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.

This is rather hard. With lilypond-book, you will have to live with
the source code in LyX.

 Support for lilypond-book would be interesting. And sure - if you 
 volunteer to do some work then you will get it faster.

 This process can be divided into several steps, you won't have to do it 
 all at once.

 1. Work on the support for lilypond-book.
 This will have LyX create latex output as usual,
 then, add code to run lilypond-book on the produced file
 Finally, let LyX run latex/pdflatex on the file produced, as usual.
 So this step is mostly about inserting an invocation
 of lilypond-book into the existing workflow.

We have an example of latex-preprocessing with the literate
programming (noweb) support. It is already (ab)used for R code with
sweave. I would very much like a generalisation, where a module could
trigger such preprocessing an set the preprocessor. 

Idea:

In the module:

  Style Lilypond
...
ExportsTo  lilytex
  End  

- Would call the created LaTeX source filename.lilytex.

In the Converters:

   LilyTeX - LaTeX (plain):  lilypond-book $$i $$a
   
 At this point, use a new document settings to decide whether
 lyx should do this lilypond-book step or not. Many lyx documents
 have no lilypond content, and many lyx users don't have lilypond.

This is why I want to define the Lilypond style in a module. This
would also allow combination with any (?) document class.


 2. With lilypond-book working, start on the lilypond environment.
 first figure out if it ought to be a inset, a layout module, or
 whatever. I guess an inset will be the way.
 Then add the rule about how LyX produces latex code when processing
 a lilypond inset. This is easy - just output \begin{lilypond}
 followed by the inset contents, followed by \end{lilypond}

 At this point, you have working lilypond-book!

This step can even be tried before the first step -- if you export to
latex and run lilypond-book and latex by hand.

 3. Some fine-tuning. Remove the document setting that specifies if this
 is a lilypond document. Instead, add logic so that LyX will run
 lilypond-book whenever the document contains a lilypond inset.
 You can perhaps make use of similiar logic that add latex packages
 on an as-needed basis.

As stated above, I would prefer a generalization of the code for
literate programming.

 4. The preview. Arrange so Lyx runs the inset content through
 lilypond, and display the resulting .png if this succeeds.
 I am not sure how to do this part, but look at how it is done
 for math and graphichs insets.

If a preview is important, it might be simpler to go a completely
different route: amend the external inset so that it allows in-place
editing of the source instead of relying on an external file.

Günter



Re: Lilypond integration

2009-04-01 Thread Jürgen Spitzmüller
Guenter Milde wrote:

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.
 
 This is rather hard. With lilypond-book, you will have to live with
 the source code in LyX.

Actually, I think implementing instant preview to InsetFlex (and make it 
customizable by a layout flag) should not be too hard, and it would be a 
valuable goal also for other custom inset (think of a tipa inset).

Jürgen




Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-04-01, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.

 This is rather hard. With lilypond-book, you will have to live with
 the source code in LyX.

 Actually, I think implementing instant preview to InsetFlex (and make it 
 customizable by a layout flag) should not be too hard, and it would be a 
 valuable goal also for other custom inset (think of a tipa inset).

The problem here is that the preview has to be generated with lilypond,
not LaTeX. This is usually the realm of the external inset.

However, the user wanted to edit the source code inside LyX instead of an
external file. Maybe it is simpler to allow inline source in an
external inset than external preview in an InsetFlex.

Günter



Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Piero Faustini wrote:

> I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
> lily-book knows how to break music lines (or pages) in a given latex 
> environment, 

Are you sure? 

As I understand the docs of lilypond-book, it is a preprocessor that
works by extracting snippets of lilypond notation, transforming them to
EPS or PDF graphics and inserting a graphic-loading command in their
place.

> but it can't guess if this environment will change after LaTeX 
> compile. I mean: I'm writing a komascript book using some packages
> which can alter heavily the shape of the text, such as BibLaTeX, by
> adding more text.  This is the reason why my LyX's LaTeX run up to 4
> times when compiling, and everything works ok. Can lilypond-book give
> instructions at the beginning of this process? 

No.

But if used according to its specification (small musical examples in a
book), LaTeX should handle them nice. If I remember right, you can also
place the lilypond snipped inside a flaot.

> Can it be run more than once between Latex runs just to refine 
> the process? 

Not that I know of.


Günter



Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-03-23, Helge Hafting wrote:

>> I don't know if it's possible, but the ideal solution (for me) would be 
>> some kind of lilypond environment (somewhat like the math environment), 
>> where you can type in your lilypond code directly. 

This could be done, best in a "lilypond.module".

>> After leaving this environment, the graphic is rendered and put into
>> place in the LyX document. If you need to change it, you just click on
>> the graphic and the code environment pops up again.

This is rather hard. With lilypond-book, you will have to live with
the source code in LyX.

> Support for lilypond-book would be interesting. And sure - if you 
> volunteer to do some work then you will get it faster.

> This process can be divided into several steps, you won't have to do it 
> all at once.

> 1. Work on the support for lilypond-book.
> This will have LyX create latex output as usual,
> then, add code to run lilypond-book on the produced file
> Finally, let LyX run latex/pdflatex on the file produced, as usual.
> So this step is mostly about inserting an invocation
> of "lilypond-book" into the existing workflow.

We have an example of "latex-preprocessing" with the literate
programming (noweb) support. It is already (ab)used for R code with
sweave. I would very much like a generalisation, where a module could
trigger such preprocessing an set the preprocessor. 

Idea:

In the module:

  Style Lilypond
...
ExportsTo  lilytex
  End  

-> Would call the created LaTeX source .

In the Converters:

   LilyTeX -> LaTeX (plain):  lilypond-book $$i $$a
   
> At this point, use a new document settings to decide whether
> lyx should do this lilypond-book step or not. Many lyx documents
> have no lilypond content, and many lyx users don't have lilypond.

This is why I want to define the Lilypond style in a module. This
would also allow combination with any (?) document class.


> 2. With lilypond-book working, start on the lilypond environment.
> first figure out if it ought to be a inset, a layout module, or
> whatever. I guess an inset will be the way.
> Then add the rule about how LyX produces latex code when processing
> a lilypond inset. This is easy - just output \begin{lilypond}
> followed by the inset contents, followed by \end{lilypond}

> At this point, you have working lilypond-book!

This step can even be tried before the first step -- if you export to
latex and run lilypond-book and latex by hand.

> 3. Some fine-tuning. Remove the document setting that specifies if this
> is a lilypond document. Instead, add logic so that LyX will run
> lilypond-book whenever the document contains a lilypond inset.
> You can perhaps make use of similiar logic that add latex packages
> on an as-needed basis.

As stated above, I would prefer a generalization of the code for
literate programming.

> 4. The preview. Arrange so Lyx runs the inset content through
> lilypond, and display the resulting .png if this succeeds.
> I am not sure how to do this part, but look at how it is done
> for math and graphichs insets.

If a preview is important, it might be simpler to go a completely
different route: amend the external inset so that it allows in-place
editing of the source instead of relying on an external file.

Günter



Re: Lilypond integration

2009-04-01 Thread Jürgen Spitzmüller
Guenter Milde wrote:

>>> After leaving this environment, the graphic is rendered and put into
>>> place in the LyX document. If you need to change it, you just click on
>>> the graphic and the code environment pops up again.
> 
> This is rather hard. With lilypond-book, you will have to live with
> the source code in LyX.

Actually, I think implementing instant preview to InsetFlex (and make it 
customizable by a layout flag) should not be too hard, and it would be a 
valuable goal also for other custom inset (think of a tipa inset).

Jürgen




Re: Lilypond integration

2009-04-01 Thread Guenter Milde
On 2009-04-01, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:

 After leaving this environment, the graphic is rendered and put into
 place in the LyX document. If you need to change it, you just click on
 the graphic and the code environment pops up again.

>> This is rather hard. With lilypond-book, you will have to live with
>> the source code in LyX.

> Actually, I think implementing instant preview to InsetFlex (and make it 
> customizable by a layout flag) should not be too hard, and it would be a 
> valuable goal also for other custom inset (think of a tipa inset).

The problem here is that the preview has to be generated with lilypond,
not LaTeX. This is usually the realm of the external inset.

However, the user wanted to edit the source code inside LyX instead of an
external file. Maybe it is simpler to allow "inline source" in an
external inset than "external preview" in an InsetFlex.

Günter



Re: Lilypond integration

2009-03-31 Thread Helge Hafting

Piero Faustini wrote:
Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?



This process can be divided into several steps, you won't have to do it 
all at once.


I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?


I don't know. LyX can be enhanced to do anything that you can do with 
latex+lilypond. As you said, LyX already knows to run latex several 
times in order to  resolve bibliographies, references, TOCs and so on. 
If lilypond outputs information to the effect that something changed, 
and so a rerun *might* be necessary, then sure - LyX can be programmed 
to get the message.


Or, if it is necessary (and sufficient) to re-run lilypond on each 
re-run of latex, then that can be arranged instead.


The big question is - how can we know that another re-run is needed? LyX 
can't look at the final PDF and spot a badly broken musical line. 
However, lyx can be made to search any logfile lilypond produce, and 
look for messages that indicate such problems.


I don't know enough about lilypond to answer this.

Helge Hafting


RE: Lilypond integration

2009-03-31 Thread Piero Faustini


 The big question is - how can we know that another re-run is needed? LyX 
 can't look at the final PDF and spot a badly broken musical line. 
 However, lyx can be made to search any logfile lilypond produce, and 
 look for messages that indicate such problems.
 
 I don't know enough about lilypond to answer this.
 
 Helge Hafting

This is far beyond my knowledge, but I will be happy to help by testing and/or 
debugging, if it's not enough giving suggestions and advice.
_
25 GB di spazio gratis online: attiva SkyDrive!
http://clk.atdmt.com/GBL/go/136430529/direct/01/

Re: Lilypond integration

2009-03-31 Thread Helge Hafting

Piero Faustini wrote:
Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?



This process can be divided into several steps, you won't have to do it 
all at once.


I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?


I don't know. LyX can be enhanced to do anything that you can do with 
latex+lilypond. As you said, LyX already knows to run latex several 
times in order to  resolve bibliographies, references, TOCs and so on. 
If lilypond outputs information to the effect that something changed, 
and so a rerun *might* be necessary, then sure - LyX can be programmed 
to get the message.


Or, if it is necessary (and sufficient) to re-run lilypond on each 
re-run of latex, then that can be arranged instead.


The big question is - how can we know that another re-run is needed? LyX 
can't look at the final PDF and spot a badly broken musical line. 
However, lyx can be made to search any logfile lilypond produce, and 
look for messages that indicate such problems.


I don't know enough about lilypond to answer this.

Helge Hafting


RE: Lilypond integration

2009-03-31 Thread Piero Faustini


 The big question is - how can we know that another re-run is needed? LyX 
 can't look at the final PDF and spot a badly broken musical line. 
 However, lyx can be made to search any logfile lilypond produce, and 
 look for messages that indicate such problems.
 
 I don't know enough about lilypond to answer this.
 
 Helge Hafting

This is far beyond my knowledge, but I will be happy to help by testing and/or 
debugging, if it's not enough giving suggestions and advice.
_
25 GB di spazio gratis online: attiva SkyDrive!
http://clk.atdmt.com/GBL/go/136430529/direct/01/

Re: Lilypond integration

2009-03-31 Thread Helge Hafting

Piero Faustini wrote:
Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?



This process can be divided into several steps, you won't have to do it 
all at once.


I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?


I don't know. LyX can be enhanced to do anything that you can do with 
latex+lilypond. As you said, LyX already knows to run latex several 
times in order to  resolve bibliographies, references, TOCs and so on. 
If lilypond outputs information to the effect that "something changed, 
and so a rerun *might* be necessary", then sure - LyX can be programmed 
to get the message.


Or, if it is necessary (and sufficient) to re-run lilypond on each 
re-run of latex, then that can be arranged instead.


The big question is - how can we know that another re-run is needed? LyX 
can't look at the final PDF and spot a badly broken musical line. 
However, lyx can be made to search any logfile lilypond produce, and 
look for messages that indicate such problems.


I don't know enough about lilypond to answer this.

Helge Hafting


RE: Lilypond integration

2009-03-31 Thread Piero Faustini


> The big question is - how can we know that another re-run is needed? LyX 
> can't look at the final PDF and spot a badly broken musical line. 
> However, lyx can be made to search any logfile lilypond produce, and 
> look for messages that indicate such problems.
> 
> I don't know enough about lilypond to answer this.
> 
> Helge Hafting

This is far beyond my knowledge, but I will be happy to help by testing and/or 
debugging, if it's not enough giving suggestions and advice.
_
25 GB di spazio gratis online: attiva SkyDrive!
http://clk.atdmt.com/GBL/go/136430529/direct/01/

Re: Lilypond integration

2009-03-23 Thread Helge Hafting

Johannes Asal wrote:
I know that you can include Lilypond material by External Material. 
That's ok when you have few notation examples in your text and I 
appreciate that someone took the time to implement it. But I'm trying to 
write a book about jazz harmonics and therefore I need many musical 
examples that have to be changed often in the writing process. The main 
problems I have with the External Material approach are the following:


1. It interrupts the creative process, because you need to prepare the 
lilypond snippets in another editor and import them afterwards


I understand, as I have the same problem with figures. It is possible to 
ease the pain some, though. The external inset has a edit button, so 
you can click that in order to edit your music snippet. Newer versions 
of lyx doesn't have the button, instead you right-click the lilypond 
object and select edit externally from the menu. So you can get to 
it from LyX, but it will obviously still be an external application. 
You may have to define an editor for .ly files in the preferences.


2. You don't have a preview and therefore it is a bit difficult to see 
whether you have written something already or not


Tools-preferences-Graphics, then turn Instant Preview ON.
You should now get previews of all external insets, including lilypond 
music.  This is perhaps turned off by default, for performance reasons.


3. If you have to change one of the snippets, you have to find the 
corresponding file


Not really. right-click and select edit externally (Or, for older 
versions of lyx: click, then use the edit button in the dialog.)


I don't know if it's possible, but the ideal solution (for me) would be 
some kind of lilypond environment (somewhat like the math environment), 
where you can type in your lilypond code directly. After leaving this 
environment, the graphic is rendered and put into place in the LyX 
document. If you need to change it, you just click on the graphic and 
the code environment pops up again.


This is of course not a simple modification to do, and I guess it 
wouldn't be that fun either, but I'm sure it would be a valueable 
addition to LyX's feature list because as far as I know there is no 
solution today that combines text with music typesetting in a convenient 
and straightforward way. I would even volunteer for implementing parts 
of it if needed.


Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


This process can be divided into several steps, you won't have to do it 
all at once.


1. Work on the support for lilypond-book.
   This will have LyX create latex output as usual,
   then, add code to run lilypond-book on the produced file
   Finally, let LyX run latex/pdflatex on the file produced, as usual.
   So this step is mostly about inserting an invocation
   of lilypond-book into the existing workflow.

   At this point, use a new document settings to decide whether
   lyx should do this lilypond-book step or not. Many lyx documents
   have no lilypond content, and many lyx users don't have lilypond.

   Use the latex inset for lilypond code in the beginning.
   To enter music, type stuff like
\begin{lilypond} { c d e } \end{lilypond}
   There will be no preview so far.

2. With lilypond-book working, start on the lilypond environment.
   first figure out if it ought to be a inset, a layout module, or
   whatever. I guess an inset will be the way.

   Then add the rule about how LyX produces latex code when processing
   a lilypond inset. This is easy - just output \begin{lilypond}
   followed by the inset contents, followed by \end{lilypond}

   At this point, you have working lilypond-book!

3. Some fine-tuning. Remove the document setting that specifies if this
   is a lilypond document. Instead, add logic so that LyX will run
   lilypond-book whenever the document contains a lilypond inset.
   You can perhaps make use of similiar logic that add latex packages
   on an as-needed basis.

4. The preview. Arrange so Lyx runs the inset content through
   lilypond, and display the resulting .png if this succeeds.
   I am not sure how to do this part, but look at how it is done
   for math and graphichs insets.


Helge Hafting


Re: Lilypond integration

2009-03-23 Thread Piero Faustini

 Support for lilypond-book would be interesting. And sure - if you 
 volunteer to do some work then you will get it faster.

I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?


 This process can be divided into several steps, you won't have to do it 
 all at once.

I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?

Anyway, to all: keep me updated about any Lilypond-book integration attempt.
Piero



Re: Lilypond integration

2009-03-23 Thread Helge Hafting

Johannes Asal wrote:
I know that you can include Lilypond material by External Material. 
That's ok when you have few notation examples in your text and I 
appreciate that someone took the time to implement it. But I'm trying to 
write a book about jazz harmonics and therefore I need many musical 
examples that have to be changed often in the writing process. The main 
problems I have with the External Material approach are the following:


1. It interrupts the creative process, because you need to prepare the 
lilypond snippets in another editor and import them afterwards


I understand, as I have the same problem with figures. It is possible to 
ease the pain some, though. The external inset has a edit button, so 
you can click that in order to edit your music snippet. Newer versions 
of lyx doesn't have the button, instead you right-click the lilypond 
object and select edit externally from the menu. So you can get to 
it from LyX, but it will obviously still be an external application. 
You may have to define an editor for .ly files in the preferences.


2. You don't have a preview and therefore it is a bit difficult to see 
whether you have written something already or not


Tools-preferences-Graphics, then turn Instant Preview ON.
You should now get previews of all external insets, including lilypond 
music.  This is perhaps turned off by default, for performance reasons.


3. If you have to change one of the snippets, you have to find the 
corresponding file


Not really. right-click and select edit externally (Or, for older 
versions of lyx: click, then use the edit button in the dialog.)


I don't know if it's possible, but the ideal solution (for me) would be 
some kind of lilypond environment (somewhat like the math environment), 
where you can type in your lilypond code directly. After leaving this 
environment, the graphic is rendered and put into place in the LyX 
document. If you need to change it, you just click on the graphic and 
the code environment pops up again.


This is of course not a simple modification to do, and I guess it 
wouldn't be that fun either, but I'm sure it would be a valueable 
addition to LyX's feature list because as far as I know there is no 
solution today that combines text with music typesetting in a convenient 
and straightforward way. I would even volunteer for implementing parts 
of it if needed.


Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


This process can be divided into several steps, you won't have to do it 
all at once.


1. Work on the support for lilypond-book.
   This will have LyX create latex output as usual,
   then, add code to run lilypond-book on the produced file
   Finally, let LyX run latex/pdflatex on the file produced, as usual.
   So this step is mostly about inserting an invocation
   of lilypond-book into the existing workflow.

   At this point, use a new document settings to decide whether
   lyx should do this lilypond-book step or not. Many lyx documents
   have no lilypond content, and many lyx users don't have lilypond.

   Use the latex inset for lilypond code in the beginning.
   To enter music, type stuff like
\begin{lilypond} { c d e } \end{lilypond}
   There will be no preview so far.

2. With lilypond-book working, start on the lilypond environment.
   first figure out if it ought to be a inset, a layout module, or
   whatever. I guess an inset will be the way.

   Then add the rule about how LyX produces latex code when processing
   a lilypond inset. This is easy - just output \begin{lilypond}
   followed by the inset contents, followed by \end{lilypond}

   At this point, you have working lilypond-book!

3. Some fine-tuning. Remove the document setting that specifies if this
   is a lilypond document. Instead, add logic so that LyX will run
   lilypond-book whenever the document contains a lilypond inset.
   You can perhaps make use of similiar logic that add latex packages
   on an as-needed basis.

4. The preview. Arrange so Lyx runs the inset content through
   lilypond, and display the resulting .png if this succeeds.
   I am not sure how to do this part, but look at how it is done
   for math and graphichs insets.


Helge Hafting


Re: Lilypond integration

2009-03-23 Thread Piero Faustini

 Support for lilypond-book would be interesting. And sure - if you 
 volunteer to do some work then you will get it faster.

I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?


 This process can be divided into several steps, you won't have to do it 
 all at once.

I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?

Anyway, to all: keep me updated about any Lilypond-book integration attempt.
Piero



Re: Lilypond integration

2009-03-23 Thread Helge Hafting

Johannes Asal wrote:
I know that you can include Lilypond material by External Material. 
That's ok when you have few notation examples in your text and I 
appreciate that someone took the time to implement it. But I'm trying to 
write a book about jazz harmonics and therefore I need many musical 
examples that have to be changed often in the writing process. The main 
problems I have with the External Material approach are the following:


1. It interrupts the creative process, because you need to prepare the 
lilypond snippets in another editor and import them afterwards


I understand, as I have the same problem with figures. It is possible to 
ease the pain some, though. The external inset has a "edit" button, so 
you can click that in order to edit your music snippet. Newer versions 
of lyx doesn't have the button, instead you right-click the lilypond 
object and select "edit externally" from the menu. So you can "get to 
it" from LyX, but it will obviously still be an external application. 
You may have to define an editor for .ly files in the preferences.


2. You don't have a preview and therefore it is a bit difficult to see 
whether you have written something already or not


Tools->preferences->Graphics, then turn "Instant Preview" ON.
You should now get previews of all external insets, including lilypond 
music.  This is perhaps turned off by default, for performance reasons.


3. If you have to change one of the snippets, you have to find the 
corresponding file


Not really. right-click and select "edit externally" (Or, for older 
versions of lyx: click, then use the edit button in the dialog.)


I don't know if it's possible, but the ideal solution (for me) would be 
some kind of lilypond environment (somewhat like the math environment), 
where you can type in your lilypond code directly. After leaving this 
environment, the graphic is rendered and put into place in the LyX 
document. If you need to change it, you just click on the graphic and 
the code environment pops up again.


This is of course not a simple modification to do, and I guess it 
wouldn't be that fun either, but I'm sure it would be a valueable 
addition to LyX's feature list because as far as I know there is no 
solution today that combines text with music typesetting in a convenient 
and straightforward way. I would even volunteer for implementing parts 
of it if needed.


Support for lilypond-book would be interesting. And sure - if you 
volunteer to do some work then you will get it faster.


This process can be divided into several steps, you won't have to do it 
all at once.


1. Work on the support for lilypond-book.
   This will have LyX create latex output as usual,
   then, add code to run lilypond-book on the produced file
   Finally, let LyX run latex/pdflatex on the file produced, as usual.
   So this step is mostly about inserting an invocation
   of "lilypond-book" into the existing workflow.

   At this point, use a new document settings to decide whether
   lyx should do this lilypond-book step or not. Many lyx documents
   have no lilypond content, and many lyx users don't have lilypond.

   Use the latex inset for lilypond code in the beginning.
   To enter music, type stuff like
\begin{lilypond} { c d e } \end{lilypond}
   There will be no preview so far.

2. With lilypond-book working, start on the lilypond environment.
   first figure out if it ought to be a inset, a layout module, or
   whatever. I guess an inset will be the way.

   Then add the rule about how LyX produces latex code when processing
   a lilypond inset. This is easy - just output \begin{lilypond}
   followed by the inset contents, followed by \end{lilypond}

   At this point, you have working lilypond-book!

3. Some fine-tuning. Remove the document setting that specifies if this
   is a lilypond document. Instead, add logic so that LyX will run
   lilypond-book whenever the document contains a lilypond inset.
   You can perhaps make use of similiar logic that add latex packages
   on an as-needed basis.

4. The preview. Arrange so Lyx runs the inset content through
   lilypond, and display the resulting .png if this succeeds.
   I am not sure how to do this part, but look at how it is done
   for math and graphichs insets.


Helge Hafting


Re: Lilypond integration

2009-03-23 Thread Piero Faustini

> Support for lilypond-book would be interesting. And sure - if you 
> volunteer to do some work then you will get it faster.

I would happily contribute, but I'm not a programmer. May I be of some help 
just giving some suggestion or testing?


> This process can be divided into several steps, you won't have to do it 
> all at once.

I think your 4-steps are a perfect roadmap.

I have a doubt, although it's regarding more the LaTeX-LilyPond integration: 
lily-book knows how to break music lines (or pages) in a given latex 
environment, but it can't guess if this environment will change after LaTeX 
compile. I mean: I'm writing a komascript book using some packages which can 
alter heavily the shape of the text, such as BibLaTeX, by adding more text. 
This is the reason why my LyX's LaTeX run up to 4 times when compiling, and 
everything works ok. Can lilypond-book give instructions at the beginning of 
this process? Can it be run more than once between Latex runs just to refine 
the process? If yes, what about LyX and all this mess?

Anyway, to all: keep me updated about any Lilypond-book integration attempt.
Piero



Re: Lilypond integration

2009-03-16 Thread Johannes Asal
Piero Faustini pierofaust...@... writes:

 
 I understand what are your needs, because almost identical as mine.
 I had to discard lilypond-book because it was too difficoult to integrate 
 with 
 LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
 packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
 think it would be difficuolt to have everything work without problems, and 
 almost impossible to have a working instant preview of the whole doc.
  It seems that a theory book (as a musicological research on librettoes) 
 doesn't need a lot of long music examples, so the advantages of lilypond-book 
 (basically: ability to draw music snipetts in different environments) are not 
 so important.
 This is what I use: I have a directory of musical examples in .ly files, 
 which 
 have a simple code that have all the white space cut. (can't find the thread 
 where this was discussed, I will post it later).
 I use Insert - File - External material - Lilypond file. It can give instant 
 preview (and allows direct link to the predefined Lilypond editor, if you 
 find 
 some error) so is ALMOST as having the code directly in the LyX doc.
 If you need multiple lines examples, this can be hard to achieve if you need 
 lines to cross between pages, but I think a solution can be found. Stay tuned.
 Hope it was clear
 
 

Thanks for your answer. I was checking the nabble forum so I didn't read your
posts. I think the External material solution is not optimal, as it forces you
to interrupt your creative process. You need to switch to another application
and create a lilypond file, then go back to lyx and import it. Of course you
could prepare all the files before starting to write the text, but who knows
exactly what kind of musical examples he will need in his book?

I'm not really sure, what would be the best solution. But what I'm sure about is
that there should be a solution. Not even Finale or Sibelius provide real
support for writing musicological documents. Considering the price you have to
pay for them, that's a real shame.



Re: Lilypond integration

2009-03-16 Thread Piero Faustini
Johannes Asal johannes.a...@... writes:

 Thanks for your answer. I was checking the nabble forum so I didn't read your
 posts. I think the External material solution is not optimal, as it forces 
you
 to interrupt your creative process. You need to switch to another application
 and create a lilypond file, then go back to lyx and import it. Of course you
 could prepare all the files before starting to write the text, but who knows
 exactly what kind of musical examples he will need in his book?

Sure. If creative process continuity is your need, that's pretty important. 
But I thought that creating a musical example IS a different task than write 
some text. If you just need to put in the FLOW of text some musical symbols to 
create - for example - a simple rhythm pattern or some harmony analysis, check 
the package Harmony: but not music at all.

If you think you can stand import you can do like this:
1. have a plain and blank .ly file always ready in the document directory. 
Let's call it blank.ly
2. Put it in the document with Insert etc. etc.
3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a 
proper tool already working, as I have, for example Lilypondtool + jEdit)
4. Edit file but save it with a new name, and just quit external editor
5. click on the example box and just select the new .ly file you just created 
(otherwise it would still point to blank.ly)
6. If preview is ON, you now should see the example in the proper place, and 
edit externally whenever you need it.

If you have hundreds of VERY tiny examples (such a pair of chords or a simple 
melody) the process could be annoying, and you were right.
 But if your examples are just small (or rather medium-size), and not 
hundreds, this method have a great advantage: you can see a preview (in your 
default editor) AND a preview in LyX (otherwise, I think, you CAN'T have, and 
you should rely on your unassisted .ly writing skills - I couldn't do so!!!)

 I'm not really sure, what would be the best solution. But what I'm sure about 
is
 that there should be a solution. Not even Finale or Sibelius provide real
 support for writing musicological documents. Considering the price you have 

Finale? Sibelius? never heard oh that, should be some exotic programs ;)

Lilypond-book IS the solution for your needs, but we LyX-Lilypond users need to 
tweak harder to have it work without problems.
But, I repeat, even when we find a way to use lilypond-book, I would continue 
to use in many case the IMPORT solution - By the way, it IS NOT a import: you 
do not import anything at all, you just USE lilypond files. Importing would be 
bad, using is great: you could manually add some stuff like a copyright line 
in every .ly file without compiling, and touch NOTHING in your LyX doc, and 
everything would work perfect at next LyX compiling.
It's just a matter of keep .ly code in external files.

Hope to have helped you.
These days I'm very busy, but in a pair of weeks I'm going to work on the 
lilypond-book thing. I quote you there should be a solution.
Bye
Piero






Re: Lilypond integration

2009-03-16 Thread Doug Laidlaw
I run Lyx, Lilypond and Frescobaldi.  I still use Noteedit to write Lilypond 
files, although development has stopped.  I have no reason to import Lilypond 
into Lyx, but under Converters I did notice that there are commands for 
Noteedit and Lilypond files.

Frescobaldi no longer depends on Kate, as its predecessor did.  It is 
basically an editor and processor for .ly files.  Importing probably needs 
something different.  Since the usable output from Lilypond is PostScript or 
PDF, perhaps the OP needs to look at importing those.

Doug.

On Tuesday 17 March 2009 10:09:25 am Piero Faustini wrote:
 Johannes Asal johannes.a...@... writes:
  Thanks for your answer. I was checking the nabble forum so I didn't read
  your posts. I think the External material solution is not optimal, as it
  forces

 you

  to interrupt your creative process. You need to switch to another
  application and create a lilypond file, then go back to lyx and import
  it. Of course you could prepare all the files before starting to write
  the text, but who knows exactly what kind of musical examples he will
  need in his book?

 Sure. If creative process continuity is your need, that's pretty
 important. But I thought that creating a musical example IS a different
 task than write some text. If you just need to put in the FLOW of text some
 musical symbols to create - for example - a simple rhythm pattern or some
 harmony analysis, check the package Harmony: but not music at all.

 If you think you can stand import you can do like this:
 1. have a plain and blank .ly file always ready in the document directory.
 Let's call it blank.ly
 2. Put it in the document with Insert etc. etc.
 3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a
 proper tool already working, as I have, for example Lilypondtool + jEdit)
 4. Edit file but save it with a new name, and just quit external editor
 5. click on the example box and just select the new .ly file you just
 created (otherwise it would still point to blank.ly)
 6. If preview is ON, you now should see the example in the proper place,
 and edit externally whenever you need it.

 If you have hundreds of VERY tiny examples (such a pair of chords or a
 simple melody) the process could be annoying, and you were right.
  But if your examples are just small (or rather medium-size), and not
 hundreds, this method have a great advantage: you can see a preview (in
 your default editor) AND a preview in LyX (otherwise, I think, you CAN'T
 have, and you should rely on your unassisted .ly writing skills - I
 couldn't do so!!!)

  I'm not really sure, what would be the best solution. But what I'm sure
  about

 is

  that there should be a solution. Not even Finale or Sibelius provide real
  support for writing musicological documents. Considering the price you
  have

 Finale? Sibelius? never heard oh that, should be some exotic programs ;)

 Lilypond-book IS the solution for your needs, but we LyX-Lilypond users
 need to tweak harder to have it work without problems.
 But, I repeat, even when we find a way to use lilypond-book, I would
 continue to use in many case the IMPORT solution - By the way, it IS NOT a
 import: you do not import anything at all, you just USE lilypond files.
 Importing would be bad, using is great: you could manually add some stuff
 like a copyright line in every .ly file without compiling, and touch
 NOTHING in your LyX doc, and everything would work perfect at next LyX
 compiling.
 It's just a matter of keep .ly code in external files.

 Hope to have helped you.
 These days I'm very busy, but in a pair of weeks I'm going to work on the
 lilypond-book thing. I quote you there should be a solution.
 Bye
 Piero




Re: Lilypond integration

2009-03-16 Thread Johannes Asal
Piero Faustini pierofaust...@... writes:

 
 I understand what are your needs, because almost identical as mine.
 I had to discard lilypond-book because it was too difficoult to integrate 
 with 
 LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
 packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
 think it would be difficuolt to have everything work without problems, and 
 almost impossible to have a working instant preview of the whole doc.
  It seems that a theory book (as a musicological research on librettoes) 
 doesn't need a lot of long music examples, so the advantages of lilypond-book 
 (basically: ability to draw music snipetts in different environments) are not 
 so important.
 This is what I use: I have a directory of musical examples in .ly files, 
 which 
 have a simple code that have all the white space cut. (can't find the thread 
 where this was discussed, I will post it later).
 I use Insert - File - External material - Lilypond file. It can give instant 
 preview (and allows direct link to the predefined Lilypond editor, if you 
 find 
 some error) so is ALMOST as having the code directly in the LyX doc.
 If you need multiple lines examples, this can be hard to achieve if you need 
 lines to cross between pages, but I think a solution can be found. Stay tuned.
 Hope it was clear
 
 

Thanks for your answer. I was checking the nabble forum so I didn't read your
posts. I think the External material solution is not optimal, as it forces you
to interrupt your creative process. You need to switch to another application
and create a lilypond file, then go back to lyx and import it. Of course you
could prepare all the files before starting to write the text, but who knows
exactly what kind of musical examples he will need in his book?

I'm not really sure, what would be the best solution. But what I'm sure about is
that there should be a solution. Not even Finale or Sibelius provide real
support for writing musicological documents. Considering the price you have to
pay for them, that's a real shame.



Re: Lilypond integration

2009-03-16 Thread Piero Faustini
Johannes Asal johannes.a...@... writes:

 Thanks for your answer. I was checking the nabble forum so I didn't read your
 posts. I think the External material solution is not optimal, as it forces 
you
 to interrupt your creative process. You need to switch to another application
 and create a lilypond file, then go back to lyx and import it. Of course you
 could prepare all the files before starting to write the text, but who knows
 exactly what kind of musical examples he will need in his book?

Sure. If creative process continuity is your need, that's pretty important. 
But I thought that creating a musical example IS a different task than write 
some text. If you just need to put in the FLOW of text some musical symbols to 
create - for example - a simple rhythm pattern or some harmony analysis, check 
the package Harmony: but not music at all.

If you think you can stand import you can do like this:
1. have a plain and blank .ly file always ready in the document directory. 
Let's call it blank.ly
2. Put it in the document with Insert etc. etc.
3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a 
proper tool already working, as I have, for example Lilypondtool + jEdit)
4. Edit file but save it with a new name, and just quit external editor
5. click on the example box and just select the new .ly file you just created 
(otherwise it would still point to blank.ly)
6. If preview is ON, you now should see the example in the proper place, and 
edit externally whenever you need it.

If you have hundreds of VERY tiny examples (such a pair of chords or a simple 
melody) the process could be annoying, and you were right.
 But if your examples are just small (or rather medium-size), and not 
hundreds, this method have a great advantage: you can see a preview (in your 
default editor) AND a preview in LyX (otherwise, I think, you CAN'T have, and 
you should rely on your unassisted .ly writing skills - I couldn't do so!!!)

 I'm not really sure, what would be the best solution. But what I'm sure about 
is
 that there should be a solution. Not even Finale or Sibelius provide real
 support for writing musicological documents. Considering the price you have 

Finale? Sibelius? never heard oh that, should be some exotic programs ;)

Lilypond-book IS the solution for your needs, but we LyX-Lilypond users need to 
tweak harder to have it work without problems.
But, I repeat, even when we find a way to use lilypond-book, I would continue 
to use in many case the IMPORT solution - By the way, it IS NOT a import: you 
do not import anything at all, you just USE lilypond files. Importing would be 
bad, using is great: you could manually add some stuff like a copyright line 
in every .ly file without compiling, and touch NOTHING in your LyX doc, and 
everything would work perfect at next LyX compiling.
It's just a matter of keep .ly code in external files.

Hope to have helped you.
These days I'm very busy, but in a pair of weeks I'm going to work on the 
lilypond-book thing. I quote you there should be a solution.
Bye
Piero






Re: Lilypond integration

2009-03-16 Thread Doug Laidlaw
I run Lyx, Lilypond and Frescobaldi.  I still use Noteedit to write Lilypond 
files, although development has stopped.  I have no reason to import Lilypond 
into Lyx, but under Converters I did notice that there are commands for 
Noteedit and Lilypond files.

Frescobaldi no longer depends on Kate, as its predecessor did.  It is 
basically an editor and processor for .ly files.  Importing probably needs 
something different.  Since the usable output from Lilypond is PostScript or 
PDF, perhaps the OP needs to look at importing those.

Doug.

On Tuesday 17 March 2009 10:09:25 am Piero Faustini wrote:
 Johannes Asal johannes.a...@... writes:
  Thanks for your answer. I was checking the nabble forum so I didn't read
  your posts. I think the External material solution is not optimal, as it
  forces

 you

  to interrupt your creative process. You need to switch to another
  application and create a lilypond file, then go back to lyx and import
  it. Of course you could prepare all the files before starting to write
  the text, but who knows exactly what kind of musical examples he will
  need in his book?

 Sure. If creative process continuity is your need, that's pretty
 important. But I thought that creating a musical example IS a different
 task than write some text. If you just need to put in the FLOW of text some
 musical symbols to create - for example - a simple rhythm pattern or some
 harmony analysis, check the package Harmony: but not music at all.

 If you think you can stand import you can do like this:
 1. have a plain and blank .ly file always ready in the document directory.
 Let's call it blank.ly
 2. Put it in the document with Insert etc. etc.
 3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a
 proper tool already working, as I have, for example Lilypondtool + jEdit)
 4. Edit file but save it with a new name, and just quit external editor
 5. click on the example box and just select the new .ly file you just
 created (otherwise it would still point to blank.ly)
 6. If preview is ON, you now should see the example in the proper place,
 and edit externally whenever you need it.

 If you have hundreds of VERY tiny examples (such a pair of chords or a
 simple melody) the process could be annoying, and you were right.
  But if your examples are just small (or rather medium-size), and not
 hundreds, this method have a great advantage: you can see a preview (in
 your default editor) AND a preview in LyX (otherwise, I think, you CAN'T
 have, and you should rely on your unassisted .ly writing skills - I
 couldn't do so!!!)

  I'm not really sure, what would be the best solution. But what I'm sure
  about

 is

  that there should be a solution. Not even Finale or Sibelius provide real
  support for writing musicological documents. Considering the price you
  have

 Finale? Sibelius? never heard oh that, should be some exotic programs ;)

 Lilypond-book IS the solution for your needs, but we LyX-Lilypond users
 need to tweak harder to have it work without problems.
 But, I repeat, even when we find a way to use lilypond-book, I would
 continue to use in many case the IMPORT solution - By the way, it IS NOT a
 import: you do not import anything at all, you just USE lilypond files.
 Importing would be bad, using is great: you could manually add some stuff
 like a copyright line in every .ly file without compiling, and touch
 NOTHING in your LyX doc, and everything would work perfect at next LyX
 compiling.
 It's just a matter of keep .ly code in external files.

 Hope to have helped you.
 These days I'm very busy, but in a pair of weeks I'm going to work on the
 lilypond-book thing. I quote you there should be a solution.
 Bye
 Piero




Re: Lilypond integration

2009-03-16 Thread Johannes Asal
Piero Faustini  writes:

> 
> I understand what are your needs, because almost identical as mine.
> I had to discard lilypond-book because it was too difficoult to integrate 
> with 
> LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
> packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
> think it would be difficuolt to have everything work without problems, and 
> almost impossible to have a working instant preview of the whole doc.
>  It seems that a theory book (as a musicological research on librettoes) 
> doesn't need a lot of long music examples, so the advantages of lilypond-book 
> (basically: ability to draw music snipetts in different environments) are not 
> so important.
> This is what I use: I have a directory of musical examples in .ly files, 
> which 
> have a simple code that have all the white space cut. (can't find the thread 
> where this was discussed, I will post it later).
> I use Insert - File - External material - Lilypond file. It can give instant 
> preview (and allows direct link to the predefined Lilypond editor, if you 
> find 
> some error) so is ALMOST as having the code directly in the LyX doc.
> If you need multiple lines examples, this can be hard to achieve if you need 
> lines to cross between pages, but I think a solution can be found. Stay tuned.
> Hope it was clear
> 
> 

Thanks for your answer. I was checking the nabble forum so I didn't read your
posts. I think the External material solution is not optimal, as it forces you
to interrupt your creative process. You need to switch to another application
and create a lilypond file, then go back to lyx and import it. Of course you
could prepare all the files before starting to write the text, but who knows
exactly what kind of musical examples he will need in his book?

I'm not really sure, what would be the best solution. But what I'm sure about is
that there should be a solution. Not even Finale or Sibelius provide real
support for writing musicological documents. Considering the price you have to
pay for them, that's a real shame.



Re: Lilypond integration

2009-03-16 Thread Piero Faustini
Johannes Asal  writes:

> Thanks for your answer. I was checking the nabble forum so I didn't read your
> posts. I think the External material solution is not optimal, as it forces 
you
> to interrupt your creative process. You need to switch to another application
> and create a lilypond file, then go back to lyx and import it. Of course you
> could prepare all the files before starting to write the text, but who knows
> exactly what kind of musical examples he will need in his book?

Sure. If "creative process" continuity is your need, that's pretty important. 
But I thought that creating a musical example IS a different task than write 
some text. If you just need to put in the FLOW of text some musical symbols to 
create - for example - a simple rhythm pattern or some harmony analysis, check 
the package Harmony: but not "music" at all.

If you think you can stand "import" you can do like this:
1. have a plain and blank .ly file always ready in the document directory. 
Let's call it "blank.ly"
2. Put it in the document with Insert etc. etc.
3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a 
proper tool already working, as I have, for example Lilypondtool + jEdit)
4. Edit file but save it with a new name, and just quit external editor
5. click on the example box and just select the new .ly file you just created 
(otherwise it would still point to "blank.ly")
6. If preview is ON, you now should see the example in the proper place, and 
edit "externally" whenever you need it.

If you have hundreds of VERY tiny examples (such a pair of chords or a simple 
melody) the process could be annoying, and you were right.
 But if your examples are just "small" (or rather medium-size), and not 
hundreds, this method have a great advantage: you can see a preview (in your 
default editor) AND a preview in LyX (otherwise, I think, you CAN'T have, and 
you should rely on your unassisted .ly writing skills - I couldn't do so!!!)

> I'm not really sure, what would be the best solution. But what I'm sure about 
is
> that there should be a solution. Not even Finale or Sibelius provide real
> support for writing musicological documents. Considering the price you have 

Finale? Sibelius? never heard oh that, should be some exotic programs ;)

Lilypond-book IS the solution for your needs, but we LyX-Lilypond users need to 
tweak harder to have it work without problems.
But, I repeat, even when we find a way to use lilypond-book, I would continue 
to use in many case the IMPORT solution - By the way, it IS NOT a import: you 
do not import anything at all, you just USE lilypond files. Importing would be 
bad, using is great: you could manually add some stuff like a "copyright" line 
in every .ly file without compiling, and touch NOTHING in your LyX doc, and 
everything would work perfect at next LyX compiling.
It's just a matter of keep .ly code in external files.

Hope to have helped you.
These days I'm very busy, but in a pair of weeks I'm going to work on the 
lilypond-book thing. I quote you "there should be a solution".
Bye
Piero






Re: Lilypond integration

2009-03-16 Thread Doug Laidlaw
I run Lyx, Lilypond and Frescobaldi.  I still use Noteedit to write Lilypond 
files, although development has stopped.  I have no reason to import Lilypond 
into Lyx, but under "Converters" I did notice that there are commands for 
Noteedit and Lilypond files.

Frescobaldi no longer depends on Kate, as its predecessor did.  It is 
basically an editor and processor for .ly files.  Importing probably needs 
something different.  Since the usable output from Lilypond is PostScript or 
PDF, perhaps the OP needs to look at importing those.

Doug.

On Tuesday 17 March 2009 10:09:25 am Piero Faustini wrote:
> Johannes Asal  writes:
> > Thanks for your answer. I was checking the nabble forum so I didn't read
> > your posts. I think the External material solution is not optimal, as it
> > forces
>
> you
>
> > to interrupt your creative process. You need to switch to another
> > application and create a lilypond file, then go back to lyx and import
> > it. Of course you could prepare all the files before starting to write
> > the text, but who knows exactly what kind of musical examples he will
> > need in his book?
>
> Sure. If "creative process" continuity is your need, that's pretty
> important. But I thought that creating a musical example IS a different
> task than write some text. If you just need to put in the FLOW of text some
> musical symbols to create - for example - a simple rhythm pattern or some
> harmony analysis, check the package Harmony: but not "music" at all.
>
> If you think you can stand "import" you can do like this:
> 1. have a plain and blank .ly file always ready in the document directory.
> Let's call it "blank.ly"
> 2. Put it in the document with Insert etc. etc.
> 3. Rightclick on it and Select EDIT EXTERNALLY (MUCH BETTER if you have a
> proper tool already working, as I have, for example Lilypondtool + jEdit)
> 4. Edit file but save it with a new name, and just quit external editor
> 5. click on the example box and just select the new .ly file you just
> created (otherwise it would still point to "blank.ly")
> 6. If preview is ON, you now should see the example in the proper place,
> and edit "externally" whenever you need it.
>
> If you have hundreds of VERY tiny examples (such a pair of chords or a
> simple melody) the process could be annoying, and you were right.
>  But if your examples are just "small" (or rather medium-size), and not
> hundreds, this method have a great advantage: you can see a preview (in
> your default editor) AND a preview in LyX (otherwise, I think, you CAN'T
> have, and you should rely on your unassisted .ly writing skills - I
> couldn't do so!!!)
>
> > I'm not really sure, what would be the best solution. But what I'm sure
> > about
>
> is
>
> > that there should be a solution. Not even Finale or Sibelius provide real
> > support for writing musicological documents. Considering the price you
> > have
>
> Finale? Sibelius? never heard oh that, should be some exotic programs ;)
>
> Lilypond-book IS the solution for your needs, but we LyX-Lilypond users
> need to tweak harder to have it work without problems.
> But, I repeat, even when we find a way to use lilypond-book, I would
> continue to use in many case the IMPORT solution - By the way, it IS NOT a
> import: you do not import anything at all, you just USE lilypond files.
> Importing would be bad, using is great: you could manually add some stuff
> like a "copyright" line in every .ly file without compiling, and touch
> NOTHING in your LyX doc, and everything would work perfect at next LyX
> compiling.
> It's just a matter of keep .ly code in external files.
>
> Hope to have helped you.
> These days I'm very busy, but in a pair of weeks I'm going to work on the
> lilypond-book thing. I quote you "there should be a solution".
> Bye
> Piero




Re: Lilypond integration

2009-03-10 Thread Helge Hafting

j.asal wrote:

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?


I created what little support there is for lilypond in LyX. Mostly 
because it was easy and interesting to do.  It'd be interesting to know 
more about what kind of lilypond support that actually is useful.


Currently, LyX can use lilypond files that takes up a page or less. This 
because LyX runs the file through the lilypond software for you, obtains 
a pdf or postscript file, and includes that as a graphical object.


This lets you typeset pieces of music that is less than a page each, and 
get them into the LyX document. Maybe it is also possible to create 
small examples such as a single chord and include it in the middle of a 
line of text. I haven't actually tried that, but it ought to work.


The way to do this:
1. Create a LyX document and a lilypond file
2. In LyX: Insert-File-External Material
3. In the external material dialog, change template to LilyPond,
   and insert the correct filename.

Your music should now appear when you print the LyX file or export a PDF 
file.


Please let me know if there are problems with this.

Supporting lilypond-book would need a different approach, because the 
processing is different.


Helge Hafting




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
j.asal wrote:
 
 Hi,
 
 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files). I
 know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX to
 'compile' the latex file. Any ideas/suggestions?

btw as a small poll - what version of lilypond you people use?
(see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

pavel


Re: Lilypond integration

2009-03-10 Thread Johannes Asal
I know that you can include Lilypond material by External Material. That's
ok when you have few notation examples in your text and I appreciate that
someone took the time to implement it. But I'm trying to write a book about
jazz harmonics and therefore I need many musical examples that have to be
changed often in the writing process. The main problems I have with the
External Material approach are the following:

1. It interrupts the creative process, because you need to prepare the
lilypond snippets in another editor and import them afterwards
2. You don't have a preview and therefore it is a bit difficult to see
whether you have written something already or not
3. If you have to change one of the snippets, you have to find the
corresponding file

I don't know if it's possible, but the ideal solution (for me) would be some
kind of lilypond environment (somewhat like the math environment), where you
can type in your lilypond code directly. After leaving this environment, the
graphic is rendered and put into place in the LyX document. If you need to
change it, you just click on the graphic and the code environment pops up
again.

This is of course not a simple modification to do, and I guess it wouldn't
be that fun either, but I'm sure it would be a valueable addition to LyX's
feature list because as far as I know there is no solution today that
combines text with music typesetting in a convenient and straightforward
way. I would even volunteer for implementing parts of it if needed.

Johannes Asal

2009/3/10 Helge Hafting helge.haft...@hist.no

 j.asal wrote:

 Hi,

 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files).
 I
 know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX
 to
 'compile' the latex file. Any ideas/suggestions?


 I created what little support there is for lilypond in LyX. Mostly because
 it was easy and interesting to do.  It'd be interesting to know more about
 what kind of lilypond support that actually is useful.

 Currently, LyX can use lilypond files that takes up a page or less. This
 because LyX runs the file through the lilypond software for you, obtains a
 pdf or postscript file, and includes that as a graphical object.

 This lets you typeset pieces of music that is less than a page each, and
 get them into the LyX document. Maybe it is also possible to create small
 examples such as a single chord and include it in the middle of a line of
 text. I haven't actually tried that, but it ought to work.

 The way to do this:
 1. Create a LyX document and a lilypond file
 2. In LyX: Insert-File-External Material
 3. In the external material dialog, change template to LilyPond,
   and insert the correct filename.

 Your music should now appear when you print the LyX file or export a PDF
 file.

 Please let me know if there are problems with this.

 Supporting lilypond-book would need a different approach, because the
 processing is different.

 Helge Hafting





Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Johannes Asal wrote:
 1. It interrupts the creative process, because you need to prepare the
 lilypond snippets in another editor and import them afterwards
 2. You don't have a preview and therefore it is a bit difficult to see
 whether you have written something already or not

you should be able to do this via instant preview.

 3. If you have to change one of the snippets, you have to find the
 corresponding file

you should be able to do this directly via context menu - edit externally.

pavel


Re: Lilypond integration

2009-03-10 Thread Guenter Milde
On 2009-03-10, Pavel Sanda wrote:

 btw as a small poll - what version of lilypond you people use?
 (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

Version: 2.10.33-2.3 (Debian/testing).

BTW: How much work would it be to copy/adapt the lilypond external inset to
an inset for *.abc music files with abcm2ps?

Günter




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Guenter Milde wrote:
 On 2009-03-10, Pavel Sanda wrote:
 
  btw as a small poll - what version of lilypond you people use?
  (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )
 
 Version: 2.10.33-2.3 (Debian/testing).
 
 BTW: How much work would it be to copy/adapt the lilypond external inset to
 an inset for *.abc music files with abcm2ps?

its not time saver to use external inset for this.
it would need some cloning of ert-like insent, adding preview like graphics 
insets do and
maybe some additional tweaks in latex generation in case you can't put lilypond 
code
directly into the .tex file. the basic blocks are already done, but assemling
it into functional inset wont be few-liner either...

pavel


Re: Lilypond integration

2009-03-10 Thread Helge Hafting

j.asal wrote:

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?


I created what little support there is for lilypond in LyX. Mostly 
because it was easy and interesting to do.  It'd be interesting to know 
more about what kind of lilypond support that actually is useful.


Currently, LyX can use lilypond files that takes up a page or less. This 
because LyX runs the file through the lilypond software for you, obtains 
a pdf or postscript file, and includes that as a graphical object.


This lets you typeset pieces of music that is less than a page each, and 
get them into the LyX document. Maybe it is also possible to create 
small examples such as a single chord and include it in the middle of a 
line of text. I haven't actually tried that, but it ought to work.


The way to do this:
1. Create a LyX document and a lilypond file
2. In LyX: Insert-File-External Material
3. In the external material dialog, change template to LilyPond,
   and insert the correct filename.

Your music should now appear when you print the LyX file or export a PDF 
file.


Please let me know if there are problems with this.

Supporting lilypond-book would need a different approach, because the 
processing is different.


Helge Hafting




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
j.asal wrote:
 
 Hi,
 
 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files). I
 know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX to
 'compile' the latex file. Any ideas/suggestions?

btw as a small poll - what version of lilypond you people use?
(see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

pavel


Re: Lilypond integration

2009-03-10 Thread Johannes Asal
I know that you can include Lilypond material by External Material. That's
ok when you have few notation examples in your text and I appreciate that
someone took the time to implement it. But I'm trying to write a book about
jazz harmonics and therefore I need many musical examples that have to be
changed often in the writing process. The main problems I have with the
External Material approach are the following:

1. It interrupts the creative process, because you need to prepare the
lilypond snippets in another editor and import them afterwards
2. You don't have a preview and therefore it is a bit difficult to see
whether you have written something already or not
3. If you have to change one of the snippets, you have to find the
corresponding file

I don't know if it's possible, but the ideal solution (for me) would be some
kind of lilypond environment (somewhat like the math environment), where you
can type in your lilypond code directly. After leaving this environment, the
graphic is rendered and put into place in the LyX document. If you need to
change it, you just click on the graphic and the code environment pops up
again.

This is of course not a simple modification to do, and I guess it wouldn't
be that fun either, but I'm sure it would be a valueable addition to LyX's
feature list because as far as I know there is no solution today that
combines text with music typesetting in a convenient and straightforward
way. I would even volunteer for implementing parts of it if needed.

Johannes Asal

2009/3/10 Helge Hafting helge.haft...@hist.no

 j.asal wrote:

 Hi,

 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files).
 I
 know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX
 to
 'compile' the latex file. Any ideas/suggestions?


 I created what little support there is for lilypond in LyX. Mostly because
 it was easy and interesting to do.  It'd be interesting to know more about
 what kind of lilypond support that actually is useful.

 Currently, LyX can use lilypond files that takes up a page or less. This
 because LyX runs the file through the lilypond software for you, obtains a
 pdf or postscript file, and includes that as a graphical object.

 This lets you typeset pieces of music that is less than a page each, and
 get them into the LyX document. Maybe it is also possible to create small
 examples such as a single chord and include it in the middle of a line of
 text. I haven't actually tried that, but it ought to work.

 The way to do this:
 1. Create a LyX document and a lilypond file
 2. In LyX: Insert-File-External Material
 3. In the external material dialog, change template to LilyPond,
   and insert the correct filename.

 Your music should now appear when you print the LyX file or export a PDF
 file.

 Please let me know if there are problems with this.

 Supporting lilypond-book would need a different approach, because the
 processing is different.

 Helge Hafting





Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Johannes Asal wrote:
 1. It interrupts the creative process, because you need to prepare the
 lilypond snippets in another editor and import them afterwards
 2. You don't have a preview and therefore it is a bit difficult to see
 whether you have written something already or not

you should be able to do this via instant preview.

 3. If you have to change one of the snippets, you have to find the
 corresponding file

you should be able to do this directly via context menu - edit externally.

pavel


Re: Lilypond integration

2009-03-10 Thread Guenter Milde
On 2009-03-10, Pavel Sanda wrote:

 btw as a small poll - what version of lilypond you people use?
 (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

Version: 2.10.33-2.3 (Debian/testing).

BTW: How much work would it be to copy/adapt the lilypond external inset to
an inset for *.abc music files with abcm2ps?

Günter




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Guenter Milde wrote:
 On 2009-03-10, Pavel Sanda wrote:
 
  btw as a small poll - what version of lilypond you people use?
  (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )
 
 Version: 2.10.33-2.3 (Debian/testing).
 
 BTW: How much work would it be to copy/adapt the lilypond external inset to
 an inset for *.abc music files with abcm2ps?

its not time saver to use external inset for this.
it would need some cloning of ert-like insent, adding preview like graphics 
insets do and
maybe some additional tweaks in latex generation in case you can't put lilypond 
code
directly into the .tex file. the basic blocks are already done, but assemling
it into functional inset wont be few-liner either...

pavel


Re: Lilypond integration

2009-03-10 Thread Helge Hafting

j.asal wrote:

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?


I created what little support there is for lilypond in LyX. Mostly 
because it was easy and interesting to do.  It'd be interesting to know 
more about what kind of lilypond support that actually is useful.


Currently, LyX can use lilypond files that takes up a page or less. This 
because LyX runs the file through the lilypond software for you, obtains 
a pdf or postscript file, and includes that as a graphical object.


This lets you typeset pieces of music that is less than a page each, and 
get them into the LyX document. Maybe it is also possible to create 
small examples such as a single chord and include it in the middle of a 
line of text. I haven't actually tried that, but it ought to work.


The way to do this:
1. Create a LyX document and a lilypond file
2. In LyX: "Insert->File->External Material"
3. In the external material dialog, change "template" to LilyPond",
   and insert the correct filename.

Your music should now appear when you print the LyX file or export a PDF 
file.


Please let me know if there are problems with this.

Supporting lilypond-book would need a different approach, because the 
processing is different.


Helge Hafting




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
j.asal wrote:
> 
> Hi,
> 
> I want to write a music theory book with LyX. For musical examples I would
> like to use Lilypond, but there seems to be no support for including and
> displaying Lilypond snippets (apart from importing whole Lilypond files). I
> know that one could use lilypond-book to postprocess files with embedded
> lilypond code, but then you don't have any preview and you can't use LyX to
> 'compile' the latex file. Any ideas/suggestions?

btw as a small poll - what version of lilypond you people use?
(see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

pavel


Re: Lilypond integration

2009-03-10 Thread Johannes Asal
I know that you can include Lilypond material by External Material. That's
ok when you have few notation examples in your text and I appreciate that
someone took the time to implement it. But I'm trying to write a book about
jazz harmonics and therefore I need many musical examples that have to be
changed often in the writing process. The main problems I have with the
External Material approach are the following:

1. It interrupts the creative process, because you need to prepare the
lilypond snippets in another editor and import them afterwards
2. You don't have a preview and therefore it is a bit difficult to see
whether you have written something already or not
3. If you have to change one of the snippets, you have to find the
corresponding file

I don't know if it's possible, but the ideal solution (for me) would be some
kind of lilypond environment (somewhat like the math environment), where you
can type in your lilypond code directly. After leaving this environment, the
graphic is rendered and put into place in the LyX document. If you need to
change it, you just click on the graphic and the code environment pops up
again.

This is of course not a simple modification to do, and I guess it wouldn't
be that fun either, but I'm sure it would be a valueable addition to LyX's
feature list because as far as I know there is no solution today that
combines text with music typesetting in a convenient and straightforward
way. I would even volunteer for implementing parts of it if needed.

Johannes Asal

2009/3/10 Helge Hafting 

> j.asal wrote:
>
>> Hi,
>>
>> I want to write a music theory book with LyX. For musical examples I would
>> like to use Lilypond, but there seems to be no support for including and
>> displaying Lilypond snippets (apart from importing whole Lilypond files).
>> I
>> know that one could use lilypond-book to postprocess files with embedded
>> lilypond code, but then you don't have any preview and you can't use LyX
>> to
>> 'compile' the latex file. Any ideas/suggestions?
>>
>
> I created what little support there is for lilypond in LyX. Mostly because
> it was easy and interesting to do.  It'd be interesting to know more about
> what kind of lilypond support that actually is useful.
>
> Currently, LyX can use lilypond files that takes up a page or less. This
> because LyX runs the file through the lilypond software for you, obtains a
> pdf or postscript file, and includes that as a graphical object.
>
> This lets you typeset pieces of music that is less than a page each, and
> get them into the LyX document. Maybe it is also possible to create small
> examples such as a single chord and include it in the middle of a line of
> text. I haven't actually tried that, but it ought to work.
>
> The way to do this:
> 1. Create a LyX document and a lilypond file
> 2. In LyX: "Insert->File->External Material"
> 3. In the external material dialog, change "template" to LilyPond",
>   and insert the correct filename.
>
> Your music should now appear when you print the LyX file or export a PDF
> file.
>
> Please let me know if there are problems with this.
>
> Supporting lilypond-book would need a different approach, because the
> processing is different.
>
> Helge Hafting
>
>
>


Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Johannes Asal wrote:
> 1. It interrupts the creative process, because you need to prepare the
> lilypond snippets in another editor and import them afterwards
> 2. You don't have a preview and therefore it is a bit difficult to see
> whether you have written something already or not

you should be able to do this via instant preview.

> 3. If you have to change one of the snippets, you have to find the
> corresponding file

you should be able to do this directly via context menu -> edit externally.

pavel


Re: Lilypond integration

2009-03-10 Thread Guenter Milde
On 2009-03-10, Pavel Sanda wrote:

> btw as a small poll - what version of lilypond you people use?
> (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )

Version: 2.10.33-2.3 (Debian/testing).

BTW: How much work would it be to copy/adapt the lilypond external inset to
an inset for *.abc music files with abcm2ps?

Günter




Re: Lilypond integration

2009-03-10 Thread Pavel Sanda
Guenter Milde wrote:
> On 2009-03-10, Pavel Sanda wrote:
> 
> > btw as a small poll - what version of lilypond you people use?
> > (see http://bugzilla.lyx.org/show_bug.cgi?id=5834 )
> 
> Version: 2.10.33-2.3 (Debian/testing).
> 
> BTW: How much work would it be to copy/adapt the lilypond external inset to
> an inset for *.abc music files with abcm2ps?

its not time saver to use external inset for this.
it would need some cloning of ert-like insent, adding preview like graphics 
insets do and
maybe some additional tweaks in latex generation in case you can't put lilypond 
code
directly into the .tex file. the basic blocks are already done, but assemling
it into functional inset wont be few-liner either...

pavel


Lilypond integration

2009-03-09 Thread j.asal

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?

Best regards,
Johannes Asal
-- 
View this message in context: 
http://n2.nabble.com/Lilypond-integration-tp2448492p2448492.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Lilypond integration

2009-03-09 Thread Charles de Miramon
j.asal wrote:

 
 Hi,
 
 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files).
 I know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX
 to 'compile' the latex file. Any ideas/suggestions?
 
 Best regards,
 Johannes Asal

I know nothing about Lilypond but have you looked at the insert-external
object way. There is also a KDE frontend to Lilypond called Frescobaldi
that looks nice from the screenshots.

Cheers,
Charles 
-- 
http://www.kde-france.org



Re: Lilypond integration

2009-03-09 Thread Piero Faustini
Charles de Miramon cmira...@... writes:

 
 j.asal wrote:
 
  
  Hi,
  
  I want to write a music theory book with LyX. For musical examples I would
  like to use Lilypond, but there seems to be no support for including and
  displaying Lilypond snippets (apart from importing whole Lilypond files).
  I know that one could use lilypond-book to postprocess files with embedded
  lilypond code, but then you don't have any preview and you can't use LyX
  to 'compile' the latex file. Any ideas/suggestions?
  
  Best regards,
  Johannes Asal
 
 I know nothing about Lilypond but have you looked at the insert-external
 object way. There is also a KDE frontend to Lilypond called Frescobaldi
 that looks nice from the screenshots.
 
 Cheers,
 Charles 

I understand what are your needs, because almost identical as mine.
I had to discard lilypond-book because it was too difficoult to integrate with 
LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
think it would be difficuolt to have everything work without problems, and 
almost impossible to have a working instant preview of the whole doc.
 It seems that a theory book (as a musicological research on librettoes) 
doesn't need a lot of long music examples, so the advantages of lilypond-book 
(basically: ability to draw music snipetts in different environments) are not 
so important.
This is what I use: I have a directory of musical examples in .ly files, which 
have a simple code that have all the white space cut. (can't find the thread 
where this was discussed, I will post it later).
I use Insert - File - External material - Lilypond file. It can give instant 
preview (and allows direct link to the predefined Lilypond editor, if you find 
some error) so is ALMOST as having the code directly in the LyX doc.
If you need multiple lines examples, this can be hard to achieve if you need 
lines to cross between pages, but I think a solution can be found. Stay tuned.
Hope it was clear

 







Lilypond integration

2009-03-09 Thread j.asal

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?

Best regards,
Johannes Asal
-- 
View this message in context: 
http://n2.nabble.com/Lilypond-integration-tp2448492p2448492.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Lilypond integration

2009-03-09 Thread Charles de Miramon
j.asal wrote:

 
 Hi,
 
 I want to write a music theory book with LyX. For musical examples I would
 like to use Lilypond, but there seems to be no support for including and
 displaying Lilypond snippets (apart from importing whole Lilypond files).
 I know that one could use lilypond-book to postprocess files with embedded
 lilypond code, but then you don't have any preview and you can't use LyX
 to 'compile' the latex file. Any ideas/suggestions?
 
 Best regards,
 Johannes Asal

I know nothing about Lilypond but have you looked at the insert-external
object way. There is also a KDE frontend to Lilypond called Frescobaldi
that looks nice from the screenshots.

Cheers,
Charles 
-- 
http://www.kde-france.org



Re: Lilypond integration

2009-03-09 Thread Piero Faustini
Charles de Miramon cmira...@... writes:

 
 j.asal wrote:
 
  
  Hi,
  
  I want to write a music theory book with LyX. For musical examples I would
  like to use Lilypond, but there seems to be no support for including and
  displaying Lilypond snippets (apart from importing whole Lilypond files).
  I know that one could use lilypond-book to postprocess files with embedded
  lilypond code, but then you don't have any preview and you can't use LyX
  to 'compile' the latex file. Any ideas/suggestions?
  
  Best regards,
  Johannes Asal
 
 I know nothing about Lilypond but have you looked at the insert-external
 object way. There is also a KDE frontend to Lilypond called Frescobaldi
 that looks nice from the screenshots.
 
 Cheers,
 Charles 

I understand what are your needs, because almost identical as mine.
I had to discard lilypond-book because it was too difficoult to integrate with 
LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
think it would be difficuolt to have everything work without problems, and 
almost impossible to have a working instant preview of the whole doc.
 It seems that a theory book (as a musicological research on librettoes) 
doesn't need a lot of long music examples, so the advantages of lilypond-book 
(basically: ability to draw music snipetts in different environments) are not 
so important.
This is what I use: I have a directory of musical examples in .ly files, which 
have a simple code that have all the white space cut. (can't find the thread 
where this was discussed, I will post it later).
I use Insert - File - External material - Lilypond file. It can give instant 
preview (and allows direct link to the predefined Lilypond editor, if you find 
some error) so is ALMOST as having the code directly in the LyX doc.
If you need multiple lines examples, this can be hard to achieve if you need 
lines to cross between pages, but I think a solution can be found. Stay tuned.
Hope it was clear

 







Lilypond integration

2009-03-09 Thread j.asal

Hi,

I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?

Best regards,
Johannes Asal
-- 
View this message in context: 
http://n2.nabble.com/Lilypond-integration-tp2448492p2448492.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: Lilypond integration

2009-03-09 Thread Charles de Miramon
j.asal wrote:

> 
> Hi,
> 
> I want to write a music theory book with LyX. For musical examples I would
> like to use Lilypond, but there seems to be no support for including and
> displaying Lilypond snippets (apart from importing whole Lilypond files).
> I know that one could use lilypond-book to postprocess files with embedded
> lilypond code, but then you don't have any preview and you can't use LyX
> to 'compile' the latex file. Any ideas/suggestions?
> 
> Best regards,
> Johannes Asal

I know nothing about Lilypond but have you looked at the insert->external
object way. There is also a KDE frontend to Lilypond called Frescobaldi
that looks nice from the screenshots.

Cheers,
Charles 
-- 
http://www.kde-france.org



Re: Lilypond integration

2009-03-09 Thread Piero Faustini
Charles de Miramon  writes:

> 
> j.asal wrote:
> 
> > 
> > Hi,
> > 
> > I want to write a music theory book with LyX. For musical examples I would
> > like to use Lilypond, but there seems to be no support for including and
> > displaying Lilypond snippets (apart from importing whole Lilypond files).
> > I know that one could use lilypond-book to postprocess files with embedded
> > lilypond code, but then you don't have any preview and you can't use LyX
> > to 'compile' the latex file. Any ideas/suggestions?
> > 
> > Best regards,
> > Johannes Asal
> 
> I know nothing about Lilypond but have you looked at the insert->external
> object way. There is also a KDE frontend to Lilypond called Frescobaldi
> that looks nice from the screenshots.
> 
> Cheers,
> Charles 

I understand what are your needs, because almost identical as mine.
I had to discard lilypond-book because it was too difficoult to integrate with 
LyX. I must admit I didn't try too much: but I use a lot of multiple-pass 
packages such BibLaTeX (a sort of enhanced bibTeX), indexes and so on, so I 
think it would be difficuolt to have everything work without problems, and 
almost impossible to have a working instant preview of the whole doc.
 It seems that a theory book (as a musicological research on librettoes) 
doesn't need a lot of long music examples, so the advantages of lilypond-book 
(basically: ability to draw music snipetts in different environments) are not 
so important.
This is what I use: I have a directory of musical examples in .ly files, which 
have a simple code that have all the white space cut. (can't find the thread 
where this was discussed, I will post it later).
I use Insert - File - External material - Lilypond file. It can give instant 
preview (and allows direct link to the predefined Lilypond editor, if you find 
some error) so is ALMOST as having the code directly in the LyX doc.
If you need multiple lines examples, this can be hard to achieve if you need 
lines to cross between pages, but I think a solution can be found. Stay tuned.
Hope it was clear