Generated by hanwen@cs.uu.nl,
From = lilypond-1.5.14, To = lilypond-1.5.15

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.5.15.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure

diff -purN ../lilypond-1.5.14/CHANGES ./CHANGES
--- ../lilypond-1.5.14/CHANGES	Sat Sep 29 13:09:44 2001
+++ ./CHANGES	Fri Oct  5 18:02:16 2001
@@ -1,3 +1,45 @@
+1.5.14.jcn6
+===========
+
+* Some more random hacking at midi2ly.py.
+
+* Slightly better doco for r, s and \skip, with examples.
+
+* Bugfixes: add-html-footer.py and @MAILADDRESS@.
+
+* Some website related fixes (thanks Tiggr).
+ 
+* Ugly hack in add-html-footer for disabling tutorial and refman links
+in sidebar.
+
+* Guile > 1.4 compilation fixes.
+
+* Website bugfix: mailto: (thanks David Boersma).
+
+1.5.14.hwn1
+===========
+
+* Rename: Local_key_engraver to Accidental_engraver
+
+* Add documentation for accidentals grob property.
+
+* Don't make double accidentals even if two of the same notes are
+specified. (Thanks Rune)
+
+* Search all staff-bars for non-empty barline to determine type. This
+fixes span-bars with the lowest staff hara-kiried. (Thanks Rune)
+
+
+1.5.14.rz1
+==========
+
+* Less buggy beam-split
+
+* Added subdivideBeams, subdividing beams on beats
+
+1.5.14
+======
+
 1.5.13.hwn2
 ===========
 
diff -purN ../lilypond-1.5.14/Documentation/footer.html.in ./Documentation/footer.html.in
--- ../lilypond-1.5.14/Documentation/footer.html.in	Thu Aug 23 15:39:08 2001
+++ ./Documentation/footer.html.in	Sun Sep 30 18:19:57 2001
@@ -24,7 +24,7 @@ Please send GNU LilyPond questions and c
 <p>
 
 Please send comments on these web pages to 
-<a href="mailto:@MAIL_ADDRESS@"><em>@MAIL_ADDRESS@</em></a>
+<a href="mailto:@MAILADDRESS@"><em>@MAILADDRESS@</em></a>
 
 <p>
 
diff -purN ../lilypond-1.5.14/Documentation/user/refman.itely ./Documentation/user/refman.itely
--- ../lilypond-1.5.14/Documentation/user/refman.itely	Mon Sep 24 11:54:37 2001
+++ ./Documentation/user/refman.itely	Thu Oct  4 21:46:59 2001
@@ -5,6 +5,8 @@
 @c     M-x texinfo-all-menus-update
 @c to automagically fill in these menus before saving changes
 
+@c FIXME: singular vs. plural:  Beams/Beam
+
 
 @macro refbugs
 @strong{BUGS}
