On Tue, 30 Oct 2001, Joerg Anders wrote:
> First of all: I'm interested in all improvements. BTW: Some users
> wrote me whether I could implement a closer association between
> Noteedit and the TeX tools to achieve a more useable printing procedure.
It would be great for LyX if NoteEdit could export all the way to TeX that
could be included in any LaTeX document. But see below to understand why.
> (An unwanted side effect is: A closer association would hide the fact
> that the beautiful music sheets are a (La)TeX result not a Noteedit result.)
>
> The problem is: I'm not a LyX user and so I didn't comprehend all
> exactly.
Ok, allow me to explain in more detail:
1. The user creates a LyX document in LyX.
2. He choose Insert->External material, and then Music sheet.
3. Then a dialog appears where the user should choose what filename
to give the music sheet. Let's call this music.not
4. In the LyX document, a button appears with the name of the file.
5. If the user clicks on this document, LyX will invoke NoteEdit with
execvp, which basically amounts to this call:
system("noteedit music.not &")
Now, the user will see the NoteEdit window, and be allowed to
edit his music. At the same time, LyX is still open, and ready
for input.
6. When the user is satisfied with his music, he will save in NoteEdit,
and exit it. LyX does not do anything at this point.
7. Now, if the user wants to preview or print his LyX document, LyX
has to produce a LaTeX document. Inside this LaTeX document, we have
to embed some LaTeX for the music sheet. In order to get this,
we have to convert the music.not file to Lilypond. For instance,
it could look like this:
noteedit --export-lilypond music.not
This would start noteedit, preferably without a window, and
noteedit would export the music.not file to music.ly and immediately
exit.
Now, LyX will invoke lilypond with a magical command line to convert
the music.ly file to TeX format, music.tex.
Finally, LyX will embed the contents of this file in the produced
LaTeX file.
So: When the user edits a NoteEdit file, he will be using the completely
normal NoteEdit application.
When the LaTeX is produced, LyX will invoke noteedit just for the sole
purpose of converting the .not file to a .ly file.
So, at no point does NoteEdit and LyX have to share any internal data
structures. All of the information is kept in files, and we only
interface through the execvp-family of calls.
NoteEdit is not embedded in LyX. It is started as a stand-alone
application.
So the changes required to NoteEdit should be minimal: Just add support
for the --export-lilypond command line parameter.
Obviosuly, if we could convert from NoteEdit format directly to
a suitable LaTeX chunk, that would be ideal as well, because then
we would not rely on Lilypond. I'm a music sheet typesetting
ignorant, and don't know if MusicTeX is as good as Lilypond.
>From my limited reading on the internet, I just understood that
Lilypond looked better than MusicTeX, but maybe I have misunderstood
something.
Basically, what we need is some way of converting a NoteEdit .not file
to a piece of LaTeX that is suitable for direct insertion into the body
of a LaTeX document. We want the most beautiful result, but other than
that, we do not care if Lilypond is used or not. Also, it's no problem
if we have to invoke Lilypond ourselves, or not.
Is it more clear now?
Greets,
Asger Alstrup