[PlanetCCRMA] denemo

Aaron aamehl@bezeqint.net
Mon Dec 8 11:35:02 2003


--=-uVpUuHvBEHw9L5A6zHnk
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

same version but needs to be compiled with 
./configure --enable-gtk2
see the attached readme.
I am pretty sure that it is only in CVS.
which needs libtoolize before autogen.

Aaron


On Mon, 2003-12-08 at 21:05, Fernando Pablo Lopez-Lezcano wrote:
> > hm regular old denemo is nowhere as good as the lilypond version.
> > Any hope of getting it upgraded to that version>
> 
> Ahem, which version? The only version I see in the site is 0.7.1. Is
> there another? URL?
> 
> -- Fernando
> 
> > > > I noticed that denemo is on the planet, I assume it is built from cvs,
> > > 
> > > Nope, it is the last "official" release (a tarball available from the
> > > denemo download area in sf.net. 
> > > 
> > > > but somehow not with the ./configure --enable-gtk2 this enables the mode
> > > > for editing lilypond files. Which is a text editor wired to the denemo gui.
> > > 
> > > The configure process is detecting gtk automatically (plain gtk) and the
> > > executable is linked against gtk...
> 
> 

--=-uVpUuHvBEHw9L5A6zHnk
Content-Disposition: attachment; filename=README.lilypond
Content-Type: text/x-readme; name=README.lilypond; charset=
Content-Transfer-Encoding: 7bit

Using denemo to edit Lilypond files.

With this version of denemo comes the ability to edit lilypond files. Previously, denemo generated lilypond output, but could only read its own specialized version of lilypond. Any further tweaking done to the lilypond text tended to make the file unreadable for denemo, so that further editing had to be done by hand. 
In this version when you load a lilypond format file the file is broken up into chunks, which are displayed as text in a specialized text editor which pops up as a new top level window. This text window has a button to take you to the top level of the text where  you can edit the top level information in the file, such as the title, composer tagline etc. Interspersed in this top level text is music data - you can step around at the top level using the previous and next buttons. Anything you type here will be saved when you save your work.
The music data is what is being displayed in the normal denemo graphical window. When you edit graphically the lilypond text corresponding to the current note is shown in the text window. You select between these two windows with the toggle window button. You can move about in the lilypond text for the current measure using the previous and next buttons. You can edit the notes textually here, but the changes are not automatically reflected in the graphical window - you have to hit reload for that.

One of the things you will notice is that when you have the lily text loaded, the cursor steps on items, such as the initial key signature setting, barlines etc. So if some directive is placed between two notes then the cursor will step on to it, allowing you the option of editing in the text window. The text of the measure is split up into chunks, one for each note, directive etc in the measure. At any stage you can click the reload button. This saves to a temporary file and the reads back in. If you have introduced some lilypond syntax errors then you are offered the chance to re-edit the file and reload. If you have the environment variable set (eg to emacs or vi) then that editor is started with the line number where the problem occurred.
Having the top level text available means you can edit voices separately or put them temporarily onto separate staves, all without quitting the program - the technique is called "commenting out" and I illustrate this in the example below.
The normal way to use denemo to write a lilypond file is to start with a template (though it could be some previous, similar piece). 
The simplest thing you can have is
\score { \notes { c'' }}
which gives you a score with one staff with a single note, middle c. This is only useful for
the simplest of purposes.
A more extensible example is the file in examples/simple.ly 
Clef = \clef treble
Key =  \notes \key c \major
TimeSig = \notes \time 4/4
MyViolin = \context Voice = MyVln \notes  { \Clef \Key \TimeSig c''4 }
MyViolinStaff = \context Staff = MyStaff <
\MyViolin
>
\score {
    \MyViolinStaff
    \paper {}
}

The names starting My... are just any made up names you like. In this case MyVln is the name of the voice while MyViolin is the name of the music that has been given to that voice. The music found in the score block at the end is what denemo displays. You can load up this file, edit the Key and TimeSig definitions, hit reload and start putting in notes denemo style, saving to a file of your choice at the end.Another template examples/header.ly gives you access to all the titling features of lilypond and so on.One of the benefits of editing lilypond is better handling of voices. The examples/twovoices.ly file shows how two voices can be put on one stave. It looks like this:

Key =  \notes \key c \minor
TimeSig = \notes \time 3/4

ViolinI = \context Voice = VlnI \notes  { \Key \TimeSig c''4 d'' e'' }
ViolinII = \context Voice = VlnII \notes  { \Key  \TimeSig a''4 b'' c'' }

Violini = \context Staff = Vlns <
\ViolinI
\ViolinII
>

\score {
    \Violini
    \paper {}
}

However, denemo doesn't give an easy way of editing the second voice. One way you can do this is to "comment out" the first voice by putting a % sign at the start of the line that puts it on the staff, thus
Violini = \context Staff = Vlns <
%\ViolinI
\ViolinII
>

when you reload, the first voice is temporarily hidden. However you only see one voice at a time this way. A bolder way is shown in examples/editTwovoices.ly where a temporary staff is created with the same second violin part as appears in the real staff. Now you can edit either voice and see them both on the top staff. When finished you comment out the extra staff thus
\score {
<
    \Violini
%    \tempStaff
>
    \paper {}
}

and you are ready to print. I should say that denemo was not written expecting the same music in two staffs, so there may be bugs lurking for the adventurous.

A third way is to create a new score block in the file with just the voice you wish to edit - under the Navigate menu is the option to cycle through the score blocks in the file. If the score block has no \paper block then it will not print out and can just be used for editing.
These multiple score blocks are how you include several movements of a piece in a single file - you can then print them all at once getting the page numbering correct.

CAVEATs

This version of denemo for lilypond editing is just a proof-of-concept exercise really. Before fleshing out the (large) parser with actions for all the rules that lilypond has I wanted to see that this would work. There is a lot of lilypond which this version will not read; note especially that include files are not opened, and only the default Dutch note names are understood and the \relative type of notes are not handled, nor lyrics,etc etc.
On the plus side, there is the full set of dynamics (denemo had only a subset), tuplets fancy \bars, \partial, \grace, \repeat volta 2, \alternative and much more. Some bugs: the ties do not show in denemo when read back in - this is a bit structural and needs a design decision to fix - and if you edit the duration of the last note in a measure the first note of the next measure may need to have its duration set. The handling of the barline '|' is not nice - again we should decide where we are going with this sort of thing. And watch out for deleting the key signature etc if you delete the first measure - on reload you will have to add them back in. Also beware that this version leaks memory - Adam's Brandeburg score gobbles up 2% of my RAM everytime I hit reload.
Several of the denemo menu items are redundant when you have a lily file loaded - for example you set headers just by typing in the text (see examples/headers.ly for a complete set of possibilities) - these menus just refuse to respond - they should be hidden really.
The lilypond editing stuff is only enabled when you build with gtk version 2 ie
./configure --enable-gtk2
it could all be done in gtk 1.0 no doubt, but I hope people will have moved on before we get round to it.

--=-uVpUuHvBEHw9L5A6zHnk--