@@ -103,6 +105,7 @@ These threemanship of tasks (parsing, tr
 data-structures (music, context, graphical objects) permeates the entire
 design of the program.
 
+@c FIXME: Note entry vs Music entry at top level menu is confusing.
 @c . {Note entry}
 @node Note entry
 @section Note entry
@@ -118,7 +121,7 @@ brevity we omit obligatory lint such as 
 * Notes::                       
 * Pitches::                     
 * Rests::                       
-* Skips::                       
+* Skips::
 * Durations::                   
 * Ties::                        
 * Tuplets::                     
@@ -220,26 +223,57 @@ octave; each @code{,} lowers the pitch b
 @subsection Rests
 @cindex Rests
 
-Rests are entered like notes, with note name `@code{r}'. The grob is
-@code{Rest}. Whole bar rests centered in the bar are specified using
-@code{R}, see @ref{Multi measure rests}.
+A rest is entered like a note, with note name `@code{r}':
+
+@lilypond[singleline,verbatim]
+r1 r2 r4 r8
+@end lilypond
+
+The grob is @code{Rest}. Whole bar rests centered in the bar are
+specified using @code{R}, see @ref{Multi measure rests}.
 
 
 @c .  {Skips}
+@c FIXME: naming.
 @node Skips
 @subsection Skips
 @cindex Skip
+@cindex Invisible rest
+@cindex Space note
 
+An invisible rest, or skip, can be entered like a note with note name
+`@code{s}':
+
+@lilypond[singleline,verbatim]
+a2 s4 a4 s1 a4
+@end lilypond
+
+Actually, this is a shorthand for the @code{\skip} command, and it is
+only available in Note mode and Chord mode.
+
+@c FIXME: in lyrics mode, we have " " and _
+
+In Lyrics mode, you can use `@code{" "}' and `@code{_}':
+@lilypond[singleline,verbatim]
+<
+  \context Lyrics \lyrics { lah2 di4 " " dah2 _4 di }
+  \notes\relative c'' { a2 a4 a a2 a4 a }
+>
+@end lilypond
+
+The unabbreviated `@code{\skip} @var{duration}' also works outside of
+note mode:
+
+@lilypond[singleline,verbatim]
+\score {
+  \context Staff <
+    { \time 4/8 \skip 2 \time 4/4 } 
+    \notes\relative c'' { a2 a1 }
+  >
+}
+@end lilypond
 
-@example
-  \skip @var{duration} 
-  s@var{duration}
-@end example
-@cindex @code{\skip}
 
-Skips the amount of time specified by @var{duration}.  If no other music
-is played, a gap will be left for the skipped time without any notes
-printed.  The shorthand is only available in Note and Chord mode.
 
 @c .  {Durations}
 @node Durations
@@ -460,8 +494,8 @@ Hal-Leonard Inc.  music publishers.
 @lilypond[singleline,verbatim]
 \include "paper23.ly"
 \score {
-        \notes { c'2 e'4 f' | g'1 }
-        \paper { \translator { \EasyNotation } } 
+  \notes { c'2 e'4 f' | g'1 }
+  \paper { \translator { \EasyNotation } } 
 }
 @end lilypond
 
@@ -3758,7 +3792,7 @@ number.
 
 
 
-
+@c FIXME: Note entry vs Music entry at top level menu is confusing.
 @c . {Music entry}
 @node Music entry
 @section Music entry
diff -purN ../lilypond-1.5.14/VERSION ./VERSION
--- ../lilypond-1.5.14/VERSION	Sat Sep 29 13:09:57 2001
+++ ./VERSION	Fri Oct  5 19:51:30 2001
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=14
+PATCH_LEVEL=15
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff -purN ../lilypond-1.5.14/buildscripts/mutopia-index.py ./buildscripts/mutopia-index.py
--- ../lilypond-1.5.14/buildscripts/mutopia-index.py	Thu May 17 11:37:54 2001
+++ ./buildscripts/mutopia-index.py	Wed Oct  3 19:44:49 2001
@@ -152,7 +152,11 @@ def gen_list(inputs, filename):
 			if file_exist_b(filename):
 				l.write ('<li><a href="%s">%s</a>' % (filename, desc))
 				size=os.stat(filename)[stat.ST_SIZE]
-				l.write (' (%s %dk)' % (type, (size + 512) / 1024))
+				kB=(size + 512) / 1024
+				if kB:
+					l.write (' (%s %dkB)' % (type, kB))
+				else:
+					l.write (' (%s %dcharacters)' % (type, size))
 				pictures = ['jpeg', 'png', 'xpm']
 				l.write ('\n')
 
diff -purN ../lilypond-1.5.14/input/bugs/beam-space.ly ./input/bugs/beam-space.ly
--- ../lilypond-1.5.14/input/bugs/beam-space.ly	Thu Jan  1 01:00:00 1970
+++ ./input/bugs/beam-space.ly	Wed Oct  3 17:09:15 2001
@@ -0,0 +1,23 @@
+
+
+u = { \translator Staff = up \stemDown }
+m = { \translator Staff = mid \stemUp }
+
+global = \notes { \key fis \major \time 6/8 }
+
+righta = \notes \transpose c'' {
+ \repeat unfold 4 { \m [a,16 \u d a d] \m [c \u d c' d ] [c \m b,] [d \u d ] } ]
+}
+
+
+\score { \notes
+  \context PianoStaff <
+    \context Staff = up {
+      \clef G \global \righta
+    }
+    \context Staff = mid {
+      \clef F \global s2. *4
+    }
+  >
+  \paper { }
+}
diff -purN ../lilypond-1.5.14/input/bugs/harakiri-autoknee.ly ./input/bugs/harakiri-autoknee.ly
--- ../lilypond-1.5.14/input/bugs/harakiri-autoknee.ly	Thu Jan  1 01:00:00 1970
+++ ./input/bugs/harakiri-autoknee.ly	Wed Oct  3 16:53:29 2001
@@ -0,0 +1,17 @@
+
+
+\score { \notes \transpose c'''
+ \context PianoStaff <
+   \context Staff = up { c4 c c c \break c c c c }
+   \context Staff = mid { c4 c c c \break s1  }
+   \context Staff = down { c8 \translator Staff=mid c \translator
+Staff=down c c c4 c c c c c }
+ >
+ \paper {
+  \translator {
+   \HaraKiriStaffContext
+%   Beam \revert #'auto-knee-gap 
+  }
+ }
+}
+
diff -purN ../lilypond-1.5.14/input/regression/accidental-double.ly ./input/regression/accidental-double.ly
--- ../lilypond-1.5.14/input/regression/accidental-double.ly	Thu Jan  1 01:00:00 1970
+++ ./input/regression/accidental-double.ly	Thu Oct  4 00:27:40 2001
@@ -0,0 +1,15 @@
+\header {
+	texidoc = "If two forced accidentals happen at the same time, only one
+	sharp sign is printed."
+}
+
+
+\score { \notes \transpose c''
+   \context Staff <
+     \key g \major
+     \context Voice=va { \stemUp c' fis! }
+     \context Voice=vb { \stemDown c fis! }
+   >
+}
+
+
diff -purN ../lilypond-1.5.14/input/regression/accidental.ly ./input/regression/accidental.ly
--- ../lilypond-1.5.14/input/regression/accidental.ly	Thu Apr  5 00:02:37 2001
+++ ./input/regression/accidental.ly	Thu Oct  4 00:27:40 2001
@@ -7,10 +7,9 @@ fourth show forced and courtesy accident
 "
 }
 
-foo = \notes\relative c''   {   \key as \major dis4 dis dis! dis? }
+foo = \notes\relative c''   {   \key as \major dis4 dis dis!^"force" dis? }
 
 \score {
-
   < \foo 
    \context NoteNames \foo
   >
diff -purN ../lilypond-1.5.14/input/test/add-staccato.ly ./input/test/add-staccato.ly
--- ../lilypond-1.5.14/input/test/add-staccato.ly	Thu Jan  1 01:00:00 1970
+++ ./input/test/add-staccato.ly	Thu Oct  4 21:46:59 2001
@@ -0,0 +1,39 @@
+\header {
+
+texidoc= "Using make-music, you can add various stuff to notes. Here
+is an example how to add staccato dots.  Note: for this simple case
+one would not use scm constructs.  See separate-staccato.ly first."
+
+} 
+
+#(define (make-script x)
+  (let ((m (ly-make-music "Articulation_req")))
+     ;;(ly-set-mus-property m 'articulation-type 'staccato)
+     ;; urg
+     (ly-set-mus-property m 'articulation-type x)
+     (ly-set-mus-property m 'script x)
+     m))
+     
+#(define (add-script m x)
+  (if (equal? (ly-music-name m) "Request_chord")
+      (ly-set-mus-property m 'elements
+			   (cons (make-script x)
+				 (ly-get-mus-property m 'elements)))
+      
+      (let ((es (ly-get-mus-property m 'elements))
+	    (e (ly-get-mus-property m 'element)) )
+	(map (lambda (y) (add-script y x)) es)
+	(if (music? e)
+	    (add-script e x))))
+  m)
+
+#(define (add-staccato m)
+   (add-script m "staccato"))
+
+\score {
+  \notes\relative c'' {
+    a b \apply #add-staccato { c c } 
+    a b \apply #add-staccato { c c } 
+  }
+}
+
diff -purN ../lilypond-1.5.14/input/test/add-text-script.ly ./input/test/add-text-script.ly
--- ../lilypond-1.5.14/input/test/add-text-script.ly	Thu Apr  5 00:02:39 2001
+++ ./input/test/add-text-script.ly	Wed Oct  3 19:44:49 2001
@@ -8,29 +8,26 @@ In general, first do a display of the mu
 create, then write a function that will build the structure for you."
 } 
 
-#(define (make-script x) 
-     (let* (  (m (ly-make-music "Text_script_req"))
-     )
-     
+#(define (make-text-script x) 
+   (let ((m (ly-make-music "Text_script_req")))
      (ly-set-mus-property m 'text-type 'finger)
      (ly-set-mus-property m 'text x)
-     m
-     ))
+     m))
      
-#(define (add-script m x)
-  (if (equal? (ly-music-name m) "Request_chord")
-    (ly-set-mus-property m 'elements
-      (cons (make-script x) (ly-get-mus-property m 'elements)))
-
-    (let* ( (es (ly-get-mus-property m 'elements))
-            (e (ly-get-mus-property m 'element)) )
-     (map (lambda (y) (add-script y x)) es)
-     (if (music? e)
-       (add-script e x))
-    )
-  )
-  m
-)
+#(define (add-text-script m x)
+   (if (equal? (ly-music-name m) "Request_chord")
+       (ly-set-mus-property m 'elements
+			    (cons (make-text-script x)
+				  (ly-get-mus-property m 'elements)))
+       
+       (let ((es (ly-get-mus-property m 'elements))
+	     (e (ly-get-mus-property m 'element)) )
+	 (map (lambda (y) (add-text-script y x)) es)
+	 (if (music? e)
+	     (add-text-script e x))))
+   m)
 
-\score {  \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 } }
+\score {
+  \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 }
+}
 
diff -purN ../lilypond-1.5.14/input/test/blank.ly ./input/test/blank.ly
--- ../lilypond-1.5.14/input/test/blank.ly	Thu Jan  1 01:00:00 1970
+++ ./input/test/blank.ly	Wed Oct  3 01:30:17 2001
@@ -0,0 +1,19 @@
+\header {
+  texidoc="Blank music paper with clefs"
+}
+\score {
+  \notes {
+    % \clef violin
+    \clef bass 
+    \repeat unfold 9 { c1 \break }
+  }
+  \paper {
+    \translator {
+      \ScoreContext
+      TimeSignature \override #'transparent = ##t
+      NoteHead \override #'transparent = ##t
+      defaultBarType = #""
+      \remove Bar_number_engraver
+    }
+  }
+}
diff -purN ../lilypond-1.5.14/input/test/separate-staccato.ly ./input/test/separate-staccato.ly
--- ../lilypond-1.5.14/input/test/separate-staccato.ly	Thu Jan  1 01:00:00 1970
+++ ./input/test/separate-staccato.ly	Thu Oct  4 21:46:59 2001
@@ -0,0 +1,17 @@
+\header {
+
+texidoc="You can enter notes and articulations separately, and merge
+them into one thread.  Here is an example to add repeated staccato dots."
+
+} 
+
+staccatos = \notes { s4-. s-. s-. s s }
+
+music = \notes\relative c' { c4 d e f g  a b c d e }
+
+\score {
+   \context Thread=one <
+     \music
+     \repeat unfold 2 \staccatos
+   >
+}
diff -purN ../lilypond-1.5.14/lily/accidental-engraver.cc ./lily/accidental-engraver.cc
--- ../lilypond-1.5.14/lily/accidental-engraver.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/accidental-engraver.cc	Thu Oct  4 00:27:40 2001
@@ -0,0 +1,297 @@
+/*
+  local-key-engraver.cc -- implement accidental_engraver
+
+  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "musical-request.hh"
+#include "command-request.hh"
+#include "local-key-item.hh"
+#include "item.hh"
+#include "tie.hh"
+#include "rhythmic-head.hh"
+#include "timing-translator.hh"
+#include "engraver-group-engraver.hh"
+
+#include "staff-symbol-referencer.hh"
+#include "side-position-interface.hh"
+#include "engraver.hh"
+#include "arpeggio.hh"
+
+/**
+
+
+   FIXME: should not compute vertical positioning of accidentals, but
+   get them from the noteheads
+
+   The algorithm for accidentals should be documented, and made
+   tweakable.
+
+*/
+
+
+struct Accidental_engraver : Engraver {
+  Item *key_item_p_;
+protected:
+  TRANSLATOR_DECLARATIONS(Accidental_engraver);
+  virtual void process_music ();
+  virtual void acknowledge_grob (Grob_info);
+  virtual void stop_translation_timestep ();
+  virtual void initialize ();
+  virtual void create_grobs ();
+  virtual void finalize ();
+public:
+
+  // todo -> property
+  SCM last_keysig_;
+
+  /*
+    Urgh. Since the accidentals depend on lots of variables, we have to
+    store all information before we can really create the accidentals.
+   */
+  Link_array<Grob> arpeggios_;
+  
+  Link_array<Note_req> mel_l_arr_;
+  Link_array<Grob> support_l_arr_;
+  Link_array<Item> forced_l_arr_;
+  Link_array<Grob> tie_l_arr_;
+
+};
+
+Accidental_engraver::Accidental_engraver ()
+{
+  key_item_p_ =0;
+  last_keysig_ = SCM_EOL;
+}
+
+void
+Accidental_engraver::initialize ()
+{
+  last_keysig_ = get_property ("keySignature");
+  daddy_trans_l_->set_property ("localKeySignature",  last_keysig_);  
+}
+
+void
+Accidental_engraver::create_grobs ()
+{
+  if (!key_item_p_ && mel_l_arr_.size ()) 
+    {
+      SCM localsig = get_property ("localKeySignature");
+  
+      for (int i=0; i  < mel_l_arr_.size (); i++) 
+	{
+	  Grob * support_l = support_l_arr_[i];
+	  Note_req * note_l = mel_l_arr_[i];
+
+	  int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
+	  int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
+	  int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
+	  
+	  /* see if there's a tie that "changes" the accidental */
+	  /* works because if there's a tie, the note to the left
+	     is of the same pitch as the actual note */
+
+	  SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), localsig);
+	  if (prev == SCM_BOOL_F)
+	    prev = scm_assoc (gh_int2scm (n), localsig);
+	  SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : ly_cdr (prev);
+	  bool different = !gh_equal_p (prev_acc , gh_int2scm (a));
+	  int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
+
+	  Grob *tie_break_reminder = 0;
+	  bool tie_changes = false;
+	  for (int i=0; i < tie_l_arr_.size (); i++)
+	    if (support_l == Tie::head (tie_l_arr_[i], RIGHT))
+	      {
+		tie_changes = different;
+		/* Enable accidentals for broken tie
+
+		   We only want an accidental on a broken tie,
+		   if the tie changes the accidental.
+		   
+		   Maybe check property noTieBreakForceAccidental? */
+		if (different)
+		  tie_break_reminder = tie_l_arr_[i];
+		break;
+	      }
+
+	  /* When do we want accidentals:
+
+	     1. when property force-accidental is set, and not
+	     tie_changes
+	     2. when different and not tie-changes
+	     3. maybe when at end of a tie: we must later see if
+	     we're after a line break */
+	  if (( (to_boolean (note_l->get_mus_property ("force-accidental"))
+		|| different)
+	       && !tie_changes)
+	      || tie_break_reminder)
+	    {
+	      if (!key_item_p_) 
+		{
+		  key_item_p_ = new Item (get_property ("Accidentals"));
+		  Local_key_item::set_interface (key_item_p_);
+
+		  
+		  Staff_symbol_referencer::set_interface (key_item_p_);
+		  SCM c0 = get_property ("centralCPosition");
+		  if (gh_number_p (c0))
+		    Staff_symbol_referencer::set_position (key_item_p_, gh_scm2int (c0));
+			 
+		  announce_grob (key_item_p_, 0);
+		}
+
+	      
+	      bool extra_natural =
+		sign (p) * (p - a) == 1
+		&& abs (p) == 2;
+
+	      Local_key_item::add_pitch (key_item_p_, *unsmob_pitch (note_l->get_mus_property ("pitch")),
+					 to_boolean (note_l->get_mus_property ("cautionary")),
+					 extra_natural,
+					 tie_break_reminder);
+	      Side_position_interface::add_support (key_item_p_,support_l);
+	    }
+	  
+	  /*
+	    We should not record the accidental if it is the first
+	    note and it is tied from the previous measure.
+
+	    Checking whether it is tied also works mostly, but will it
+	    always do the correct thing?
+
+	   */
+	  bool forget = to_boolean (get_property ("forgetAccidentals"));
+	  if (tie_changes)
+	    {
+	      /*
+		Remember an alteration that is different both from
+		that of the tied note and of the key signature.
+
+	       */
+	      localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
+							     gh_int2scm (n)),
+					  SCM_BOOL_T); 
+
+	    }
+	  else if (!forget)
+	    {
+	      /*
+		not really really correct if there are more than one
+		noteheads with the same notename.
+	       */
+	      localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
+							     gh_int2scm (n)),
+					  gh_int2scm (a)); 
+
+	    }
+        }
+
+
+  
+  
+      daddy_trans_l_->set_property ("localKeySignature",  localsig);
+    }
+  
+
+  if (key_item_p_)
+    {
+      /*
+	Hmm. Which one has to be on the left?
+
+	On which left, code or paper?
+
+ (Arpeggios are engraved left of accidentals, of course.)
+       */
+      for (int i=0;  i < arpeggios_.size ();  i++)
+	Side_position_interface::add_support (arpeggios_[i], key_item_p_);
+
+      arpeggios_.clear ();
+    }
+}
+
+void
+Accidental_engraver::finalize ()
+{
+
+}
+
+void
+Accidental_engraver::stop_translation_timestep ()
+{
+  if (key_item_p_)
+    {
+      for (int i=0; i < support_l_arr_.size (); i++)
+	Side_position_interface::add_support (key_item_p_,support_l_arr_[i]);
+
+      typeset_grob (key_item_p_);
+      key_item_p_ =0;
+    }
+
+
+  mel_l_arr_.clear ();
+  arpeggios_.clear ();
+  tie_l_arr_.clear ();
+  support_l_arr_.clear ();
+  forced_l_arr_.clear ();	
+}
+
+void
+Accidental_engraver::acknowledge_grob (Grob_info info)
+{
+  Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
+
+  if (note_l && Rhythmic_head::has_interface (info.grob_l_))
+    {
+      mel_l_arr_.push (note_l);
+      support_l_arr_.push (info.grob_l_);
+    }
+  else if (Tie::has_interface (info.grob_l_))
+    {
+      tie_l_arr_.push (info.grob_l_);
+    }
+  else if (Arpeggio::has_interface (info.grob_l_))
+    {
+      arpeggios_.push (info.grob_l_); 
+    }
+  
+}
+
+/*
+  ugh. repeated deep_copy generates lots of garbage.
+ */
+void
+Accidental_engraver::process_music ()
+{
+  SCM smp = get_property ("measurePosition");
+  Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+
+  SCM sig = get_property ("keySignature");
+
+  /*
+    Detect key sig changes. If we haven't found any, check if at start
+    of measure, and set localKeySignature anyhow.  */
+  if (last_keysig_ != sig) 
+    {
+      daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
+      last_keysig_ = sig;
+    }
+  else if (!mp.to_bool () )
+    {
+      if (!to_boolean (get_property ("noResetKey")))
+	daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
+    }
+}
+
+
+
+
+
+ENTER_DESCRIPTION(Accidental_engraver,
+/* descr */       "Make accidentals.  Catches note heads, ties and notices key-change
+events.  Due to interaction with ties (which don't come together
+with note heads), this needs to be in a context higher than Tie_engraver. FIXME",
+/* creats*/       "Accidentals",
+/* acks  */       "rhythmic-head-interface tie-interface arpeggio-interface",
+/* reads */       "localKeySignature forgetAccidentals noResetKey",
+/* write */       "");
diff -purN ../lilypond-1.5.14/lily/auto-beam-engraver.cc ./lily/auto-beam-engraver.cc
--- ../lilypond-1.5.14/lily/auto-beam-engraver.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/auto-beam-engraver.cc	Sun Sep 30 18:21:48 2001
@@ -291,7 +291,8 @@ Auto_beam_engraver::typeset_beam ()
 {
   if (finished_beam_p_)
     {
-      finished_grouping_p_->beamify ();
+      finished_grouping_p_->beamify(*unsmob_moment (get_property ("beatLength")),
+				    (bool)gh_scm2bool(get_property("subdivideBeams")));
       Beam::set_beaming (finished_beam_p_, finished_grouping_p_);
       typeset_grob (finished_beam_p_);
       finished_beam_p_ = 0;
diff -purN ../lilypond-1.5.14/lily/beam-engraver.cc ./lily/beam-engraver.cc
--- ../lilypond-1.5.14/lily/beam-engraver.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/beam-engraver.cc	Sun Sep 30 18:21:48 2001
@@ -181,8 +181,9 @@ Beam_engraver::typeset_beam ()
 {
   if (finished_beam_p_)
     {
-      finished_beam_info_p_->beamify ();
-      
+      finished_beam_info_p_->beamify(*unsmob_moment (get_property ("beatLength")),
+				     (bool)gh_scm2bool(get_property("subdivideBeams")));
+
       Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
       typeset_grob (finished_beam_p_);
       delete finished_beam_info_p_;
diff -purN ../lilypond-1.5.14/lily/beam.cc ./lily/beam.cc
--- ../lilypond-1.5.14/lily/beam.cc	Sat Sep 22 14:13:06 2001
+++ ./lily/beam.cc	Wed Oct  3 17:05:56 2001
@@ -802,11 +802,12 @@ Beam::stem_beams (Grob*me,Item *here, It
 
 
   Direction dir = Directional_element_interface::get (me);
-  
+
   /* [Tremolo] beams on whole notes may not have direction set? */
  if (dir == CENTER)
     dir = Directional_element_interface::get (here);
-  
+
+
   /* half beams extending to the left. */
   if (prev)
     {
diff -purN ../lilypond-1.5.14/lily/beaming-info.cc ./lily/beaming-info.cc
--- ../lilypond-1.5.14/lily/beaming-info.cc	Fri Jun 29 01:03:00 2001
+++ ./lily/beaming-info.cc	Sun Sep 30 18:21:48 2001
@@ -24,23 +24,29 @@ Beaming_info::Beaming_info (Moment m, in
 }
 
 const int infinity_i = INT_MAX;	// guh.
+const int at_beat = 1<<15;
 
 int
-Beaming_info_list::min_denominator_index () const
+Beaming_info_list::best_splitpoint_index (Moment &beat_length,bool subdivide) const
 {
   int minden = infinity_i;
   int minidx = -1;
+  Moment beat_pos;
 
   for (int i=1; i < infos_.size (); i++)
     {
-      if (infos_[i].start_mom_.den () < minden)
+      beat_pos = infos_[i].start_mom_ / beat_length;
+      int den = beat_pos.den ();
+      if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && !subdivide)
+	den *= 4;
+      if (den < minden)
 	{
 	  minidx = i;
-	  minden = infos_[i].start_mom_.den ();
+	  minden = den;
 	}
     }
 
-  return minidx;
+  return minidx|(minden==1 && subdivide ? at_beat : 0);
 }
 
 int
@@ -56,13 +62,14 @@ Beaming_info_list::beam_extend_count (Di
 }
 
 void
-Beaming_info_list::beamify ()
+Beaming_info_list::beamify (Moment &beat_length,bool subdivide)
 {
   if (infos_.size () <= 1)
     return;
       
   Drul_array<Beaming_info_list> splits;
-  int m = min_denominator_index ();
+  int m = best_splitpoint_index (beat_length,subdivide);
+  bool split = subdivide && (m & at_beat);  m = m & ~at_beat;
   splits[LEFT].infos_ = infos_.slice (0,m);
   splits[RIGHT].infos_ = infos_.slice (m, infos_.size ());
 
@@ -70,12 +77,13 @@ Beaming_info_list::beamify ()
  
   do
     {
-      splits[d].beamify ();
+      splits[d].beamify (beat_length,subdivide);
     }
   while (flip (&d) != LEFT);
 
-  int middle_beams = splits[RIGHT].beam_extend_count (LEFT) <?
-    splits[LEFT].beam_extend_count (RIGHT);
+  int middle_beams = (split ? 1 :
+		      splits[RIGHT].beam_extend_count (LEFT) <?
+		      splits[LEFT].beam_extend_count (RIGHT));
 
   do
     {
diff -purN ../lilypond-1.5.14/lily/figured-bass-engraver.cc ./lily/figured-bass-engraver.cc
--- ../lilypond-1.5.14/lily/figured-bass-engraver.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/figured-bass-engraver.cc	Wed Oct  3 01:30:17 2001
@@ -60,7 +60,7 @@ Figured_bass_engraver::process_music ()
     {
       figure_ = new Item (get_property ("BassFigure"));
       announce_grob (figure_, rest_req_); // todo
-      figure_->set_grob_property ("text" , gh_str02scm ("-"));
+      figure_->set_grob_property ("text" , ly_str02scm ("-"));
     }
   else if (figures_.size ())
     {
diff -purN ../lilypond-1.5.14/lily/include/beaming.hh ./lily/include/beaming.hh
--- ../lilypond-1.5.14/lily/include/beaming.hh	Sun Mar 11 19:10:33 2001
+++ ./lily/include/beaming.hh	Sun Sep 30 18:21:48 2001
@@ -33,11 +33,10 @@ struct Beaming_info_list
   Array<Beaming_info> infos_;
 
   int beam_extend_count (Direction) const;
-  int min_denominator_index () const;
-  void beamify ();
+  int best_splitpoint_index (Moment &beat_length,bool subdivide) const;
+  void beamify (Moment &beat_length,bool subdivide);
   void add_stem (Moment d, int beams);
 };
 
 
 #endif /* BEAMING_HH */
-
diff -purN ../lilypond-1.5.14/lily/include/lily-guile.hh ./lily/include/lily-guile.hh
--- ../lilypond-1.5.14/lily/include/lily-guile.hh	Sat Sep 29 01:48:27 2001
+++ ./lily/include/lily-guile.hh	Fri Oct  5 14:40:04 2001
@@ -48,6 +48,8 @@
 #define scm_list_n scm_listify
 #define SCM_STRING_CHARS SCM_CHARS
 #define SCM_STRING_LENGTH SCM_LENGTH
+#define SCM_SYMBOL_CHARS SCM_CHARS
+#define SCM_SYMBOL_LENGTH SCM_LENGTH
 #endif
 
 
@@ -73,8 +75,11 @@ SCM ly_last (SCM list);
 SCM ly_str02scm (char const*c);
 SCM ly_write2scm (SCM s);
 SCM ly_deep_copy (SCM);
-
+#define CACHE_SYMBOLS
 #ifdef CACHE_SYMBOLS
+
+// #warning: CACHE_SYMBOLS
+
 /*
   Using this trick we cache the value of gh_symbol2scm ("fooo") where
   "fooo" is a constant string. This is done at the cost of one static
@@ -85,9 +90,12 @@ SCM ly_deep_copy (SCM);
 
 */
 #define ly_symbol2scm(x) ({ static SCM cached;  \
- (__builtin_constant_p (x)) \
-  ? ((cached) ? cached : scm_permanent_object (cached = gh_symbol2scm((char*)x))) \
-  : gh_symbol2scm(x); })
+ SCM value = cached;  /* We store this one locally, since G++ -O2 fucks up else */   \
+ if (__builtin_constant_p (x))\
+   value = cached =  scm_permanent_object (gh_symbol2scm((char*)x));\
+ else\
+  value = gh_symbol2scm ((char*)x); \
+  value; })
 #else
 inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((char*)x); }
 #endif 
diff -purN ../lilypond-1.5.14/lily/input-smob.cc ./lily/input-smob.cc
--- ../lilypond-1.5.14/lily/input-smob.cc	Wed Jul 11 14:54:52 2001
+++ ./lily/input-smob.cc	Wed Oct  3 01:30:17 2001
@@ -41,8 +41,8 @@ ly_input_p (SCM x)
   return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F ;
 }
 
-static
-void start_input_smobs ()
+static void
+start_input_smobs ()
 {
   input_tag = scm_make_smob_type ("input", 0);
   scm_set_smob_mark (input_tag, mark_smob);
@@ -52,7 +52,7 @@ void start_input_smobs ()
 
   scm_c_define_gsubr ("ly-input-location?", 1, 0, 0,
 		      (Scheme_function_unknown)ly_input_p);
- }
+}
 
 SCM
 make_input (Input ip)
diff -purN ../lilypond-1.5.14/lily/local-key-engraver.cc ./lily/local-key-engraver.cc
--- ../lilypond-1.5.14/lily/local-key-engraver.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/local-key-engraver.cc	Thu Jan  1 01:00:00 1970
@@ -1,297 +0,0 @@
-/*
-  local-key-engraver.cc -- implement Local_key_engraver
-
-  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "local-key-item.hh"
-#include "item.hh"
-#include "tie.hh"
-#include "rhythmic-head.hh"
-#include "timing-translator.hh"
-#include "engraver-group-engraver.hh"
-
-#include "staff-symbol-referencer.hh"
-#include "side-position-interface.hh"
-#include "engraver.hh"
-#include "arpeggio.hh"
-
-/**
-
-
-   FIXME: should not compute vertical positioning of accidentals, but
-   get them from the noteheads
-
-   The algorithm for accidentals should be documented, and made
-   tweakable.
-
-*/
-
-
-struct Local_key_engraver : Engraver {
-  Item *key_item_p_;
-protected:
-  TRANSLATOR_DECLARATIONS(Local_key_engraver);
-  virtual void process_music ();
-  virtual void acknowledge_grob (Grob_info);
-  virtual void stop_translation_timestep ();
-  virtual void initialize ();
-  virtual void create_grobs ();
-  virtual void finalize ();
-public:
-
-  // todo -> property
-  SCM last_keysig_;
-
-  /*
-    Urgh. Since the accidentals depend on lots of variables, we have to
-    store all information before we can really create the accidentals.
-   */
-  Link_array<Grob> arpeggios_;
-  
-  Link_array<Note_req> mel_l_arr_;
-  Link_array<Grob> support_l_arr_;
-  Link_array<Item> forced_l_arr_;
-  Link_array<Grob> tie_l_arr_;
-
-};
-
-Local_key_engraver::Local_key_engraver ()
-{
-  key_item_p_ =0;
-  last_keysig_ = SCM_EOL;
-}
-
-void
-Local_key_engraver::initialize ()
-{
-  last_keysig_ = get_property ("keySignature");
-  daddy_trans_l_->set_property ("localKeySignature",  last_keysig_);  
-}
-
-void
-Local_key_engraver::create_grobs ()
-{
-  if (!key_item_p_ && mel_l_arr_.size ()) 
-    {
-      SCM localsig = get_property ("localKeySignature");
-  
-      for (int i=0; i  < mel_l_arr_.size (); i++) 
-	{
-	  Grob * support_l = support_l_arr_[i];
-	  Note_req * note_l = mel_l_arr_[i];
-
-	  int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
-	  int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
-	  int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
-	  
-	  /* see if there's a tie that "changes" the accidental */
-	  /* works because if there's a tie, the note to the left
-	     is of the same pitch as the actual note */
-
-	  SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), localsig);
-	  if (prev == SCM_BOOL_F)
-	    prev = scm_assoc (gh_int2scm (n), localsig);
-	  SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : ly_cdr (prev);
-	  bool different = !gh_equal_p (prev_acc , gh_int2scm (a));
-	  int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
-
-	  Grob *tie_break_reminder = 0;
-	  bool tie_changes = false;
-	  for (int i=0; i < tie_l_arr_.size (); i++)
-	    if (support_l == Tie::head (tie_l_arr_[i], RIGHT))
-	      {
-		tie_changes = different;
-		/* Enable accidentals for broken tie
-
-		   We only want an accidental on a broken tie,
-		   if the tie changes the accidental.
-		   
-		   Maybe check property noTieBreakForceAccidental? */
-		if (different)
-		  tie_break_reminder = tie_l_arr_[i];
-		break;
-	      }
-
-	  /* When do we want accidentals:
-
-	     1. when property force-accidental is set, and not
-	     tie_changes
-	     2. when different and not tie-changes
-	     3. maybe when at end of a tie: we must later see if
-	     we're after a line break */
-	  if (( (to_boolean (note_l->get_mus_property ("force-accidental"))
-		|| different)
-	       && !tie_changes)
-	      || tie_break_reminder)
-	    {
-	      if (!key_item_p_) 
-		{
-		  key_item_p_ = new Item (get_property ("Accidentals"));
-		  Local_key_item::set_interface (key_item_p_);
-
-		  
-		  Staff_symbol_referencer::set_interface (key_item_p_);
-		  SCM c0 = get_property ("centralCPosition");
-		  if (gh_number_p (c0))
-		    Staff_symbol_referencer::set_position (key_item_p_, gh_scm2int (c0));
-			 
-		  announce_grob (key_item_p_, 0);
-		}
-
-	      
-	      bool extra_natural =
-		sign (p) * (p - a) == 1
-		&& abs (p) == 2;
-
-	      Local_key_item::add_pitch (key_item_p_, *unsmob_pitch (note_l->get_mus_property ("pitch")),
-					 to_boolean (note_l->get_mus_property ("cautionary")),
-					 extra_natural,
-					 tie_break_reminder);
-	      Side_position_interface::add_support (key_item_p_,support_l);
-	    }
-	  
-	  /*
-	    We should not record the accidental if it is the first
-	    note and it is tied from the previous measure.
-
-	    Checking whether it is tied also works mostly, but will it
-	    always do the correct thing?
-
-	   */
-	  bool forget = to_boolean (get_property ("forgetAccidentals"));
-	  if (tie_changes)
-	    {
-	      /*
-		Remember an alteration that is different both from
-		that of the tied note and of the key signature.
-
-	       */
-	      localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
-							     gh_int2scm (n)),
-					  SCM_BOOL_T); 
-
-	    }
-	  else if (!forget)
-	    {
-	      /*
-		not really really correct if there are more than one
-		noteheads with the same notename.
-	       */
-	      localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
-							     gh_int2scm (n)),
-					  gh_int2scm (a)); 
-
-	    }
-        }
-
-
-  
-  
-      daddy_trans_l_->set_property ("localKeySignature",  localsig);
-    }
-  
-
-  if (key_item_p_)
-    {
-      /*
-	Hmm. Which one has to be on the left?
-
-	On which left, code or paper?
-
- (Arpeggios are engraved left of accidentals, of course.)
-       */
-      for (int i=0;  i < arpeggios_.size ();  i++)
-	Side_position_interface::add_support (arpeggios_[i], key_item_p_);
-
-      arpeggios_.clear ();
-    }
-}
-
-void
-Local_key_engraver::finalize ()
-{
-
-}
-
-void
-Local_key_engraver::stop_translation_timestep ()
-{
-  if (key_item_p_)
-    {
-      for (int i=0; i < support_l_arr_.size (); i++)
-	Side_position_interface::add_support (key_item_p_,support_l_arr_[i]);
-
-      typeset_grob (key_item_p_);
-      key_item_p_ =0;
-    }
-
-
-  mel_l_arr_.clear ();
-  arpeggios_.clear ();
-  tie_l_arr_.clear ();
-  support_l_arr_.clear ();
-  forced_l_arr_.clear ();	
-}
-
-void
-Local_key_engraver::acknowledge_grob (Grob_info info)
-{
-  Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
-
-  if (note_l && Rhythmic_head::has_interface (info.grob_l_))
-    {
-      mel_l_arr_.push (note_l);
-      support_l_arr_.push (info.grob_l_);
-    }
-  else if (Tie::has_interface (info.grob_l_))
-    {
-      tie_l_arr_.push (info.grob_l_);
-    }
-  else if (Arpeggio::has_interface (info.grob_l_))
-    {
-      arpeggios_.push (info.grob_l_); 
-    }
-  
-}
-
-/*
-  ugh. repeated deep_copy generates lots of garbage.
- */
-void
-Local_key_engraver::process_music ()
-{
-  SCM smp = get_property ("measurePosition");
-  Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
-
-  SCM sig = get_property ("keySignature");
-
-  /*
-    Detect key sig changes. If we haven't found any, check if at start
-    of measure, and set localKeySignature anyhow.  */
-  if (last_keysig_ != sig) 
-    {
-      daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
-      last_keysig_ = sig;
-    }
-  else if (!mp.to_bool () )
-    {
-      if (!to_boolean (get_property ("noResetKey")))
-	daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
-    }
-}
-
-
-
-
-
-ENTER_DESCRIPTION(Local_key_engraver,
-/* descr */       "Make accidentals.  Catches note heads, ties and notices key-change
-events.  Due to interaction with ties (which don't come together
-with note heads), this needs to be in a context higher than Tie_engraver. FIXME",
-/* creats*/       "Accidentals",
-/* acks  */       "rhythmic-head-interface tie-interface arpeggio-interface",
-/* reads */       "localKeySignature forgetAccidentals noResetKey",
-/* write */       "");
diff -purN ../lilypond-1.5.14/lily/local-key-item.cc ./lily/local-key-item.cc
--- ../lilypond-1.5.14/lily/local-key-item.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/local-key-item.cc	Thu Oct  4 00:27:40 2001
@@ -28,7 +28,7 @@ static SCM pitch_less_proc;
 void
 init_pitch_funcs ()
 {
-  pitch_less_proc = gh_new_procedure2_0 ("pits-less", &pitch_less);
+  pitch_less_proc = gh_new_procedure2_0 ("pitch-less", &pitch_less);
 }
 
 ADD_SCM_INIT_FUNC (lkpitch,init_pitch_funcs);
@@ -40,7 +40,10 @@ Local_key_item::add_pitch (Grob*me, Pitc
 {
   SCM acs = me->get_grob_property ("accidentals");
   SCM pitch = p.smobbed_copy ();
-  SCM opts = SCM_EOL;
+  SCM opts = scm_assoc (pitch, acs);
+  bool new_pitch = !gh_pair_p (opts);
+  opts= new_pitch ? SCM_EOL : gh_cdr (opts);
+  
   if (cautionary)
     opts = gh_cons (ly_symbol2scm ("cautionary"), opts);
   if (natural)
@@ -52,8 +55,13 @@ Local_key_item::add_pitch (Grob*me, Pitc
       opts = gh_cons (ly_symbol2scm ("tie-break-reminder"), opts);
     }
 
-  pitch = gh_cons (pitch, opts);
-  acs = scm_merge_x (acs, gh_cons (pitch, SCM_EOL), pitch_less_proc);
+  if (new_pitch)
+    {
+      pitch = gh_cons (pitch, opts);
+      acs = scm_merge_x (acs, gh_cons (pitch, SCM_EOL), pitch_less_proc);
+    }
+  else
+    scm_assoc_set_x (acs, pitch, opts);
 
   me->set_grob_property ("accidentals", acs);
 }
diff -purN ../lilypond-1.5.14/lily/rhythmic-column-engraver.cc ./lily/rhythmic-column-engraver.cc
--- ../lilypond-1.5.14/lily/rhythmic-column-engraver.cc	Fri Sep 28 23:58:21 2001
+++ ./lily/rhythmic-column-engraver.cc	Fri Oct  5 02:04:42 2001
@@ -122,6 +122,6 @@ Rhythmic_column_engraver::start_translat
 ENTER_DESCRIPTION(Rhythmic_column_engraver,
 /* descr */       "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
 /* creats*/       "NoteColumn",
-/* acks  */       "stem-interface rhythmicb-head-interface dot-column-interface",
+/* acks  */       "stem-interface rhythmic-head-interface dot-column-interface",
 /* reads */       "",
 /* write */       "");
diff -purN ../lilypond-1.5.14/lily/scm-hash.cc ./lily/scm-hash.cc
--- ../lilypond-1.5.14/lily/scm-hash.cc	Thu Sep 27 01:54:34 2001
+++ ./lily/scm-hash.cc	Sun Sep 30 18:19:57 2001
@@ -14,7 +14,7 @@
 void
 copy_scm_hashes (SCM dest, SCM src)
 {
-  for (int i = SCM_LENGTH(src); i--;)
+  for (int i = SCM_SYMBOL_LENGTH (src); i--;)
     for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p(s); s = ly_cdr (s))
       {
 	scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s));
@@ -108,7 +108,7 @@ Scheme_hash_table::set (SCM k, SCM v)
   /*
     resize if getting too large.
   */
-  if (elt_count_ > 2 * SCM_LENGTH (hash_tab_))
+  if (elt_count_ > 2 * SCM_SYMBOL_LENGTH (hash_tab_))
     {
       SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL);
       copy_scm_hashes (nh, hash_tab_);
@@ -142,7 +142,7 @@ SCM
 Scheme_hash_table::to_alist () const
 {
   SCM l = SCM_EOL;
-  for (int i = SCM_LENGTH(hash_tab_); i--;)
+  for (int i = SCM_SYMBOL_LENGTH (hash_tab_); i--;)
     for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p(s); s = ly_cdr (s))
       {
 	l = scm_acons (ly_caar (s), ly_cdar (s), l);
diff -purN ../lilypond-1.5.14/lily/span-bar.cc ./lily/span-bar.cc
--- ../lilypond-1.5.14/lily/span-bar.cc	Sat Sep 22 02:43:07 2001
+++ ./lily/span-bar.cc	Thu Oct  4 00:27:40 2001
@@ -177,17 +177,24 @@ void
 Span_bar::evaluate_glyph (Grob*me)
 {
   SCM elts = me->get_grob_property ("elements");
-  Grob * b = unsmob_grob (ly_car (elts));
-  SCM glsym =ly_symbol2scm ("glyph");
-  SCM gl =b ->get_grob_property (glsym);
+  SCM glyph_symbol = ly_symbol2scm ("glyph");
+  SCM gl = SCM_EOL;
+
+  while (gh_pair_p (elts))
+    {
+      gl =  unsmob_grob (gh_car (elts))->get_grob_property (glyph_symbol);
+      if (gh_string_p (gl))
+	break;
+      elts =gh_cdr (elts);
+    }
+
   if (!gh_string_p (gl))
     {
       me->suicide ();
-      return ; 
+      return;
     }
-
-  String type = ly_scm2string (gl);
   
+  String type = ly_scm2string (gl);
   if (type == "|:") 
     {
       type = ".|";
@@ -202,8 +209,8 @@ Span_bar::evaluate_glyph (Grob*me)
     }
 
   gl = ly_str02scm (type.ch_C ());
-  if (scm_equal_p (me->get_grob_property (glsym), gl) != SCM_BOOL_T)
-    me->set_grob_property (glsym, gl);
+  if (scm_equal_p (me->get_grob_property (glyph_symbol), gl) != SCM_BOOL_T)
+    me->set_grob_property (glyph_symbol, gl);
 }
 
 Interval
diff -purN ../lilypond-1.5.14/lily/translator.cc ./lily/translator.cc
--- ../lilypond-1.5.14/lily/translator.cc	Mon Sep 24 01:04:29 2001
+++ ./lily/translator.cc	Sun Sep 30 18:19:57 2001
@@ -160,7 +160,7 @@ Translator::name (SCM trans) 
   if (unsmob_translator (trans))
     {
       char const* nm = classname (unsmob_translator (trans));
-      return gh_str02scm (nm);
+      return ly_str02scm (nm);
     }
   return
     SCM_EOL;
diff -purN ../lilypond-1.5.14/ly/engraver-init.ly ./ly/engraver-init.ly
--- ../lilypond-1.5.14/ly/engraver-init.ly	Mon Sep 24 01:04:29 2001
+++ ./ly/engraver-init.ly	Thu Oct  4 00:27:40 2001
@@ -27,7 +27,7 @@ StaffContext=\translator {
 	\consists "Staff_symbol_engraver"
 	\consists "Collision_engraver"
 	\consists "Rest_collision_engraver"
-	\consists "Local_key_engraver"
+	\consists "Accidental_engraver"
 	\consists "Piano_pedal_engraver"
 	\consists "Instrument_name_engraver"
 
@@ -379,6 +379,8 @@ ScoreContext = \translator {
 
 	tupletNumberFormatFunction = #denominator-tuplet-formatter
 	
+	subdivideBeams = ##f
+
        keyAccidentalOrder = #'(
          (6 . -1) (2  . -1) (5 . -1 ) (1  . -1) (4  . -1) (0  . -1) (3  . -1)
 	 (3  . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
diff -purN ../lilypond-1.5.14/modules/midi.c ./modules/midi.c
--- ../lilypond-1.5.14/modules/midi.c	Mon Sep 24 01:04:29 2001
+++ ./modules/midi.c	Fri Oct  5 18:06:04 2001
@@ -108,6 +108,7 @@ message_t metaEvents[] = {
   0x58, "TIME_SIGNATURE",
   0x59, "KEY_SIGNATURE",
   0x7F, "SEQUENCER_SPECIFIC_META_EVENT",
+  0xFF, "META_EVENT",
   0,0
 };
 
@@ -285,7 +286,9 @@ midi_parse_track (unsigned char **track,
 #endif
 
   debug_print ("%s", "\n");
-  assert (!strcmp (*track, "MTrk"));
+  if (!strcmp (*track, "MTrk"))
+    return midi_error ("parse_track(): MTrk expected");
+  
   *track += 4;
 
   track_len = get_number (track, *track + 4, 4);
diff -purN ../lilypond-1.5.14/mutopia/E.Satie/petite-ouverture-a-danser.ly ./mutopia/E.Satie/petite-ouverture-a-danser.ly
--- ../lilypond-1.5.14/mutopia/E.Satie/petite-ouverture-a-danser.ly	Wed May  9 19:52:35 2001
+++ ./mutopia/E.Satie/petite-ouverture-a-danser.ly	Wed Oct  3 19:44:49 2001
@@ -147,8 +147,6 @@ lower =  \context Staff \notes \relative
     >
 
   \paper {
-    textheight = 295.\mm
-    \translator{ \OrchestralScoreContext }
     \translator{
 	    \VoiceContext
 	    Slur \override #'attachment = #'(stem . stem)
diff -purN ../lilypond-1.5.14/scm/grob-property-description.scm ./scm/grob-property-description.scm
--- ../lilypond-1.5.14/scm/grob-property-description.scm	Thu Sep 20 11:08:31 2001
+++ ./scm/grob-property-description.scm	Thu Oct  4 00:27:40 2001
@@ -29,6 +29,9 @@
 (grob-property-description 'X-offset-callbacks list? "list of functions, each taking an grob and axis argument. The function determine the position relative to this grob's parent. The last one in the list is called first.")
 (grob-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}.")
 (grob-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}.")
+(grob-property-description 'accidentals list? "Alist with (PITCH
+. OPTION-LIST) entries. OPTION-LIST can contain 'cautionary, 'natural
+and 'tie-break-reminder ")
 (grob-property-description 'add-stem boolean? "Add stem to porrectus?.")
 (grob-property-description 'after-line-breaking-callback procedure? "Procedure taking a grob as argument.
 This procedure is called (using dependency resolution) after line breaking. Return value is ignored.")
diff -purN ../lilypond-1.5.14/scm/interface-description.scm ./scm/interface-description.scm
--- ../lilypond-1.5.14/scm/interface-description.scm	Mon Sep 24 01:04:29 2001
+++ ./scm/interface-description.scm	Thu Oct  4 00:27:40 2001
@@ -185,7 +185,7 @@
 (lily-interface
  'accidentals-interface
  "Accidentals"
- '(
+ '(accidentals
    left-padding 
    right-padding 
    ))
diff -purN ../lilypond-1.5.14/scripts/midi2ly.py ./scripts/midi2ly.py
--- ../lilypond-1.5.14/scripts/midi2ly.py	Sat Sep 22 02:43:07 2001
+++ ./scripts/midi2ly.py	Fri Oct  5 18:04:52 2001
@@ -2,51 +2,96 @@
 
 import midi
 import sys
+import string
 
-scale_steps =[0,2,4,5,7,9,11]
+LINE_BELL = 60
+scale_steps = [0,2,4,5,7,9,11]
 
-def split_channels (track):
+def split_track (track):
 	chs = {}
 	for i in range(16):
 		chs[i] = []
 		
 	for e in track:
-		data = list (e[1])		
-		c =  data[0] & 0x0f
-		e = (e[0], tuple ([data[0] & 0xf0] + data[1:]))
-		chs[c].append (e)
+		data = list (e[1])
+		if data[0] > 0x7f and data[0] < 0xf0:
+			c = data[0] & 0x0f
+			e = (e[0], tuple ([data[0] & 0xf0] + data[1:]))
+			chs[c].append (e)
+		else:
+			chs[0].append (e)
 
 	for i in range (16):
 		if chs[i] == []:
 			del chs[i]
 
-
+	whatarewes = []
 	for v in chs.values ():
-		ns = notes_on_channel(v)
-		ns = unthread_notes (ns)
-		map (dump_thread, ns)
-		
-	return chs
+		ns = notes_on_channel (v)
+		dinges = unthread_notes (ns)
+		if len (dinges):
+			whatarewes.append (dinges)
+	return whatarewes
 
 
 class Note:
-	def __init__(self, duration, pitch, velocity):
+	def __init__ (self, duration, pitch, velocity):
 		self.velocity = velocity
 		self.pitch = pitch
 		self.duration = duration
 
-	def duration_compare(a,b):
-		if a.duration < b.duration :
+	def duration_compare (a, b):
+		if a.duration < b.duration:
 			return -1
 		elif a.duration > b.duration:
 			return 1
 		else:
 			return 0
-	
+
+	def dump (self):
+		return dump_note (self)
+
+class Time:
+	def __init__ (self, t, num, den):
+		self.duration = t
+		self.num = num
+		self.den = den
+		
+	def dump (self):
+		return dump_skip (self.duration) + '\\time %d/%d ' % (self.num, self.den)
+
+class Key:
+	key_sharps = ('c', 'g', 'd', 'a', 'e', 'b', 'fis')
+	key_flats = ('BUG', 'f', 'bes', 'es', 'as', 'des', 'ges')
+
+	def __init__ (self, t, sharps, flats, minor):
+		self.duration = t
+		self.flats = flats
+		self.sharps = sharps
+		self.minor = minor
+		
+	def dump (self):
+		if self.sharps and self.flats:
+			s = '\\keysignature %s ' % 'TODO'
+		elif self.sharps:
+			s = '\\notes\\key %s \major' % key_sharps[self.sharps]
+		elif self.flats:
+			s = '\\notes\\key %s \major' % key_flats[self.flats]
+		return dump_skip (self.duration) + s
+
+
+class Text:
+	def __init__ (self, text):
+		self.text = text
+		self.duration = 0
+		
+	def dump (self):
+		return dump_text (self)
+
 def notes_on_channel (channel):
 	pitches = {}
 
-	nch= []
+	nch = []
 	for e in channel:
 		t = e[0]
 
@@ -62,7 +107,26 @@ def notes_on_channel (channel):
 				
 			except KeyError:
 				pass
+		elif e[1][0] == midi.META_EVENT:
+			if e[1][1] == midi.TIME_SIGNATURE:
+				(num, den, clocks4, count32) = map (ord, e[1][2])
+				nch.append ((t, Time (t, num, den)))
+			elif e[1][1] == midi.KEY_SIGNATURE:
+				(accidentals, minor) = map (ord, e[1][2])
+				sharps = 0
+				flats = 0
+				if accidentals < 127:
+					sharps = accidentals
+				else:
+					flats = 256 - accidentals
+				nch.append ((t, Key (t, sharps, flats, minor)))
+			elif e[1][1] == midi.TEXT_EVENT:
+				nch.append ((t, Text (e[1][2])))
+			else:
+				sys.stderr.write ("SKIP: %s\n" % `e`)
+				pass
 		else:
+			sys.stderr.write ("SKIP: %s\n" % `e`)
 			pass
 	
 	return nch
@@ -76,13 +140,15 @@ def unthread_notes (channel):
 		todo = []
 		for e in channel:
 			t = e[0]
-			if (t == start_busy_t and e[1].duration + t == end_busy_t) \
-			    or t >= end_busy_t:
+			if e[1].__class__ == Note and ((t == start_busy_t and e[1].duration + t == end_busy_t) \
+			    or t >= end_busy_t):
 				thread.append (e)
 				start_busy_t = t
 				end_busy_t = t + e[1].duration
+			elif e[1].__class__ == Time or e[1].__class__ == Key or e[1].__class__ == Text:
+				thread.append (e)
 			else:
-				todo.append(e)
+				todo.append (e)
 		threads.append (thread)
 		channel = todo
 
@@ -99,31 +165,21 @@ def gcd (a,b):
 	return a
 	
 def dump_skip (dt):
-	wholes = dt / (4*384)
-	dt = dt % (4*384);
-	quarters = dt / 384
-
-	# etc.
-	if (wholes):
-		print 's1*%d' % wholes 
-	if quarters:
-		print 's4*%d' % quarters 
-
-
+	return 's' + dump_duration (dt)
 
 def dump_duration (dur):
 	g = gcd (dur, 384)
-	sys.stdout.write ('4')
+	s = '4'
 	(p,q) = (dur / g, 384 / g)
 	if (p == 1 and q == 1) :
 		pass
 	else:
 		if p <> 1:	
-			sys.stdout.write ('*%d'% p)
+			s = s + '*%d'% p
 		if q <> 1:
-			sys.stdout.write ('*%d'% q)
+			s = s + '*%d'% q
+	return s
 	
-
 def dump_note (note):
 	p = note.pitch
 	oct = p / 12
@@ -136,22 +192,28 @@ def dump_note (note):
 		i = i+1
 		
 	i = i-1
-	str = chr (i + ord ('a'))
+	str = chr ((i + 2)  % 7 + ord ('a'))
 	if scale_steps[i] <> step:
 		str = str + 'is'
 
-	sys.stdout.write (' %s' % str);
-	dump_duration (note.duration)
+	return ' %s' % str + dump_duration (note.duration)
+
+def dump (self):
+	return self.dump ()
+
+def dump_text (text):
+	return '\n  % ' + text.text + '\n  '
 
 def dump_chord (ch):
+	s = ''
 	if len(ch) == 1:
-		dump_note (ch[0])
+		s = dump (ch[0])
 	else:
-		sys.stdout.write ("<")
-		map (dump_note, ch)
-		sys.stdout.write ('>')
+		s = '<' + string.join (map (dump, ch)) + '>'
+	return s
 
-def dump_thread (thread):
+# thread?
+def dump_channel (thread):
 	last_e = None
 	chs = []
 	ch = []
@@ -161,46 +223,88 @@ def dump_thread (thread):
 			ch.append (e[1])
 		else:
 			if ch:
-				chs.append ( (last_e[0], ch))
+				chs.append ((last_e[0], ch))
 				
 			ch = [e[1]]
 			
 		last_e = e
 
-	if ch: chs.append ((last_e[0] ,ch))
+	if ch:
+		chs.append ((last_e[0], ch))
 	t = 0
 	last_t = 0
 
+	lines = ['']
 	for ch in chs:
+		if len (lines[-1]) > LINE_BELL:
+			lines.append ('')
+			
 		t = ch[0]
 		if t - last_t:
-			dump_skip (t-last_t)
+			lines[-1] = lines[-1] + dump_skip (t-last_t)
 			
-		dump_chord (ch[1])
+		lines[-1] = lines[-1] + dump_chord (ch[1])
+
 		last_t = t + ch[1][0].duration
 
+	return string.join (lines, '\n  ') + '\n'
+
 def dump_notes (channel):
 	on_hold = []
+	s = ''
 	for e in channel:
 		if e[0] <> last_t:
-			dump_chord (on_hold)
+			s = s + dump_chord (on_hold)
 			on_hold = []
 			last_t = e[0]
 
 		on_hold.append (e)
-		
+	return s
 
+def track_name (i):
+	return 'track%c' % (i + ord ('A'))
 
+def channel_name (i):
+	return 'channel%c' % (i + ord ('A'))
+
+def dump_track (channels, n):
+	s = '\n'
+	track = track_name (n)
+	for i in range (len (channels)):
+		channel = channel_name (i)
+		s = s + '%s = \\notes {\n' % (track + channel)
+		s = s + '  ' + dump_channel (channels[i][0])
+		s = s + '}\n\n'
+
+	s = s + '%s = <\n' % track
+
+	for i in range (len (channels)):
+		channel = channel_name (i)
+		s = s + '  \\context Voice = %s \\%s\n' % (channel, track + channel)
+	s = s + '>\n\n'
+	return s
+			
 	
 def convert_midi (f):
 	str = open (f).read ()
 	midi_dump = midi.parse (str)
 
-	channels = []
-
+	tracks = []
 	for t in midi_dump[1]:
-		channels.append (split_channels (t))
+		tracks.append (split_track (t))
 
+	s = ''
+	for i in range (len (tracks)):
+		s = s + dump_track (tracks[i], i)
+
+	s = s + '\n\\score {\n  <\n'
+	for i in range (len (tracks)):
+		track = track_name (i)
+		s = s + '    \\context Staff=%s \\%s\n' % (track, track)
+	s = s + '  >\n}\n'
+	
+	sys.stdout.write (s)
+		
 
 for f in sys.argv[1:]:
-    convert_midi (f)
+	convert_midi (f)
diff -purN ../lilypond-1.5.14/stepmake/bin/add-html-footer.py ./stepmake/bin/add-html-footer.py
--- ../lilypond-1.5.14/stepmake/bin/add-html-footer.py	Mon Sep 17 12:08:15 2001
+++ ./stepmake/bin/add-html-footer.py	Thu Oct  4 21:46:59 2001
@@ -42,7 +42,7 @@ built = r"""<hr>
 <p><font size="-1">
 This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ by<br>
 </font>
-<address><font size="-1">@GCOS@ &lt;<a href="mailto:%s">@MAIL_ADDRESS@</a>&gt;,
+<address><font size="-1">@GCOS@ &lt;<a href="mailto:@MAILADDRESS@">@MAILADDRESS@</a>&gt;,
 @LOCALTIME@.</font></address>"""
 
 
@@ -151,8 +151,20 @@ else:
 def remove_self_ref (s):	
 	self_url = abspath (os.getcwd () + '/' + f)
 	#sys.stderr.write ('url0: %s\n' % self_url)
-	self_url = re.sub ('.*' + string.lower (package_name) + '[^/]*/',
+
+	# self_url = re.sub ('.*?' + string.lower (package_name) + '[^/]*/',
+	#		 '', self_url)
+	# URG - this only works when source tree is unpacked in `src/' dir
+	# For some reason, .*? still eats away
+	#     /home/fred/usr/src/lilypond-1.5.14/Documentation/user/out-www/lilypond/
+	# instead of just
+	#
+	#     /home/fred/usr/src/lilypond-1.5.14/
+	#
+	#     Tutorial.html
+	self_url = re.sub ('.*?src/' + string.lower (package_name) + '[^/]*/',
 			 '', self_url)
+
 	#sys.stderr.write ('url1: %s\n' % self_url)
 	
 	#urg, ugly lily-specific toplevel index hack
@@ -226,7 +238,7 @@ def do_file (f):
 	s = re.sub ('@WEBMASTER@', webmaster, s)
 	s = re.sub ('@GCOS@', gcos, s)
 	s = re.sub ('@LOCALTIME@', localtime, s)
-	s = re.sub ('@MAIL_ADDRESS@', mail_address, s)
+	s = re.sub ('@MAILADDRESS@', mail_address, s)
 
 	m = re.match ('.*?<!-- (@[a-zA-Z0-9_-]*@)=(.*?) -->', s, re.DOTALL)
 	while m:
