denemo-devel
[Top][All Lists]

## Re: [Denemo-devel] Import LilyPond

 From: Richard Shann Subject: Re: [Denemo-devel] Import LilyPond Date: Sun, 06 Jul 2008 23:14:03 +0100

On Sun, 2008-07-06 at 23:16 +1000, Roy Rankin wrote:
> I had Denemo able to write Lilypond files, at least for the features I
> use, and read them back in at the beginning of the year. Without this
> capability Denemo does not suit my needs and is of no use to me.
Well, the lilypond parser can still be invoked from the File->Open menu
and could certainly be tweaked to match the new LilyPond output.
The output is, of course, extremely regular, and you do not have to
support multiple score blocks and the like which Denemo can generate -
you can continue to work with single movement pieces.

However, I think I can convince you that the way Denemo is developing
will suit your needs better than ever. After all, there were many things
you could not type into the LilyPond and load in to Denemo and expect to
survive when you printed out again. Comments, for a start.

At the moment the LilyPond text window does not have a set of vi edit
commands defined for it, but I'm sure it soon will.
But as it stands you can pretty much edit the file as a text file and it
automatically syncs back to Denemo. There are less important things
still missing - you can't change the note name in the text, but you can
put the cursor on it, and you will find the cursor on that note in the
Denemo window, where you can edit it Denemo style. All this can be
fixed. Then you will have a vi-style text editor for the LilyPond which
will never be unreadable to Denemo, something you could never achieve
once you lose track of the relationship between the text and the denemo
objects.

>
> Let me explain. I use Denemo to create a Lilypond file with the musical
> notes and basic structures which I then hand edit with vi to achieve my
> final file.  In this process sometimes (fairly often really) I create
> something slightly wrong in Denemo. I have found fixing these problems
> is very easy in a Lilypond file, but very difficult to fix in Denemo.
I am sure you could now fix them in the LilyPond text window - set me a
challenging example!
> Thus I save the Demeno work in Lilypond format, fix the problem, read
> the file back into Denemo to continue entering the notes.
>
> Once I have finished in Denemo, I can then use convert-ly if the version
>   of Lilypond I am currently using is newer than the version Denemo
> produces.
Denemo now runs convert-ly for you.
>
> When I have worked on getting Lilypond file read/write working for my
> usage, I concluded Denemo did not have the data structures or in some
> cases compatible data structures to hold many of the features used by
> Lilypond.
Right - it is now able to quote a cue in one part taken from another
part, which is done without adding any Denemo structures, but purely by
adding fragments of LilyPond between the Denemo notes concerned. If you
never have been able to parse it back in to Denemo. Now Denemo is
unwittingly storing these fragments of LilyPond between its notes, and
is even able to display them albeit very crudely as yet.
> Thus Denemo would never, save very major rewrite, be able to
> read general Lilypond files and write them back out without losing
> information.
Absolutely, which is why I have to keep the text editing under Denemo's
control, so that Denemo always knows where its notes, staffs etc have
gone.
> And of course as already been mentioned, Lilypond is a
> moving target (which I consider a major weakness of the program).
As I say, Denemo now runs convert.ly
Please, if I have not already convinced you, post up some examples of
things you would like to do, editing in LilyPond and returning to
Denemo, and I will see how far from Notation Nirvana we are.
Richard

>
> Regards,
> Roy Rankin
>
>
> Richard Shann wrote:
> > On Wed, 2008-07-02 at 15:29 -0500, Jeremiah Benham wrote:
> >> On Wed, 2008-07-02 at 17:52 +0100, Richard Shann wrote:
> >>> On Wed, 2008-07-02 at 09:11 +0100, Richard Shann wrote:
> >>>> Are there any LilyPond files that can be imported at present? I would
> >>>> guess not. If not we should make sure Denemo does not offer to do it.
> >>> I've fixed this so that Denemo does not offer this format - you can
> >>> still try, though.
> >> This is disappointing. It was working a few releases back.  I didn't
> >> write the code
> > I did. Originally that is. But then I had a few years away while I
> > switched careers and I only have an outline knowledge of what I did with
> > it. (It was creating a tree representing the LilyPond file with links to
> > the DenemoObjects in a DenemoScore. Each time you edited in Denemo the
> > corresponding bit of the LilyPond file (tree) was updated. Denemo was
> > getting released so slowly and LilyPond so quickly that it never stood a
> > chance.)
> > What happened to it since I'm not so sure, I think it critically depends
> > on the LilyPond output generated by Denemo - everytime that changes you
> > would need to find the bits in the parser and fix them.
> >  In principle you ought to be able to locate bits of music in a LilyPond
> > file and dump them on to Denemo staffs, but it would be difficult to do
> > this. I guess it was only handling untouched Denemo output. But
> > untouched Denemo output is the one thing you don't need it for - you
> > already have the Denemo format.
> > I think it might be more useful to be able to cut and paste the *notes*
> > from an arbitrary LilyPond file to a Denemo staff. This is because the
> > bulk of a LilyPond file is music notes, and these can be translated into
> > Denemo notes fairly easily (just by starting the parser at Music rather
> > than at the top). So you would be able to take something like
> >
> > a8 b c'4 \times 2/3 {e8 f g} dis <<ees c-2>>...... fis'' gis'' \bar ":|"
> >
> > select it and hit paste-lilypond and it would parse the text selection
> > inserting the notes at the current object (and putting LilyPond
> > directives for the "\times 2/3 {", "-2" \bar ":|" and "}" bits, which
> > are just unknown text to the parser). This would then become editable
> > Denemo music, which would print correctly in LilyPond.
> > In this way you could take some LilyPond file and get the bulk typing
> > into Denemo without trying to parse the (infinite) variety of \context
> > \paper \book \etc. etc. things into corresponding Denemo structures, if
> > any. Once you had done that you could edit the music using Denemo,
> > instead of textually. (E.g. you could add an accompaniment, while seeing
> > the notes that the accompaniment was for on the DenemoStaff above).
> > But I won't be able to get to this for a while :-(
> > Richard
> >
> >
> >
> >
> >
> > _______________________________________________
> > Denemo-devel mailing list