]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.24 release/1.5.24
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 1 Dec 2001 14:35:46 +0000 (15:35 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 1 Dec 2001 14:35:46 +0000 (15:35 +0100)
99 files changed:
CHANGES
ChangeLog [new file with mode: 0644]
Documentation/regression-test.tely
Documentation/topdocs/INSTALL.texi
GNUmakefile.in
INSTALL.txt
VERSION
flower/axis.cc
flower/include/axes.hh
input/regression/beam-quanting.ly [new file with mode: 0644]
input/regression/fingering.ly [new file with mode: 0644]
input/test/beam-pos.ly
lily/a2-engraver.cc
lily/accidental-engraver.cc
lily/align-interface.cc
lily/arpeggio-engraver.cc
lily/auto-beam-engraver.cc
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/beam-engraver.cc
lily/beam.cc
lily/break-align-engraver.cc
lily/break-align-item.cc
lily/chord-name-engraver.cc
lily/chord-tremolo-engraver.cc
lily/collision-engraver.cc
lily/collision.cc
lily/custos-engraver.cc
lily/dot-column.cc
lily/engraver.cc
lily/fingering-engraver.cc [new file with mode: 0644]
lily/grob-info.cc
lily/grob.cc
lily/group-interface.cc
lily/hara-kiri-group-spanner.cc
lily/include/grob-info.hh
lily/include/grob.hh
lily/include/group-interface.hh
lily/include/musical-request.hh
lily/include/note-head.hh
lily/include/note-spacing.hh [new file with mode: 0644]
lily/include/staff-spacing.hh [new file with mode: 0644]
lily/item.cc
lily/line-group-group-engraver.cc
lily/line-of-score.cc
lily/multi-measure-rest.cc
lily/music.cc
lily/musical-request.cc
lily/new-spacing-spanner.cc
lily/note-column.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-spacing.cc [new file with mode: 0644]
lily/parser.yy
lily/piano-pedal-engraver.cc
lily/porrectus-engraver.cc
lily/property-engraver.cc
lily/rest-collision.cc
lily/rhythmic-column-engraver.cc
lily/score-engraver.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/slur.cc
lily/spacing-engraver.cc
lily/span-arpeggio-engraver.cc
lily/span-bar.cc
lily/spanner.cc
lily/staff-spacing.cc [new file with mode: 0644]
lily/stanza-number-engraver.cc
lily/stem-engraver.cc
lily/stem.cc
lily/system-start-delimiter-engraver.cc
lily/text-engraver.cc
lily/tfm-reader.cc
lily/third-try.cc [new file with mode: 0644]
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie-performer.cc
lily/tuplet-bracket.cc
lily/vertical-align-engraver.cc
lily/volta-spanner.cc
ly/engraver-init.ly
make/out/lilypond.lsm
make/out/lilypond.mandrake.spec
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
scm/basic-properties.scm
scm/beam.scm
scm/grob-description.scm
scm/interface-description.scm
scm/lily.scm
scm/music-functions.scm
scm/sketch.scm
stepmake/bin/add-html-footer.py

diff --git a/CHANGES b/CHANGES
index 0d14dd62f31a744e4a3ac32503a8276c146f0238..5f42581186375457c328c1fcd9c2c79a7cddbb7b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,15 +1,11 @@
-1.5.23.jcn1
-===========
-
-* Rewrote new conditional guile >= 1.5 compilation switches, to keep
-  code clean from conditionals and have a concentrated sets of
-  compatitility fixes for old guile versions.
-
-* Fixes for guile 1.4, including embedded ps.
-
 1.5.23
 ======
 
+* Bugfix: be anal about slur dimensions.
+
+* Bugfix: insert extra margin around pixmaps.
+
+* lilypond-book: magnification option for EPS
 
 1.5.22.jcn1
 ===========
@@ -121,7 +117,7 @@ abc2ly fixes:
    - Hmm, then find that
 
      + Sketch accesses characters by name, ie, the
-      name characters have in default text fonts.  Luckily, textrace
+clefs      name characters have in default text fonts.  Luckily, textrace
       mangles the feta names too.  Sadly, textrace chooses different names
       for characters > 128.
 
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..162b8ef
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,55 @@
+2001-12-01  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/note-head.cc (head_extent): added to compute width without
+       ledger lines. By default, ledger lines take up width now.
+
+       * input/regression/fingering.ly: demonstrate auto fingering.
+       Horizontal placement is still buggy. 
+       
+       * lily/fingering-engraver.cc (class Fingering_engraver):
+       added. Provides support for horizontal fingering scripts
+
+       * lily/include/grob.hh: Naming: change parent_l() into get_parent()
+
+       * lily/side-position-interface.cc (add_staff_support): add staff
+       only for Y-axis side positions.
+
+       * lily/parser.yy (request_chord): Fix mem leak.
+
+       * lily/musical-request.cc (transpose): moved to Music::transpose()
+
+       * lily/include/grob-info.hh: Change music pointer to SCM, so we
+       can store grobs as grob-creation cause as well.
+
+       * lily/group-interface.cc (add_thing): efficiency tweak: reuse
+       handle when adding. Use precomputed symbols throughout lily.
+       
+       * lily/rhythmic-column-engraver.cc: make NoteSpacing grobs to keep
+       track of spacing issues.
+
+       * lily/separating-line-group-engraver.cc: make StaffSpacing grobs
+       to keep track of staff spacing
+
+2001-11-30  Jan Nieuwenhuizen <janneke@gnu.org>
+
+       * Rewrote new conditional guile >= 1.5 compilation switches, to keep
+         code clean from conditionals and have a concentrated sets of
+         compatitility fixes for old guile versions.
+
+       * Fixes for guile 1.4, including embedded ps.
+
+2001-11-30  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/stanza-number-engraver.cc (process_music): allow pairs as
+       well for markup texts.
+
+       * lily/musical-request.cc (length_mom): kludge for null pointer.
+
+       * scm/sketch.scm (sketch-output-expression): guile 1.4 compatibility
+
+       * scm/lily.scm (sign): bugfix
+
+       * CHANGES: Change log instated.
+
+       * stepmake/add-html-footer.py: @BRANCH@ tag insertion.
+
index 623caf71893593a85ad34e673635be16f518a6eb..3876f3b648e66b36b661ee2e1ab95f9ca2c5978d 100644 (file)
@@ -64,6 +64,8 @@ documenting bugfixes.
 
 @lilypondfile[printfilename]{glissando.ly}
 
+@lilypondfile[printfilename]{fingering.ly}
+
 @section Dynamics
 
 @lilypondfile[printfilename]{dynamics-line.ly}
index e54217156990ed97cfac0856f4076e161749de4a..61cf08e3b9fcc8520169295b827655373f5d1a33 100644 (file)
@@ -531,7 +531,7 @@ interfere with your build, you may want to do this before the build too:
 @end example
 
 
-
+@c Why isn't this in BUGS (where it belongs?)
 @section Problems
 
 For help and questions use @email{lilypond-user@@gnu.org}.  Please
@@ -554,6 +554,21 @@ LilyPond with gcc-3.0 you may do:
 
 Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
 
+@unnumberedsubsec Linux-2.4.0, Guile-1.4 --with-threads
+
+There's a bug in certain kernels around version 2.4.0, that is
+triggered when using Guile 1.4 compiled with pthreads.  You'll see
+random segmentation fault crashes of LilyPond.  Upgrade to a newer
+version of Linux.  If you can't do that, you may try to recompiling
+Guile without threads (YMMV):
+
+@example
+         guile-1.4$ ./configure --without-threads; make all install
+@end example
+
+
 @unnumberedsubsec NetBSD
 
 @itemize @bullet
index 0a743133ccdeb91cba0a78cce75d1806de6cc755..627e5a9a92fd51e9c9bfa85b373c7ab1335e7142 100644 (file)
@@ -17,7 +17,7 @@ SUBDIRS = buildscripts scripts flower lily \
 #
 
 SCRIPTS = configure aclocal.m4
-README_FILES =  CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
+README_FILES =  ChangeLog CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
 README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
 IN_FILES := $(wildcard *.in)
 EXTRA_DIST_FILES = lilypond-font-lock.el lilypond-mode.el lilypond-init.el vimrc VERSION $(README_FILES)  $(SCRIPTS) $(IN_FILES)  emacsclient.patch lexer-gcc-3.0.patch
index 972e0c14e503a87bd52cfb9e6aeecae45c7a7e3c..a2b3a793e12079ec6997de594ce44aab331ae0d2 100644 (file)
@@ -27,6 +27,7 @@ INSTALL - compiling and installing GNU LilyPond
     Debian GNU/Linux
   Problems
     FLex-2.5.4a and gcc-3.0
+    Linux-2.4.0, Guile-1.4 -with-threads
     NetBSD
     Solaris:
     AIX
@@ -519,6 +520,17 @@ LilyPond with gcc-3.0 you may do:
 
    Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
 
+Linux-2.4.0, Guile-1.4 -with-threads
+------------------------------------
+
+   There's a bug in certain kernels around version 2.4.0, that is
+triggered when using Guile 1.4 compiled with pthreads.  You'll see
+random segmentation fault crashes of LilyPond.  Upgrade to a newer
+version of Linux.  If you can't do that, you may try to recompiling
+Guile without threads (YMMV):
+
+              guile-1.4$ ./configure --without-threads; make all install
+
 NetBSD
 ------
 
diff --git a/VERSION b/VERSION
index 67692397a302c3052aa7fd99a5833cb297d6b7d9..cb07dab4b84006c027e5b4ce600f39092624db94 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=23
-MY_PATCH_LEVEL=jcn2
+PATCH_LEVEL=24
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 0bf70a244eca3e39b31c6c4bb79b19c152e8c647..299e6b5443e6379809099219a8fbeefa5ebeb48e 100644 (file)
@@ -16,6 +16,13 @@ axis_name_str (Axis a)
   return to_str (char (a + 'x'));
 }
 
+
+Axis
+other_axis (Axis a)
+{
+  return a ==  Y_AXIS ? X_AXIS : Y_AXIS;
+}
+
 /*
   TODO inline these.
  */
index 7293725c03da9ded08492be75553beade65818b1..77653eb0f8b24b306e349ea727f98dcb6f5672bf 100644 (file)
@@ -25,6 +25,7 @@ String axis_name_str (Axis);
 /**
   the operator ++ for Axis. 
  */
+Axis other_axis (Axis); 
 Axis post_incr (Axis &);
 Axis incr (Axis &);
 //Axis operator++ (Axis);
diff --git a/input/regression/beam-quanting.ly b/input/regression/beam-quanting.ly
new file mode 100644 (file)
index 0000000..8339c34
--- /dev/null
@@ -0,0 +1,30 @@
+\header {
+
+texidoc = "Beam quanting can be twiddled using grob
+properties. The following example shows how Y and DY can be
+unquantised and quantised to 0 and 4 respectively."
+
+}
+
+\version "1.5.23"
+
+%{
+Have some fun beam quanting
+%}
+
+% no y quantising
+#(define (beam-vertical-position-quants m dy x y) '())
+
+% rediculous dy quanting
+#(define (beam-height-quants x y) '(0 4))
+
+\score {
+    \notes\relative c'{
+        \property Voice.Beam \override #'height-quants = #beam-height-quants
+        \property Voice.Beam \override #'vertical-position-quant-function =
+       #beam-vertical-position-quants
+        c8 c c c
+        c8 e g a
+        c,8 f b e
+    }
+}
diff --git a/input/regression/fingering.ly b/input/regression/fingering.ly
new file mode 100644 (file)
index 0000000..15c2933
--- /dev/null
@@ -0,0 +1,26 @@
+\header {
+
+texidoc = "Automatic fingering tries to put fingering instructions
+next to noteheads.  scriptHorizontal puts the center fingerings horizontally next to
+the note heads.
+
+For this to function, you have to @code{\apply} pitchify-scripts to
+the music you're dealing with, and you have to do so outside of a
+@code{\relative} block.  "
+
+}
+
+\score {
+
+ \notes\relative c' {
+ c4-4
+  <c-1 f-4>
+  < c-1 e-2 g-3  b-4 >
+\apply #pitchify-scripts \relative c'  { c4-4
+  <c-1 f-4>
+ < c-1 e-2 g-3  b-4 >
+ \property Voice.scriptHorizontal = ##t
+   <c-1 f-4>
+   <c-1 f-4 a-5>   
+ < c-1 e-2 g-3  b-4 >   
+ } } }
index 14b92742d8ef05abb28cdf705f8ece07b073ecca..2917db77dd1a492c568baa96c5035ea5545e93ed 100644 (file)
@@ -5,6 +5,7 @@ filename =       "beam-pos.ly"
 composer =      "jcn"
 enteredby =     "jcn"
 copyright =     "PD"
+title = "Beam quantization"
 
 TestedFeatures =        "beam quant positions"
 }
index 6a08f56b79d35065854b1b0cfe11d61d8f78b275..39a6a9ff3a19b2cb827171aa3a6a80a626777744 100644 (file)
@@ -98,7 +98,7 @@ A2_engraver::acknowledge_grob (Grob_info i)
          Grob*t = text_p_;
          Side_position_interface::add_support (t, i.grob_l_);
          if (Side_position_interface::get_axis (t) == X_AXIS
-             && !t->parent_l (Y_AXIS))
+             && !t->get_parent (Y_AXIS))
            t->set_parent (i.grob_l_, Y_AXIS);
        }
       if (Stem::has_interface (i.grob_l_))
index cb87b5edb34a1ecc15691cf1289c170965e5e3c6..65b83a1b611ca39563e546f1102286229a61d83e 100644 (file)
@@ -90,6 +90,7 @@ number_accidentals (SCM sig, Note_req * note_l)
   if (prev == SCM_BOOL_F)
     prev = scm_assoc (gh_int2scm (n), sig);
   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;
 
@@ -266,7 +267,7 @@ Accidental_engraver::stop_translation_timestep ()
 void
 Accidental_engraver::acknowledge_grob (Grob_info info)
 {
-  Note_req * note_l =  dynamic_cast <Note_req *> (info.req_l_);
+  Note_req * note_l =  dynamic_cast <Note_req *> (info.music_cause ());
 
   if (note_l && Rhythmic_head::has_interface (info.grob_l_))
     {
index 42d7846cb4a9ac28b355113628c27628c86359f2..4c5151b6d5ae77381f685ec121a4985f97d33e25 100644 (file)
@@ -20,7 +20,7 @@ Align_interface::alignment_callback (SCM element_smob, SCM axis)
 {
   Grob * me = unsmob_grob (element_smob);
   Axis ax = (Axis)gh_scm2int (axis);
-  Grob * par = me->parent_l (ax);
+  Grob * par = me->get_parent (ax);
   if (par && !to_boolean (par->get_grob_property ("alignment-done")))
     {
       Align_interface::align_elements_to_extents (par, ax);
@@ -34,7 +34,7 @@ Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
 {
   Grob * me = unsmob_grob (element_smob);
   Axis ax = (Axis)gh_scm2int (axis);
-  Grob * par = me->parent_l (ax);
+  Grob * par = me->get_parent (ax);
   if (par && !to_boolean (par->get_grob_property ("alignment-done")))
     {
       Align_interface::align_to_fixed_distance (par, ax);
index 8a5513c3e6229a2c0757c7a4d23ba2b65e848d2a..f366159596ef19c4d2f19a20a489eb0b4c39fc73 100644 (file)
@@ -85,7 +85,7 @@ Arpeggio_engraver::create_grobs ()
       
       for (int i = 0; i < stems_.size (); i++)
        {
-         Pointer_group_interface::add_element (arpeggio_, "stems", stems_[i]);
+         Pointer_group_interface::add_element (arpeggio_, ly_symbol2scm ("stems"), stems_[i]);
        }
       for (int i = 0; i < supports_.size (); i++)
        {
index 8d13e857df326e12807e3a9e9656768513784d2b..54ac1c8ead3a3219796acf6fbce2f0c69c64df93 100644 (file)
@@ -360,7 +360,7 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
     {
       Item* stem_l = dynamic_cast<Item *> (info.grob_l_);
                                       
-      Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
+      Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
       if (!rhythmic_req)
        {
          programming_error ("Stem must have rhythmic structure");
index 413f1b678919274213ecc58a36a9007c814e839a..e030e09b4bea828be33ce40f1fcc7241d3319db6 100644 (file)
@@ -28,8 +28,7 @@ protected:
   virtual Spanner* get_spanner_p () const;
   virtual void add_element (Grob*) ;
 public:  
-TRANSLATOR_DECLARATIONS(
-  Axis_group_engraver );
+TRANSLATOR_DECLARATIONS(Axis_group_engraver );
 };
 
 
@@ -107,7 +106,7 @@ Axis_group_engraver::create_grobs ()
   /* UGH UGH UGH */
   for (int i=0; i < elts_.size (); i++)
     {
-      Grob *par = elts_[i]->parent_l (Y_AXIS);
+      Grob *par = elts_[i]->get_parent (Y_AXIS);
 
       if ((!par || !Axis_group_interface::has_interface (par))
          && ! elts_[i]->empty_b (Y_AXIS))
index 02960f6aba86bc48e5214622d2e9c5e7356483a4..34541a5a5d8d843082c6090446cb5f60e434cf59 100644 (file)
@@ -17,11 +17,11 @@ Axis_group_interface::add_element (Grob*me,Grob *e)
     {
       Axis a = (Axis) gh_scm2int (ly_car (ax));
       
-      if (!e->parent_l (a))
+      if (!e->get_parent (a))
        e->set_parent (me, a);
     }
 
-  Pointer_group_interface::add_element (me, "elements", e);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), e);
   me->add_dependency (e);
 }
 
index 3baff066a010494934ef1c53223e21b6a695d449..f457e4cebe59ddf2cf136328548e24b59d1fccc2 100644 (file)
@@ -243,12 +243,12 @@ Beam_engraver::acknowledge_grob (Grob_info info)
          if (Stem::beam_l (stem_l))
            return;
 
-         Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
+         Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
          if (!rhythmic_req)
            {
              String s = _ ("stem must have Rhythmic structure");
-             if (info.req_l_)
-               info.req_l_->origin ()->warning (s);
+             if (info.music_cause ())
+               info.music_cause ()->origin ()->warning (s);
              else
                ::warning (s);
          
index f744b4fff6bbdf75b2e7836a47e15d33060faba7..8bedaa22aff5b318e4131aa76a425e0fefcafd35 100644 (file)
@@ -40,7 +40,7 @@
 void
 Beam::add_stem (Grob*me, Grob*s)
 {
-  Pointer_group_interface:: add_element (me, "stems", s);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("stems"), s);
   
   s->add_dependency (me);
 
index a463ba7bf05063b537d0d27823e3366662d36be3..6cafa97a585b646cc85582cdd64913345f7497ff 100644 (file)
@@ -28,10 +28,6 @@ public:
   TRANSLATOR_DECLARATIONS(Break_align_engraver);
 };
 
-
-
-
-
 void
 Break_align_engraver::add_column (SCM smob)
 {
@@ -88,7 +84,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf)
 {
   if (Item * item_l = dynamic_cast <Item *> (inf.grob_l_))
     {
-      if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
+      if (item_l->empty_b (X_AXIS) || item_l->get_parent (X_AXIS))
        return;
 
       SCM bp=item_l->get_grob_property ("breakable");
index 8349ce5e632fae99716e7944a3d3e87b8b2e289a..be0b995068908554c7e82e5a8b79beb071a35d14 100644 (file)
@@ -39,7 +39,7 @@ Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
   Axis a = (Axis) gh_scm2int (axis);
 
   assert (a == X_AXIS);
-  Grob *par = me->parent_l (a);
+  Grob *par = me->get_parent (a);
   if (par && !to_boolean (par->get_grob_property ("break-alignment-done")))\
     {
       par->set_grob_property ("break-alignment-done", SCM_BOOL_T);
index 61e1faab4b216ebe326bf9313dc50aaf01b43dfb..0a78017c8fe5b0a39d25f9580b0a3acc8734357c 100644 (file)
@@ -80,7 +80,7 @@ Chord_name_engraver::try_music (Music* m)
 void
 Chord_name_engraver::acknowledge_grob (Grob_info i)
 {
-  if (Note_req* n = dynamic_cast<Note_req*> (i.req_l_))
+  if (Note_req* n = dynamic_cast<Note_req*> (i.music_cause ()))
     add_note (n);
 }
 
index 50f16f5e5c7c3324174dbc35babf9dc4222f5026..d3ff4fa6929b0b546b5054d586048a57b1dddc04 100644 (file)
@@ -184,15 +184,15 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
            }
          s->set_grob_property ("direction", d);
 
-         if (dynamic_cast <Rhythmic_req *> (info.req_l_))
+         if (dynamic_cast <Rhythmic_req *> (info.music_cause ()))
            {
              Beam::add_stem (beam_p_, s);
            }
          else
            {
              String s = _ ("stem must have Rhythmic structure");
-             if (info.req_l_)
-               info.req_l_->origin ()->warning (s);
+             if (info.music_cause ())
+               info.music_cause ()->origin ()->warning (s);
              else
                ::warning (s);
            }
index eb52ebd0f8f7e95fb516885ff66af1ba7ab61320..379fde5e16e5361991e6a7553ae798b13154616e 100644 (file)
@@ -52,7 +52,7 @@ Collision_engraver::acknowledge_grob (Grob_info i)
   if (Note_column::has_interface (i.grob_l_))
     {
       /*should check Y axis? */
-      if (Note_column::rest_b (i.grob_l_) || i.grob_l_->parent_l (X_AXIS))
+      if (Note_column::rest_b (i.grob_l_) || i.grob_l_->get_parent (X_AXIS))
        return ;
 
       note_column_l_arr_.push (i.grob_l_);
index 87d9a7671dc9267b1ed065a8d3824a8f0c910111..288b2a2fa09e629a560d76726f1919f1596e107a 100644 (file)
@@ -24,7 +24,7 @@ Collision::force_shift_callback (SCM element_smob, SCM axis)
   Axis a = (Axis) gh_scm2int (axis);
   assert (a == X_AXIS);
   
-   me = me->parent_l (a);
+   me = me->get_parent (a);
   /*
     ugh. the way DONE is done is not clean
    */
index 0763cd7431205f52277b2e2fbaede9afa2c5413c..faec3cd556d0df940823e532484188f66aa95587 100644 (file)
@@ -85,7 +85,7 @@ Custos_engraver::acknowledge_grob (Grob_info info)
            don't look at the staff-position, since we can't be sure
            whether Clef_engraver already applied a vertical shift.
          */
-         Note_req * nr = dynamic_cast<Note_req*> (info.req_l_);
+         Note_req * nr = dynamic_cast<Note_req*> (info.music_cause ());
          if (nr)
            pitches_.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
        }
index ba07971a1a40c79e0fb332d4f31a483bc1adfbbc..f59a32c20a1ed4315c99b6ad10a90a4166b47e35 100644 (file)
@@ -23,7 +23,7 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis)
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) gh_scm2int (axis);
   assert (a == Y_AXIS);
-  me = me->parent_l (X_AXIS);
+  me = me->get_parent (X_AXIS);
   SCM l = me->get_grob_property ("dots");
   do_shifts (l);
   return gh_double2scm (0.0);
@@ -135,7 +135,7 @@ Dot_column::add_head (Grob * me, Grob *rh)
     {
       Side_position_interface::add_support (me,rh);
 
-      Pointer_group_interface ::add_element (me, "dots",d);
+      Pointer_group_interface::add_element (me, ly_symbol2scm ("dots"), d);
       d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
       Axis_group_interface::add_element (me, d);
     }
index 347d1a7022aa4ed872dd36bec8ae954f664c9a86..90027d1309fa9a68472422174dc1a23cae29f804 100644 (file)
@@ -23,13 +23,18 @@ Engraver::announce_grob (Grob_info inf)
 void
 Engraver::announce_grob (Grob* e, Music *m)
 {
+  /*
+    TODO: junk grob-info, and make a cause grob-property to store
+    `causes' generically.
+  */
+  
   if (m && store_locations_global_b 
       && m->origin ()->location_str ().length_i ())
     {
       e->set_grob_property ("origin", m->get_mus_property ("origin"));
     }
   
-  Grob_info i (e, m);
+  Grob_info i (e, m ? m->self_scm () : SCM_UNDEFINED);
   if (!i.origin_trans_l_)
     i.origin_trans_l_ = this;
   daddy_grav_l ()->announce_grob (i);
diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc
new file mode 100644 (file)
index 0000000..afdd548
--- /dev/null
@@ -0,0 +1,247 @@
+/*   
+  fingering-engraver.cc --  implement Fingering_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+
+#include "engraver.hh"
+#include "side-position-interface.hh"
+#include "item.hh"
+#include "musical-request.hh"
+#include "stem.hh"
+#include "rhythmic-head.hh"
+
+class Fingering_engraver : public Engraver
+{
+  Link_array<Music> reqs_;
+  Link_array<Item> fingerings_;
+
+  Link_array<Music> up_reqs_;
+  Link_array<Music> hor_reqs_;
+  Link_array<Music> down_reqs_;
+    
+public:
+  TRANSLATOR_DECLARATIONS(Fingering_engraver);
+protected:
+  virtual bool try_music (Music* m);
+  virtual void stop_translation_timestep ();
+  virtual void start_translation_timestep ();
+  virtual void process_music ();
+  virtual void acknowledge_grob (Grob_info);
+
+  void make_script (Direction, Music*,Axis, int);
+};
+
+bool
+Fingering_engraver::try_music (Music *m)
+{
+  if (dynamic_cast<Text_script_req*> (m))
+    {
+      if (m->get_mus_property ("text-type") != ly_symbol2scm ("finger"))
+       return false;
+      
+      reqs_.push (m);
+      return true;
+    }
+  return false;
+}
+
+void
+Fingering_engraver::acknowledge_grob (Grob_info inf)
+{
+  
+  if (Stem::has_interface (inf.grob_l_))
+    {
+      for (int i=0; i < fingerings_.size (); i++)
+       {
+         Side_position_interface::add_support (fingerings_[i],inf.grob_l_);
+       }
+    }
+  else if (Rhythmic_head::has_interface (inf.grob_l_))
+    {
+      Music * mc =inf.music_cause ();
+      Pitch * mp = mc? unsmob_pitch (mc->get_mus_property ("pitch")) :0;
+      for (int i=0; i < fingerings_.size (); i++)
+       {
+         Grob*t = fingerings_[i];
+         Side_position_interface::add_support (t,inf.grob_l_);
+         Pitch *fp = unsmob_pitch (t->get_grob_property ("pitch"));
+         if (fp)
+           {
+             if (!mp)
+               continue;
+       
+             if (*fp == *mp)
+               {
+                 Axis other = other_axis (Side_position_interface::get_axis (t));
+                 t->set_parent (inf.grob_l_, other);
+               }
+           }
+         else
+           {
+             if (!t->get_parent (X_AXIS))
+               t->set_parent (inf.grob_l_, X_AXIS);
+           }
+       }
+    }
+}
+
+static int
+req_compare (Music * const &a,Music * const &b)
+{
+  Pitch *pa  = unsmob_pitch (a->get_mus_property ("pitch"));
+  Pitch *pb  = unsmob_pitch (b->get_mus_property ("pitch"));
+
+  if (!pa && !pb)
+    return 0;
+  if (pa && !pb)
+    return 1;
+  if (!pa && pb)
+    return -1;
+
+  return Pitch::compare (*pa, *pb);
+}
+
+void
+Fingering_engraver::process_music ()
+{
+  if (!reqs_.size())
+    return ;
+  
+  Link_array<Music> pitch_sorted_reqs = reqs_;
+  for (int i= pitch_sorted_reqs.size(); i--;)
+    {
+      SCM dir = pitch_sorted_reqs[i]->get_mus_property ("direction");
+      if (isdir_b (dir) && to_dir (dir)) {
+       if (to_dir (dir) == UP)
+         up_reqs_.push (pitch_sorted_reqs[i]);
+       else if (to_dir (dir) == DOWN)
+         down_reqs_ .push (pitch_sorted_reqs[i]);
+       pitch_sorted_reqs.del(i);
+
+       continue ; 
+      }
+      else if (!unsmob_pitch (pitch_sorted_reqs[i]->get_mus_property ("pitch")))
+       {
+         /*
+           chuck out reqs that have no pitch.  We put them over the note by default.
+       */
+         up_reqs_.push (pitch_sorted_reqs [i]);
+         pitch_sorted_reqs.del (i);
+       }
+    }  
+  up_reqs_.reverse ();
+  down_reqs_.reverse ();
+  
+  pitch_sorted_reqs.sort (&req_compare);
+
+  if (to_boolean (get_property ("scriptHorizontal")))
+    {
+#if 1 // -> 0 for testing horizontal fingerings.
+      
+      down_reqs_.push  ( pitch_sorted_reqs[0]);
+      pitch_sorted_reqs.del (0);
+
+      if (pitch_sorted_reqs.size())
+       {
+         up_reqs_.push (pitch_sorted_reqs.top ());
+         pitch_sorted_reqs.pop();
+       }
+#endif
+      hor_reqs_ = pitch_sorted_reqs;
+    }
+  else
+    {
+      int sz = pitch_sorted_reqs.size ();
+      down_reqs_.concat (pitch_sorted_reqs.slice(0, (sz + sz%2)/2 ));
+      up_reqs_.concat (pitch_sorted_reqs.slice((sz + sz%2)/2, sz));
+      hor_reqs_ .clear ();
+    }
+
+  for (int i = 0; i < down_reqs_.size();i++)
+    make_script (DOWN,  down_reqs_[i], Y_AXIS, i);
+  for (int i = 0; i < up_reqs_.size();i++)
+    make_script (UP,   up_reqs_[i], Y_AXIS, i);
+  for (int i = 0; i < hor_reqs_.size();i++)
+    make_script (CENTER,  hor_reqs_[i],X_AXIS, i);
+}
+
+void
+Fingering_engraver::make_script (Direction d, Music *r,Axis a,  int i)
+{
+  Item *fingering = new Item (get_property ("Fingering"));
+
+  Axis other = other_axis (a);
+
+  SCM pitch = r->get_mus_property ("pitch");
+  if (unsmob_pitch (pitch))
+    fingering->set_grob_property ("pitch", pitch);
+  
+  Side_position_interface::set_axis (fingering, a);
+      
+  fingering->add_offset_callback (Side_position_interface::aligned_on_self_proc, other);
+  fingering->add_offset_callback (Side_position_interface::centered_on_parent_proc, other);
+  fingering->set_grob_property ("script-priority",
+                               gh_int2scm (100 + d* i));
+
+
+  if (!isdir_b (fingering->get_grob_property ("direction")))
+    {
+      if (d)
+       fingering->set_grob_property ("direction", gh_int2scm (d));
+      else
+       fingering->set_grob_property ("direction",  gh_int2scm (RIGHT));
+    }
+  
+  fingering->set_grob_property ("text", r->get_mus_property ("text"));
+  
+  SCM nonempty = get_property ("textNonEmpty");
+  if (to_boolean (nonempty))
+    /*
+      empty fingering: signal that no rods should be applied.  
+    */
+    fingering->set_grob_property ("no-spacing-rods" , SCM_BOOL_F);
+               
+  announce_grob (fingering, r);
+  fingerings_.push (fingering);
+}
+
+void
+Fingering_engraver::stop_translation_timestep ()
+{
+  if (!fingerings_.size ())
+    return;
+  
+  for (int i=0; i < fingerings_.size (); i++)
+    {
+      Item *ti = fingerings_[i];
+      Side_position_interface::add_staff_support (ti);
+      typeset_grob (ti);
+    }
+  fingerings_.clear ();
+}
+
+void
+Fingering_engraver::start_translation_timestep ()
+{
+  reqs_.clear ();
+  up_reqs_.clear ();
+  down_reqs_.clear ();
+  hor_reqs_.clear ();
+}
+
+Fingering_engraver::Fingering_engraver()
+{
+
+}
+
+ENTER_DESCRIPTION(Fingering_engraver,
+/* descr */       "Create fingering-scripts",
+/* creats*/       "Fingering",
+/* acks  */       "rhythmic-head-interface stem-interface",
+/* reads */       "scriptHorizontal textNonEmpty",
+/* write */       "");
index 542e9698bbb96b558d589a10ff74d1bac7513d6a..e1d60b3195b06a1be4deb03cc0e11af6beb05586 100644 (file)
 #include "translator.hh"
 #include "translator-group.hh"
 
-Grob_info::Grob_info (Grob*s_l, Music *r_l)
+Grob_info::Grob_info (Grob*s_l, SCM c)
 {
   grob_l_ = s_l;
-  req_l_ = r_l;
+  cause_ = c; 
   origin_trans_l_ = 0;  
 }
 
@@ -22,10 +22,15 @@ Grob_info::Grob_info (Grob*s_l, Music *r_l)
 Grob_info::Grob_info ()
 {
   grob_l_ = 0;
-  req_l_ = 0;
+  cause_ = SCM_EOL;
   origin_trans_l_ = 0;
 }
 
+Music*
+Grob_info::music_cause ()
+{
+  return unsmob_music (cause_);
+}
 
 Link_array<Translator>
 Grob_info::origin_trans_l_arr (Translator* end) const
index 4251e16c5edb9594cb8d884c6ee5728e896e018e..fd519adb7498a1e17d3a43addc77b3a93c6ac82b 100644 (file)
@@ -330,8 +330,7 @@ Grob::add_dependency (Grob*e)
 {
   if (e)
     {
-      Pointer_group_interface ::add_element (this, "dependencies",e);
-
+      Pointer_group_interface::add_element (this, ly_symbol2scm ("dependencies"),e);
     }
   else
     programming_error ("Null dependency added");
@@ -719,7 +718,7 @@ Grob::fixup_refpoint (SCM smob)
   for (int a = X_AXIS; a < NO_AXES; a ++)
     {
       Axis ax = (Axis)a;
-      Grob * parent = me->parent_l (ax);
+      Grob * parent = me->get_parent (ax);
 
       if (!parent)
        continue;
@@ -770,7 +769,7 @@ Grob::mark_smob (SCM ses)
     {
       scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
       scm_gc_mark (s->dim_cache_[a].dimension_);
-      Grob *p = s->parent_l (Y_AXIS);
+      Grob *p = s->get_parent (Y_AXIS);
       if (p)
        scm_gc_mark (p->self_scm ());
     }
index 3734882ceed0a855441d2183069c98ab9e091cd1..74bd4ad75164eb07866d41ac8b9b3d796d61cb1b 100644 (file)
 #include "grob.hh"
 
 
+/*
+  This special add_thing routine is slightly more efficient than
+
+    set_prop (name,cons (thing, get_prop (name)))
+
+  since it can reuse the handle returned by scm_assq().
+*/
+
 void
-Group_interface::add_thing (Grob*me, String name, SCM s)
+Group_interface::add_thing (Grob*me, SCM sym, SCM thing)
 {
-  me->set_grob_property (name.ch_C (),
-                           gh_cons (s, me->get_grob_property (name.ch_C ())));
+  SCM handle = scm_sloppy_assq (sym, me->mutable_property_alist_);
+  if (handle != SCM_BOOL_F)
+    {
+      gh_set_cdr_x (handle, gh_cons (thing, gh_cdr (handle)));
+      
+    }
+  else
+    {
+      /*
+       There is no mutable prop yet, so create an entry, and put it in front of the
+       mutable prop list.
+      */
+      handle = scm_sloppy_assq (sym, me->immutable_property_alist_);
+      SCM tail = (handle != SCM_BOOL_F) ? gh_cdr(handle) : SCM_EOL;
+      me->mutable_property_alist_ = gh_cons (gh_cons (sym, gh_cons (thing, tail)),
+                                            me->mutable_property_alist_);
+    }
 }
 
+void
+Group_interface::add_thing (Grob*me, String name, SCM thing)
+{
+  add_thing (me, ly_symbol2scm (name.ch_C()), thing);
+}
 
 int
 Group_interface::count (Grob *me, String name)
@@ -26,7 +54,7 @@ Group_interface::count (Grob *me, String name)
 
 
 void
-Pointer_group_interface::add_element (Grob*me, String name, Grob*p) 
+Pointer_group_interface::add_element (Grob*me, SCM name, Grob*p) 
 {
   Group_interface::add_thing (me, name, p->self_scm ());
 }
index 909a49d18334d08265736f1fe37e4d1d66fd6af4..11ac30e8ac0bb633f53facdb559e9c5d4b314e07 100644 (file)
@@ -70,7 +70,7 @@ Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, S
   Grob *daughter = unsmob_grob (element_smob);
   Axis a = (Axis) gh_scm2int (axis);
   assert (a == Y_AXIS);
-  force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), axis);
+  force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
   return gh_double2scm (0.0);
 }
 
@@ -99,5 +99,5 @@ void
 Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n)
 {
   me->add_dependency (n);
-  Pointer_group_interface::add_element (me, "items-worth-living",n);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("items-worth-living"),n);
 }
index ad399d4119cd463928d213adbc98f800606bd5c6..6d8868214c033bf31b53639ed1e0a58cef24c9ed 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef STAFFELEMINFO_HH
 #define STAFFELEMINFO_HH
 
+#include "lily-guile.hh"
 #include "lily-proto.hh"
 #include "parray.hh"
 
 struct Grob_info {
   Translator * origin_trans_l_;
   friend class Engraver;
-public:
-  Link_array<Translator> origin_trans_l_arr (Translator*) const;
 
   Grob * grob_l_;
-  Music *req_l_;
-  
-  Grob_info (Grob*, Music*);
+
+  /*
+    Notice that CAUSE is not GC protected ; this might be a cause for
+    GC errors if you don't use music or grobs as a cause.
+  */
+  SCM cause_;
+
+public:
+  Music * music_cause ();
+  Link_array<Translator> origin_trans_l_arr (Translator*) const;
+  Grob_info (Grob*, SCM);
   Grob_info ();
 };
 
index e9665ea31b6057f4b75d96cdc740ca0f290f4998..228a73fc60313929a3a5f3f9a111d7995ef7a589 100644 (file)
@@ -176,7 +176,7 @@ public:
    */
   void set_parent (Grob* e, Axis);
   
-  Grob *parent_l (Axis a) const {   return  dim_cache_[a].parent_l_; }
+  Grob *get_parent (Axis a) const {   return  dim_cache_[a].parent_l_; }
   DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
 };
 
index 7a07bccd6dbb298b9b5f03cbf123f6ed9d5361ab..8df58bce5b527d460aa6874f90edf7d9f376d963 100644 (file)
@@ -27,12 +27,13 @@ struct Group_interface
 {
 public:
   static int count (Grob*  , String);
+  static void add_thing (Grob*, SCM, SCM);
   static void add_thing (Grob*, String nm, SCM);
 };
 
 struct Pointer_group_interface : public Group_interface {
 public:
-  static void add_element (Grob*, String nm, Grob*e);
+  static void add_element (Grob*, SCM nm, Grob*e);
 };
 /** 
   Put all score elements of ELT's property called NAME into an array,
index cd3e27b315eacc767470acac68a9c15ba6134f40..4b2e2d27dced744a91b5cd2ae399b8907a481035 100644 (file)
@@ -77,8 +77,6 @@ struct Melodic_req :virtual Request
   static int compare (Melodic_req const&,Melodic_req const&);
   
 protected:
-  /// transpose. #delta# is relative to central c.
-  virtual void transpose (Pitch delta);
   virtual bool do_equal_b (Request const*) const;
 
   VIRTUAL_COPY_CONS (Music);
index f44eba230e563f8d72a82b858a04ac512e4fd2f0..3b03eae29f1079e76269fa0efd6dc927805eb3cc 100644 (file)
@@ -21,7 +21,8 @@ class Note_head
 {
 public:
   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
-  static Molecule ledger_lines (Grob*,int,Direction,Interval);
+  static Interval head_extent (Grob*,Axis);
+  static Molecule ledger_lines (Grob*, bool, int,Direction,Interval);
   static Molecule ledger_line (Interval, Grob*) ;
   DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM ));
   static bool has_interface (Grob*);
diff --git a/lily/include/note-spacing.hh b/lily/include/note-spacing.hh
new file mode 100644 (file)
index 0000000..ed92e06
--- /dev/null
@@ -0,0 +1,21 @@
+/*   
+note-spacing.hh -- declare Note_spacing
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef NOTE_SPACING_HH
+#define NOTE_SPACING_HH
+
+#include "lily-proto.hh"
+
+class Note_spacing
+{
+public:
+  static bool has_interface (Grob*);  
+};
+
+#endif /* NOTE_SPACING_HH */
diff --git a/lily/include/staff-spacing.hh b/lily/include/staff-spacing.hh
new file mode 100644 (file)
index 0000000..9617c5c
--- /dev/null
@@ -0,0 +1,21 @@
+/*   
+staff-spacing.hh -- declare Staff_spacing
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef STAFF_SPACING_HH
+#define STAFF_SPACING_HH
+
+#include "lily-proto.hh"
+
+class Staff_spacing
+{
+public:
+  static bool has_interface (Grob*);  
+};
+
+#endif /* STAFF_SPACING_HH */
index 6fae06efb950b74d174e430202b8a601ffec3969..4447f3f64f542fb0654e9ac3c5a4ba89482d2123 100644 (file)
@@ -40,21 +40,21 @@ Item::breakable_b (Grob*me)
   if (!dynamic_cast<Item*> (me))
     programming_error ("only items can be breakable.");
   
-  Item * i  =dynamic_cast<Item*> (me->parent_l (X_AXIS));
+  Item * i  =dynamic_cast<Item*> (me->get_parent (X_AXIS));
   return (i) ?  Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
 }
 
 Paper_column *
 Item::column_l () const
 {
-  Item *parent = dynamic_cast<Item*> (parent_l (X_AXIS));
+  Item *parent = dynamic_cast<Item*> (get_parent (X_AXIS));
   return parent ? parent->column_l () : 0;
 }
 
 Line_of_score *
 Item::line_l () const
 {
-  Grob *g = parent_l (X_AXIS);
+  Grob *g = get_parent (X_AXIS);
   return g ?  g->line_l () : 0;
 }
 
index a324aef2d890d246ccbdf8607d58af0c582425ae..958e405ef758ee975fc38ab5e554819691251f8e 100644 (file)
@@ -24,7 +24,7 @@ Line_group_engraver_group::Line_group_engraver_group ()
 void
 Line_group_engraver_group::typeset_grob (Grob *elem)
 {
-  if (!elem->parent_l (Y_AXIS))      
+  if (!elem->get_parent (Y_AXIS))      
     Axis_group_interface::add_element (staffline_p_, elem);
   Engraver_group_engraver::typeset_grob (elem);
 }
index 464cd4e6abd75458a467a484181d8e0869f2731d..5ae17470b196773e4c8c08ddc20d026227e9c3e5 100644 (file)
@@ -51,7 +51,7 @@ void
 Line_of_score::typeset_grob (Grob * elem_p)
 {
   elem_p->pscore_l_ = pscore_l_;
-  Pointer_group_interface::add_element (this, "all-elements",elem_p);
+  Pointer_group_interface::add_element (this, ly_symbol2scm ("all-elements"),elem_p);
   scm_gc_unprotect_object (elem_p->self_scm ());
 }
 
@@ -63,6 +63,7 @@ Line_of_score::output_lines ()
     {
       unsmob_grob (ly_car (s))->do_break_processing ();
     }
+
   /*
     fixups must be done in broken line_of_scores, because new elements
     are put over there.  */
@@ -77,7 +78,6 @@ Line_of_score::output_lines ()
        }
       count += scm_ilength (all);
     }
-
   
   /*
     needed for doing items.
@@ -164,8 +164,8 @@ set_loose_columns (Line_of_score* which, Column_x_positions const *posns)
 
       right = loose;
 
-      Real rx = right->relative_coordinate (right->parent_l (X_AXIS), X_AXIS);
-      Real lx = left->relative_coordinate (left->parent_l (X_AXIS), X_AXIS);
+      Real rx = right->relative_coordinate (right->get_parent (X_AXIS), X_AXIS);
+      Real lx = left->relative_coordinate (left->get_parent (X_AXIS), X_AXIS);
 
       int j = 1;
       loose = col;
@@ -365,7 +365,7 @@ Line_of_score::post_processing (bool last_line)
   /*
     generate all molecules  to trigger all font loads.
 
- (ugh. This is not very memory efficient.)  */
   (ugh. This is not very memory efficient.)  */
   for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
     {
       unsmob_grob (ly_car (s))->get_molecule ();
index 9870a13a883dcfc7bf28ec01b1419c42e6616114..ac54514748b9b325abff690a2c97a6ed79c92667 100644 (file)
@@ -223,7 +223,7 @@ Multi_measure_rest::brew_molecule (SCM smob)
 void
 Multi_measure_rest::add_column (Grob*me,Item* c)
 {
-  Pointer_group_interface::add_element (me, "columns",c);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("columns"),c);
 
   add_bound_item (dynamic_cast<Spanner*> (me),c);
 }
index 178a602aa74a1340a0a5f5a25a520e957cd3f7d9..50d20245b2ddf5f61a55e2bc4565a6b1f4336762 100644 (file)
@@ -130,8 +130,22 @@ Music::to_relative_octave (Pitch m)
 
 
 void
-Music::transpose (Pitch)
+Music::transpose (Pitch delta)
 {
+  Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
+  if (!p)
+    return ;
+
+  Pitch np = *p;
+  np.transpose (delta);
+  
+  if (abs (np.alteration_i_) > 2)
+    {
+       warning (_f ("Transposition by %s makes accidental larger than two",
+         delta.str ()));
+    }
+
+  set_mus_property ("pitch", np.smobbed_copy ());
 }
 
 IMPLEMENT_TYPE_P (Music, "music?");
index 7ed6f00438233220c2eb453e20d0600feaa492ed..5b9c8bf6ec98ee1ca7242eae8d171279d025e580 100644 (file)
@@ -16,22 +16,6 @@ Tremolo_req::Tremolo_req ()
 {
 }
 
-void
-Melodic_req::transpose (Pitch delta)
-{
-  Pitch p = *unsmob_pitch (get_mus_property ("pitch"));
-  
-  p.transpose (delta);
-  
-  if (abs (p.alteration_i_) > 2)
-    {
-       warning (_f ("Transposition by %s makes accidental larger than two",
-         delta.str ()));
-    }
-
-  set_mus_property ("pitch", p.smobbed_copy ());
-}
-
 bool
 Melodic_req::do_equal_b (Request const* r) const
 {
@@ -47,13 +31,16 @@ Rhythmic_req::do_equal_b (Request const* r) const
   return rh; // ;  && !compare (*this, *rh);
 }
 
-
-
 Moment
 Rhythmic_req::length_mom () const
 {
-  Duration* d = unsmob_duration (get_mus_property ("duration"));
-  return d ? d->length_mom () : Moment (0);
+  Duration *d = unsmob_duration (get_mus_property ("duration"));
+  if (!d){
+    Moment m ;
+    programming_error("Rhythmic_req has no duration");
+    return m;
+  }
+  return d->length_mom ();
 }
 
 void
index 5fc0aaf4987eff3836db7b5122f6e252224c12ee..9ec228cad14dcd12997a77372b0fd2f69b8658df 100644 (file)
@@ -7,6 +7,7 @@
   
  */
 
+
 #include "paper-column.hh"
 #include "dimensions.hh"
 #include "paper-def.hh"
index 9a0cdf8a9bc11498cb4c59a0af2b4fc42a77343c..56a29d08a3d313501e0d8db8241e2fe28018206a 100644 (file)
@@ -100,7 +100,7 @@ Note_column::add_head (Grob*me,Grob *h)
     }
   else if (Note_head::has_interface (h))
     {
-      Pointer_group_interface::add_element (me, "note-heads",h);
+      Pointer_group_interface::add_element (me, ly_symbol2scm ("note-heads"),h);
     }
   Axis_group_interface::add_element (me, h);
 }
index 9c894986e371603f37c1bfc91d7fdbb82b2ccb62..3b322d29dc25001ef01e61bd5c7dac081cfd8176 100644 (file)
 #include "musical-request.hh"
 #include "rhythmic-head.hh"
 
+/*
+  Note_head contains the code for printing note heads and the ledger lines.
+  
+  TODO: maybe it's worthwhile to split away the Ledger lines into a
+  separate grob.  */
+
 #include "staff-symbol-referencer.hh"
 
 /*
@@ -53,12 +59,25 @@ Note_head::ledger_line (Interval xwid, Grob *me)
 
 
 Molecule
-Note_head::ledger_lines (Grob*me, int count, Direction dir, Interval idw)
+Note_head::ledger_lines (Grob*me,
+                        bool take_space,
+                        int count, Direction dir, Interval idw)
 {
   Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
+
+  /*
+    idw ?
+
+    (who's that ?  :-)
+
+
+    --hwn 
+   */
   Molecule ledger (ledger_line (idw, me));
 
-  ledger.set_empty (true);
+  if (!take_space)
+    ledger.set_empty (true);
+  
   Real offs = (Staff_symbol_referencer::on_staffline (me))
     ? 0.0
     : -dir * inter_f;
@@ -75,13 +94,9 @@ Note_head::ledger_lines (Grob*me, int count, Direction dir, Interval idw)
   return legs;
 }
 
-MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1);
-
-SCM
-Note_head::brew_molecule (SCM smob)  
+Molecule
+internal_brew_molecule (Grob *me,  bool ledger_take_space)
 {
-  Grob *me = unsmob_grob (smob);
-
   int sz = Staff_symbol_referencer::line_count (me)-1;
   int p = (int)  rint (Staff_symbol_referencer::position_f (me));
   int streepjes_i = abs (p) < sz 
@@ -91,7 +106,7 @@ Note_head::brew_molecule (SCM smob)
   SCM style  = me->get_grob_property ("style");
   if (!gh_symbol_p (style))
     {
-      return SCM_EOL;
+      return Molecule();
     }
 
   /*
@@ -106,18 +121,34 @@ Note_head::brew_molecule (SCM smob)
   String name = "noteheads-" + ly_scm2string (scm_primitive_eval (exp));
   Molecule out = Font_interface::get_default_font (me)->find_by_name (name);
 
-  
   if (streepjes_i) 
     {
       Direction dir = (Direction)sign (p);
       Interval hd = out.extent (X_AXIS);
       Real hw = hd.length ()/4;
-      out.add_molecule (ledger_lines (me, streepjes_i, dir,
+      out.add_molecule (Note_head::ledger_lines (me, ledger_take_space, streepjes_i, dir,
                                      Interval (hd[LEFT] - hw,
                                                hd[RIGHT] + hw)));
     }
-  
-  return out.smobbed_copy ();
+  return out;
+}
+
+MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1);
+
+SCM
+Note_head::brew_molecule (SCM smob)  
+{
+  Grob *me = unsmob_grob (smob);
+  return internal_brew_molecule (me, true).smobbed_copy ();
+}
+
+/*
+  Compute the width the head without ledgers.
+ */
+Interval
+Note_head::head_extent (Grob *me, Axis a)
+{
+  return  internal_brew_molecule (me, false).extent (a);
 }
 
 bool
@@ -129,6 +160,10 @@ Note_head::has_interface (Grob*m)
 
 MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1);
 
+/*
+  TODO: ledger lines are causing  a mess again, now with accidentals and
+  ez-note heads.
+ */ 
 SCM
 Note_head::brew_ez_molecule (SCM smob)
 {
@@ -155,8 +190,8 @@ Note_head::brew_ez_molecule (SCM smob)
       Direction dir = (Direction)sign (p);
       Interval hd = m.extent (X_AXIS);
       Real hw = hd.length ()/4;
-      m.add_molecule (ledger_lines (me, streepjes_i, dir,
-                                     Interval (hd[LEFT] - hw,
+      m.add_molecule (ledger_lines (me, false, streepjes_i, dir,
+                                   Interval (hd[LEFT] - hw,
                                                hd[RIGHT] + hw)));
     }
   
index e3eed55cd51dfcb747b7f25003a6cdb0b567ce83..2a9b5e49e450ca59eb1189379d2de90e9e7dc7b4 100644 (file)
@@ -36,6 +36,11 @@ protected:
   virtual void stop_translation_timestep ();
 };
 
+
+Note_heads_engraver::Note_heads_engraver()
+{
+}
+
 bool
 Note_heads_engraver::try_music (Music *m) 
 {
@@ -51,7 +56,6 @@ Note_heads_engraver::try_music (Music *m)
       return now_mom () < note_end_mom_;
     }
   return false;
-  
 }
 
 
@@ -63,8 +67,6 @@ Note_heads_engraver::process_music ()
       Item *note_p  = new Item (get_property ("NoteHead"));
       
       Staff_symbol_referencer::set_interface (note_p);
-
-
       
       Music * req = note_req_l_arr_[i];
       
@@ -107,7 +109,7 @@ Note_heads_engraver::process_music ()
       note_p_arr_.push (note_p);
     }
 }
+
 void
 Note_heads_engraver::stop_translation_timestep ()
 {
@@ -115,6 +117,7 @@ Note_heads_engraver::stop_translation_timestep ()
     {
       typeset_grob (note_p_arr_[i]);
     }
+
   note_p_arr_.clear ();
   for (int i=0; i < dot_p_arr_.size (); i++)
     {
@@ -128,12 +131,8 @@ Note_heads_engraver::stop_translation_timestep ()
 void
 Note_heads_engraver::start_translation_timestep ()
 {
-  
-  
 }
 
-Note_heads_engraver::Note_heads_engraver()
-{}
 
 ENTER_DESCRIPTION(Note_heads_engraver,
 /* descr */       "Generate one or more noteheads from Music of type Note_req.",
diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc
new file mode 100644 (file)
index 0000000..81eb2aa
--- /dev/null
@@ -0,0 +1,17 @@
+/*   
+note-spacing.cc --  implement 
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "note-spacing.hh"
+#include "grob.hh"
+
+bool
+Note_spacing::has_interface (Grob* g)
+{
+  return g && g->has_interface (ly_symbol2scm ("note-spacing-interface"));
+}
index 022451ca8d30bf4bafb66a4f0a0fd245daaf756a..0a7437fead2a9fba1f5685d894f0fbc5e63a6063 100644 (file)
@@ -1091,15 +1091,16 @@ request_chord:
                THIS->push_spot ();
        } /*cont */ simple_element post_requests        {
                Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
-               if (l) {
-                       for (int i=0; i < $1->size (); i++)
-                               l->append_music ($1->elem (i));
-                       for (int i=0; i < $4->size (); i++)
-                               l->append_music ($4->elem (i));
-                       }
-               else
-                       programming_error ("Need Sequence to add music to");
+               
+               $1->concat (*$4);
+               for (int i=0; i < $1->size (); i++) {
+                 Music * m = $1->elem (i);
+                 l->append_music (m);
+               }
                $$ = $3;
+
+               delete $1;
+               delete $4;
        }
        | command_element
        ;
@@ -1250,8 +1251,6 @@ verbose_command_req:
 
        }
        | PENALTY SCM_T         {
-
-               
                Break_req * b = new Break_req;
                SCM s = $2;
                if (!gh_number_p (s))
@@ -1578,7 +1577,6 @@ script_abbreviation:
        }
        ;
 
-
 script_dir:
        '_'     { $$ = DOWN; }
        | '^'   { $$ = UP; }
index cd83bae84089c66f5fe934b14d1663d0f3506ec3..f8546b7456f88d5e0bc425a8d0de95446965c3b2 100644 (file)
@@ -92,7 +92,7 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info)
              Side_position_interface::add_support (p->item_p_, info.grob_l_);
 
              if (Side_position_interface::get_axis (p->item_p_) == X_AXIS
-                 && !p->item_p_->parent_l (Y_AXIS))
+                 && !p->item_p_->get_parent (Y_AXIS))
                p->item_p_->set_parent (info.grob_l_, Y_AXIS);
            }
          if (Stem::has_interface (info.grob_l_))
index 2e78c1782f7d26c4802b6a653d89d0700c047aee..c35d9afa4210799a04171f70dfa4e78f988c3e72 100644 (file)
@@ -92,7 +92,7 @@ Porrectus_engraver::acknowledge_grob (Grob_info info_l_)
 {
   if (Rhythmic_head::has_interface (info_l_.grob_l_))
     {
-      Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.req_l_);
+      Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.music_cause ());
       if (!note_req_l_)
        return;
       right_heads_.push (Grob_pitch_tuple (info_l_.grob_l_, note_req_l_,
index 25ca3af774e08250cd6f5def1705b46791754dd4..3488f5e88074ad09ab4154ce592bde625a9446fb 100644 (file)
 #include "translator-group.hh"
 
 /*
-  JUNKME: should use pushproperty everywhere.
-  
+  This is deprecated, since revert/override should be used
  */
 class Property_engraver : public Engraver
 {
-  /*
-    UGH. Junk Dictionary
-  */
   Scheme_hash_table *prop_dict_;       // junkme
   void apply_properties (SCM, Grob*, Translator_group *origin);
 
@@ -69,7 +65,7 @@ Property_engraver::initialize ()
 void
 Property_engraver::acknowledge_grob (Grob_info i)
 {
- SCM ifs = i.grob_l_->get_grob_property ("interfaces");
 SCM ifs = i.grob_l_->get_grob_property ("interfaces");
   SCM props;
   for (; gh_pair_p (ifs); ifs = ly_cdr (ifs))
     {      
index e81cef84953cfd6474c1c564b72aa7e314b590ef..a521f8aaf92390a8313f6f5a4e2df955d4d95d1d 100644 (file)
@@ -47,7 +47,7 @@ void
 Rest_collision::add_column (Grob*me,Grob *p)
 {
   me->add_dependency (p);
-  Pointer_group_interface::add_element (me, "elements", p);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), p);
 
   /*
     only add callback for the rests, since we don't move anything else.
index 41e3f4a85143e30dcffc23ac33eed31838b6a87c..2957a3f0cf0fe6b96296f1a122741cce783f2d7a 100644 (file)
@@ -20,8 +20,11 @@ class Rhythmic_column_engraver :public Engraver
 {
   Link_array<Grob> rhead_l_arr_;
   Grob * stem_l_;
-  Grob *ncol_p_;
-  Grob *dotcol_l_;
+  Grob * note_column_;
+  Grob * dotcol_l_;
+
+  Grob * last_spacing_;
+  Grob * spacing_;
   
   TRANSLATOR_DECLARATIONS(Rhythmic_column_engraver);
 protected:
@@ -30,15 +33,17 @@ protected:
   virtual void create_grobs ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
-  
 };
 
 
 
 Rhythmic_column_engraver::Rhythmic_column_engraver ()
 {
+  spacing_ =0 ;
+  last_spacing_ = 0;
+  
   stem_l_ =0;
-  ncol_p_=0;
+  note_column_=0;
   dotcol_l_ =0;
 }
 
@@ -48,34 +53,43 @@ Rhythmic_column_engraver::create_grobs ()
 {
   if (rhead_l_arr_.size ())
     {
-      if (!ncol_p_)
+      if (!note_column_)
        {
-         ncol_p_ = new Item (get_property ("NoteColumn"));
-         Note_column::set_interface (ncol_p_);
-         announce_grob (ncol_p_, 0);
+         note_column_ = new Item (get_property ("NoteColumn"));
+         Note_column::set_interface (note_column_);
+         announce_grob (note_column_, 0);
+
+         spacing_ = new Item (get_property ("NoteSpacing"));
+         spacing_->set_grob_property ("left-item", note_column_->self_scm ());
+         announce_grob (spacing_, 0);
+
+         if (last_spacing_)
+           {
+             last_spacing_->set_grob_property ("right-item" , note_column_->self_scm ());
+           }
        }
 
       for (int i=0; i < rhead_l_arr_.size (); i++)
        {
-         if (!rhead_l_arr_[i]->parent_l (X_AXIS))
-           Note_column::add_head (ncol_p_, rhead_l_arr_[i]);
+         if (!rhead_l_arr_[i]->get_parent (X_AXIS))
+           Note_column::add_head (note_column_, rhead_l_arr_[i]);
        }
       rhead_l_arr_.set_size (0);
     }
 
   
-  if (ncol_p_)
+  if (note_column_)
     {
       if (dotcol_l_
-         && !dotcol_l_->parent_l (X_AXIS))
+         && !dotcol_l_->get_parent (X_AXIS))
        {
-         Note_column::set_dotcol (ncol_p_, dotcol_l_);
+         Note_column::set_dotcol (note_column_, dotcol_l_);
        }
 
       if (stem_l_
-         && !stem_l_->parent_l (X_AXIS))
+         && !stem_l_->get_parent (X_AXIS))
        {
-         Note_column::set_stem (ncol_p_, stem_l_);
+         Note_column::set_stem (note_column_, stem_l_);
          stem_l_ = 0;
        }
 
@@ -103,10 +117,10 @@ Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
 void
 Rhythmic_column_engraver::stop_translation_timestep ()
 {
-  if (ncol_p_) 
+  if (note_column_) 
     {
-      typeset_grob (ncol_p_);
-      ncol_p_ =0;
+      typeset_grob (note_column_);
+      note_column_ =0;
     }
 }
 
index 9189ee71eb1a1d9dc28c687f86fbcda42fa58181..09bb7c4b33a1325a02cab8164626a9f3ab1640cf 100644 (file)
@@ -45,10 +45,12 @@ Score_engraver::make_columns ()
   
       command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
 
-      Grob_info i1 (command_column_l_, 0), i2 (musical_column_l_,0);
-
+      Grob_info i1 (command_column_l_, SCM_EOL);
       i1.origin_trans_l_ = this;
+
+      Grob_info i2 (musical_column_l_, SCM_EOL);
       i2.origin_trans_l_ = this;
+
       announce_grob (i1);
       announce_grob (i2);
     }
@@ -190,14 +192,14 @@ Score_engraver::typeset_all ()
        }
       else 
        {
-         if (!elem_p->parent_l (X_AXIS))
+         if (!elem_p->get_parent (X_AXIS))
            {
              bool br = to_boolean (elem_p->get_grob_property ("breakable"));
              Axis_group_interface::add_element (br ? command_column_l_ : musical_column_l_, elem_p);
 
            }
        }
-      if (!elem_p->parent_l (Y_AXIS))
+      if (!elem_p->get_parent (Y_AXIS))
        Axis_group_interface::add_element (scoreline_l_, elem_p);
     }
   elem_p_arr_.clear ();
index b6b53162cf242aa5f50e18695aee92eb022af6cb..14b665acab263b193692b299e2798831196a842f 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  g-script-column-engraver.cc --  implement Script_column_engraver
+  script-column-engraver.cc --  implement Script_column_engraver
   
   source file of the GNU LilyPond music typesetter
   
@@ -72,8 +72,6 @@ Script_column_engraver::create_grobs ()
   if (!scol_p_ && script_l_arr_.size () > 1)
     {
       scol_p_ = new Item (get_property ("ScriptColumn"));
-
-
       announce_grob (scol_p_, 0);
     }
 
@@ -83,6 +81,7 @@ Script_column_engraver::create_grobs ()
        Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
       script_l_arr_.clear ();
     }
+
 }
 
 ENTER_DESCRIPTION(Script_column_engraver,
index 68e21514a70c8d6982142ded5596204ccd0f6559..e5ecb8796091d0a391e58e49a35306706fc9a10e 100644 (file)
@@ -18,7 +18,7 @@ Script_column::add_staff_sided (Grob *me, Item *i)
   if (!gh_number_p (p))
     return;
 
-  Pointer_group_interface::add_element (me, "scripts",i);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("scripts"),i);
   
   me->add_dependency (i);
 }
index 90e448e1003066dbdafc8a83636262f115bb3d33..31a9b82f484ffce19888e8068625e7d5826bbf7b 100644 (file)
@@ -132,12 +132,12 @@ Script_engraver::acknowledge_grob (Grob_info inf)
        {
          Grob *e = script_p_arr_[i];
          
-         if (!e->parent_l (X_AXIS))
+         if (!e->get_parent (X_AXIS))
            {
              e->set_parent (inf.grob_l_, X_AXIS);
            }
          if (Side_position_interface::get_axis (e) == X_AXIS
-             && !e->parent_l (Y_AXIS))
+             && !e->get_parent (Y_AXIS))
            {
              e->set_parent (inf.grob_l_, Y_AXIS);
              e->add_dependency (inf.grob_l_); // ??
index 66935cbd4affb0c63c00838d651d0162aee5ceae..52d25ec48985e3f138f417decd6816ba544a726e 100644 (file)
@@ -131,7 +131,7 @@ Separating_group_spanner::set_spacing_rods (SCM smob)
 void
 Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i)
 {
-  Pointer_group_interface::add_element (me, "elements",i);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), i);
   me->add_dependency (i);
 }
 
index d36a852911a59c6bded27b26746485e24c05f94d..fc4a8c290f1e6605b6ba72c070641d266d393441 100644 (file)
 #include "paper-def.hh"
 #include "engraver.hh"
 #include "axis-group-interface.hh"
+#include "note-spacing.hh"
 
 class Separating_line_group_engraver : public Engraver
 {
 protected:
   Item * break_malt_p_;
   Item * musical_malt_p_;
+  Item * last_musical_malt_p_;
 
+  Grob * last_note_spacing_;
+  Grob * current_note_spacing_;
+  Grob * staff_spacing_;
+  
   Spanner * sep_span_p_;
   
   virtual void acknowledge_grob (Grob_info);
@@ -32,6 +38,10 @@ public:
 
 Separating_line_group_engraver::Separating_line_group_engraver ()
 {
+  last_note_spacing_ = 0;
+  current_note_spacing_ = 0;
+  staff_spacing_ =0;
+  
   sep_span_p_ = 0;
   break_malt_p_ = 0;
   musical_malt_p_ =0;
@@ -60,11 +70,16 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
   Item * it = dynamic_cast <Item *> (i.grob_l_);
   if (!it)
     return;
-  if (it->parent_l (X_AXIS)
-      && it->parent_l (X_AXIS)->has_extent_callback_b
- (Axis_group_interface::group_extent_callback_proc, X_AXIS))
+  if (it->get_parent (X_AXIS)
+      && it->get_parent (X_AXIS)
     ->has_extent_callback_b(Axis_group_interface::group_extent_callback_proc, X_AXIS))
     return;
 
+  if (Note_spacing::has_interface (it)) 
+    {
+      current_note_spacing_ =  it;
+      return ;
+    }
   
   bool ib =Item::breakable_b (it);
   Item *&p_ref_ (ib ? break_malt_p_
@@ -72,13 +87,24 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
 
   if (!p_ref_)
     {
-      p_ref_ = new Item
- (get_property ("SeparationItem"));
-         
+      p_ref_ = new Item (get_property ("SeparationItem"));
+
       if (ib)
        p_ref_->set_grob_property ("breakable", SCM_BOOL_T);
       announce_grob (p_ref_, 0);
+
+      if (p_ref_ == break_malt_p_)
+       {
+         staff_spacing_ = new Item (get_property ("StaffSpacing"));
+         staff_spacing_->set_grob_property ("left-item", break_malt_p_->self_scm ());
+         announce_grob (staff_spacing_, 0);
+
+         if (last_note_spacing_)
+           last_note_spacing_->set_grob_property ("right-item",
+                                                  break_malt_p_->self_scm ());
+       }
     }
+
   Separation_item::add_item (p_ref_,it);
 }
 
@@ -88,17 +114,29 @@ Separating_line_group_engraver::stop_translation_timestep ()
   if (break_malt_p_)
     {
       Separating_group_spanner::add_spacing_unit (sep_span_p_, break_malt_p_);
-      
       typeset_grob (break_malt_p_);
+
       break_malt_p_ =0;
     }
 
+  if (staff_spacing_)
+    {
+      if (musical_malt_p_)
+       staff_spacing_->set_grob_property ("right-item", musical_malt_p_->self_scm());
+
+      typeset_grob (staff_spacing_);
+      staff_spacing_ = 0;
+    }
+  
   if (musical_malt_p_)
     {
       Separating_group_spanner::add_spacing_unit (sep_span_p_, musical_malt_p_);
       typeset_grob (musical_malt_p_);
     }
 
+  last_note_spacing_ = current_note_spacing_ ;
+  current_note_spacing_ =0 ;
+  
   musical_malt_p_ =0;
 }
 
index 2c48a347713fd15751621bbc29e1c8dc25035ae9..534d209182fb18f6d9ee6ac05fa8eea7c3998827 100644 (file)
@@ -23,7 +23,7 @@ void
 Separation_item::add_item (Grob*s,Item* i)
 {
   assert (i);
-  Pointer_group_interface::add_element (s,"elements",i);
+  Pointer_group_interface::add_element (s, ly_symbol2scm ("elements"),i);
   s->add_dependency (i);
 }
 
index 00cf117a5ff1788887957e824c9dbf8eeea34188..a006af5a6925ce31801fc4f28879e3ec8b030e53 100644 (file)
@@ -19,7 +19,7 @@
 void
 Side_position_interface::add_support (Grob*me, Grob*e)
 {
-  Pointer_group_interface::add_element (me, "side-support-elements",e);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("side-support-elements"), e);
 }
 
 
@@ -67,7 +67,7 @@ Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
 SCM
 Side_position_interface::general_side_position (Grob * me, Axis a, bool use_extents)
 {
-  Grob *common = me->parent_l (a);
+  Grob *common = me->get_parent (a);
 
   /*
     As this is only used as a callback, this is called only once. We
@@ -108,7 +108,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
 
   Direction dir = Side_position_interface::get_direction (me);
     
-  Real off =  me->parent_l (a)->relative_coordinate (common, a);
+  Real off =  me->get_parent (a)->relative_coordinate (common, a);
   SCM minimum = me->remove_grob_property ("minimum-space");
 
   Real total_off = dim.linear_combination (dir) + off;
@@ -147,6 +147,8 @@ Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
 
 /**
   callback that centers the element on itself
+
+  Requires that self-alignment-{X,Y} be set.
  */
 MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_self,2);
 SCM
@@ -177,7 +179,7 @@ Side_position_interface::aligned_on_self (SCM element_smob, SCM axis)
     {
       return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me,  a));
     }
-    return gh_double2scm (0.0);
+  return gh_double2scm (0.0);
 }
 
 
@@ -265,7 +267,7 @@ Side_position_interface::centered_on_parent (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) gh_scm2int (axis);
-  Grob *him = me->parent_l (a);
+  Grob *him = me->get_parent (a);
 
   return gh_double2scm (him->extent (him,a).center ());  
 }
@@ -275,7 +277,7 @@ void
 Side_position_interface::add_staff_support (Grob*me)
 {
   Grob* st = Staff_symbol_referencer::staff_symbol_l (me);
-  if (st)
+  if (st && get_axis (me) == Y_AXIS)
     {
       add_support (me,st);
     }
index e0f4836d04383cc9f29918df6335fb78f3d8e9e3..479e11f6652e8864393a52e63e469b250652d229 100644 (file)
@@ -48,7 +48,7 @@ Slur::add_column (Grob*me, Grob*n)
     warning (_ ("Putting slur over rest.  Ignoring."));
   else
     {
-      Pointer_group_interface::add_element (me, "note-columns",n);
+      Pointer_group_interface::add_element (me, ly_symbol2scm ("note-columns"), n);
       me->add_dependency (n);
     }
 
index be821b012b267bd8969afce9cb2744e833af73b6..ebba459d17b9dd54d252364b39fbdd3078a218c1 100644 (file)
@@ -13,6 +13,9 @@
 #include "spacing-spanner.hh"
 #include "engraver.hh"
 #include "pqueue.hh"
+#include "note-spacing.hh"
+#include "staff-spacing.hh"
+#include "group-interface.hh"
 
 struct Rhythmic_tuple
 {
@@ -92,10 +95,15 @@ Spacing_engraver::finalize ()
 void
 Spacing_engraver::acknowledge_grob (Grob_info i)
 {
+  if (Note_spacing::has_interface (i.grob_l_) || Staff_spacing::has_interface (i.grob_l_))
+    {
+      Pointer_group_interface::add_element (spacing_p_, ly_symbol2scm  ("wishes"), i.grob_l_);
+    }
+  
   if (to_boolean (i.grob_l_->get_grob_property ("non-rhythmic")))
     return;
   
-  if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.req_l_))
+  if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.music_cause ()))
     {
       Rhythmic_tuple t (i, now_mom () + r->length_mom ());
       now_durations_.push (t);
@@ -109,7 +117,7 @@ Spacing_engraver::stop_translation_timestep ()
   shortest_playing.set_infinite (1);
   for (int i=0; i < playing_durations_.size (); i++)
     {
-      Moment m = (playing_durations_[i].info_.req_l_)->length_mom ();
+      Moment m = (playing_durations_[i].info_.music_cause ())->length_mom ();
       if (m.to_bool ())
        {
          shortest_playing = shortest_playing <? m;
@@ -121,7 +129,7 @@ Spacing_engraver::stop_translation_timestep ()
   starter=inf;
   for (int i=0; i < now_durations_.size (); i++)
     {
-      Moment m = now_durations_[i].info_.req_l_->length_mom ();
+      Moment m = now_durations_[i].info_.music_cause ()->length_mom ();
       if (m.to_bool ())
        starter = starter <? m;
 
index 6d59bb277fc0bca1ccfbe70b4a495983a8bc909c..9affdec4965ddad72d852d13398888fe2b754bbd 100644 (file)
@@ -82,10 +82,10 @@ Span_arpeggio_engraver::stop_translation_timestep ()
        {
          for (SCM s = arpeggios_[i]->get_grob_property ("stems");
               gh_pair_p (s); s = ly_cdr (s))
-           Group_interface::add_thing (span_arpeggio_, "stems", ly_car (s));
+           Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), ly_car (s));
          for (SCM s = arpeggios_[i]->get_grob_property ("side-support-elements");
               gh_pair_p (s); s = ly_cdr (s))
-           Group_interface::add_thing (span_arpeggio_, "side-support-elements", ly_car (s));
+           Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), ly_car (s));
 
          /*
            we can't kill the children, since we don't want to the
index 0e5d6e2f7ba27214964d63a19befb3a4cf022dfa..bf39b2d3ac95229d1dbb2849a25892fe36f19abd 100644 (file)
@@ -20,7 +20,7 @@
 void
 Span_bar::add_bar (Grob*me, Grob*b)
 {
-  Pointer_group_interface::add_element (me,"elements", b);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"),  b);
 
   me->add_dependency (b);
 }
index 6f5504a556c8c729c33850678a97d180b47ab90a..3579abefca1efc1d1036d41a9f5141cfc3fe2354 100644 (file)
@@ -36,7 +36,7 @@ Spanner::do_break_processing ()
    */
   for (int a = X_AXIS; a < NO_AXES; a ++)
     {
-      if (Spanner* parent = dynamic_cast<Spanner*> (parent_l ((Axis)a)))
+      if (Spanner* parent = dynamic_cast<Spanner*> (get_parent ((Axis)a)))
        {
          if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ()))
            {
@@ -190,7 +190,7 @@ Spanner::set_bound (Direction d, Grob*s)
   */
   if (dynamic_cast<Paper_column*> (i))
     {
-      Pointer_group_interface::add_element (i, "bounded-by-me",this);  
+      Pointer_group_interface::add_element (i, ly_symbol2scm ("bounded-by-me"), this);  
     }
 }
 
diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc
new file mode 100644 (file)
index 0000000..771760c
--- /dev/null
@@ -0,0 +1,17 @@
+/*   
+staff-spacing.cc --  implement 
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "staff-spacing.hh"
+#include "grob.hh"
+
+bool
+Staff_spacing::has_interface (Grob* g)
+{
+  return g && g->has_interface (ly_symbol2scm ("staff-spacing-interface"));
+}
index ae47a7d189b24ae21fe46bb98a928805ced3d2f0..833241cb530df3cb45cb68f0412b32d87fd77452 100644 (file)
@@ -45,7 +45,7 @@ Stanza_number_engraver::process_music ()
 
 
       // TODO
-      if (gh_string_p (s))
+      if (gh_string_p (s) || gh_pair_p (s))
 
        /*
          if (i.grob_l_->has_interface (symbol ("lyric-syllable-interface")))
index 083a25a483066f75324f3a8a60fe0e8dfc0d68d7..5ab49f9227d321d3e64c8e29f3996093a0eaaf4a 100644 (file)
@@ -105,12 +105,12 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                                                gh_int2scm (tremolo_flags));
                }
            }
-         announce_grob (stem_p_, i.req_l_);
+         announce_grob (stem_p_, i.music_cause ());
        }
 
       if (Stem::flag_i (stem_p_) != duration_log)
        {
-         i.req_l_->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 <<  Stem::flag_i (stem_p_)));
+         i.music_cause ()->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 <<  Stem::flag_i (stem_p_)));
        }
 
       Stem::add_head (stem_p_,h);
index b8dec893c0141305f3fd442319b5f615bceb2233..90949fc766f0274c72ecf5345fc1abab6fc402d3 100644 (file)
@@ -8,6 +8,7 @@
 
   TODO: This is way too hairy
 */
+
 #include <math.h>              // m_pi
 
 #include "lookup.hh"
@@ -227,7 +228,7 @@ Stem::add_head (Grob*me, Grob *n)
 
   if (Note_head::has_interface (n))
     {
-      Pointer_group_interface::add_element (me, "heads",n);
+      Pointer_group_interface::add_element (me, ly_symbol2scm ("heads"), n);
     }
   else
     {
@@ -344,7 +345,7 @@ Stem::get_default_stem_end_position (Grob*me)
            which should be a dot-column.
           */
          if (dir * (st + flagy -  dp) < 0.5)
-           Side_position_interface::add_support (dots->parent_l (X_AXIS), me);
+           Side_position_interface::add_support (dots->get_parent (X_AXIS), me);
 
          /*
            previous approach was to lengthen the stem. This is not
@@ -389,10 +390,11 @@ Stem::position_noteheads (Grob*me)
 
 
   Grob *hed = support_head (me);
-  Real w = hed->extent (hed, X_AXIS)[dir];
+  Real w = Note_head::head_extent (hed,X_AXIS)[dir];
   for (int i=0; i < heads.size (); i++)
     {
-      heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir], X_AXIS);
+      heads[i]->translate_axis (w - Note_head::head_extent (heads[i],X_AXIS)[dir],
+                               X_AXIS);
     }
   
   bool parity= true;           // todo: make me settable.
@@ -632,7 +634,7 @@ Stem::off_callback (SCM element_smob, SCM)
   Real r=0;
   if (Grob * f = first_head (me))
     {
-      Interval head_wid = f->extent (f,X_AXIS);
+      Interval head_wid = Note_head::head_extent(f, X_AXIS);
 
       Real attach =
        Note_head::stem_attachment_coordinate(f, X_AXIS);
index 5f7828b127d18f9aacb454b05fbd4e7e15f0f4f7..1cda41fe53a4aa38851e64a26aae4650470ce669 100644 (file)
@@ -39,7 +39,7 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
        don't add as Axis_group_interface::add_element (delim_,),
        because that would set the parent as well */
          
-      Pointer_group_interface::add_element (delim_, "elements", inf.grob_l_);
+      Pointer_group_interface::add_element (delim_, ly_symbol2scm ("elements"),  inf.grob_l_);
     }
   else if (System_start_delimiter::has_interface (inf.grob_l_))
     {
index 5db60e1750c93f641f14cc2021ef8475674771ac..c6e668e4cce7815e21353356f1a209c7f929314d 100644 (file)
@@ -59,10 +59,10 @@ Text_engraver::acknowledge_grob (Grob_info inf)
            ugh.
           */
          if (Side_position_interface::get_axis (t) == X_AXIS
-             && !t->parent_l (Y_AXIS))
+             && !t->get_parent (Y_AXIS))
            t->set_parent (inf.grob_l_, Y_AXIS);
          else if (Side_position_interface::get_axis (t) == Y_AXIS
-             && !t->parent_l (X_AXIS))
+             && !t->get_parent (X_AXIS))
            t->set_parent (inf.grob_l_, X_AXIS);
        }
     }
index 42a51b84463fc8b2ced54daac4e74a4cf0c2db7e..7f816afc2a8f465a1b23d1a3196bc41433f3fdcd 100644 (file)
@@ -222,7 +222,7 @@ Tex_font_metric_reader::read_char ()
 #define GET_CHAR_DIMEN(d) \
    if (d##_index != 0) \
      { \
-       input_.seek_ch_C (header_.##d##_pos + d##_index*4); \
+       input_.seek_ch_C (header_. d##_pos + d##_index*4); \
        tfm_char.d##_fix_ = input_.get_U32 (); \
        tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
                       * info_.design_size; \
diff --git a/lily/third-try.cc b/lily/third-try.cc
new file mode 100644 (file)
index 0000000..15a2cbf
--- /dev/null
@@ -0,0 +1,15 @@
+/*   
+  spacing-spanner.cc --  implement Spacing_spanner
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+class Third_spacing_spanner
+{
+public:
+  void find_loose_columns () {}
+  
+};
index 4f9536427b72ecb93c2c8f49dfa6b5121a9f2dc9..50844a3b1ba358f5740365bbb689feb8428a1476 100644 (file)
@@ -44,7 +44,7 @@ Tie_column::add_tie (Grob*me,Grob *s)
       dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (s,RIGHT));
     }
   
-  Pointer_group_interface::add_element (me, "ties",s);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("ties"), s);
   s->add_dependency (me);
 }
 
index 251f5f1f9c67c832f9c2bce989a441c806c6e272..227761a82dd1f95a8df0bb21b7125e660478f7a6 100644 (file)
@@ -98,7 +98,7 @@ Tie_engraver::acknowledge_grob (Grob_info i)
 {
   if (Rhythmic_head::has_interface (i.grob_l_))
     {
-      Note_req * m = dynamic_cast<Note_req* > (i.req_l_);
+      Note_req * m = dynamic_cast<Note_req* > (i.music_cause ());
       if (!m)
        return;
       now_heads_.push (Grob_pitch_tuple (i.grob_l_, m, now_mom () + m->length_mom ()));
index f343ffaadb8bd85cdf3687da65e4be18fdfcf6e2..53460fae9c9500939965049b125f152c1b6ebae9 100644 (file)
@@ -93,7 +93,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info i)
 {
   if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_l_))
     {
-      Note_req * m = dynamic_cast<Note_req> (i.req_l_);
+      Note_req * m = dynamic_cast<Note_req *> (i.req_l_);
       if (!m)
        return;
       now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ()));
index bac89f1d2572ceb501873540e57128b72bdce353..cf26511ffe019bb4542f0d8d9ec22d4af3cbe1c2 100644 (file)
@@ -292,7 +292,7 @@ Tuplet_bracket::get_default_dir (Grob*me)
 void
 Tuplet_bracket::add_column (Grob*me, Item*n)
 {
-  Pointer_group_interface::add_element (me, "columns",n);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("columns"), n);
   me->add_dependency (n);
 
   add_bound_item (dynamic_cast<Spanner*> (me), n);
index 65eb757387e33ab86b77b06503534e8c99cf5ad7..cb4df699ce5b01b16d217ac7bee8c016c1d7a794 100644 (file)
@@ -53,7 +53,7 @@ Vertical_align_engraver::qualifies_b (Grob_info i) const
   int sz = i.origin_trans_l_arr ((Translator*)this).size ()  ;
 
   return sz > 1 && Axis_group_interface::has_interface (i.grob_l_)
-    && !i.grob_l_->parent_l (Y_AXIS) && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS);
+    && !i.grob_l_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS);
 }
 
 void
index 5771f502cbab9eda29a940146cc0c5ec2855fdaf..d558d1ee04b8bee61b2c1b959239780326b4a13c 100644 (file)
@@ -117,7 +117,7 @@ Volta_spanner::brew_molecule (SCM smob)
 void
 Volta_spanner::add_bar (Grob *me, Item* b)
 {
-  Pointer_group_interface::add_element (me, "bars",b);
+  Pointer_group_interface::add_element (me, ly_symbol2scm ("bars"), b);
   Side_position_interface::add_support (me,b);
   add_bound_item (dynamic_cast<Spanner*> (me), b); 
 }
index c70ccf51f93d0ea42fcc47984a59074f12ecd74d..104d8ab6eace08e186aa9b72fce1e12152f95678 100644 (file)
@@ -142,7 +142,8 @@ VoiceContext = \translator {
 
 %}
        \consists "Dynamic_engraver"
-       \consists "Text_engraver"
+       \consists "Fingering_engraver"
+%      \consists "Text_engraver"
 
        \consists "Script_engraver"
        \consists "Script_column_engraver"
index e614e84fe3b76ebbc19938dd8555f2faa7c35f01..5cf9f286fa8b64ad065df560ef167a500fe5a04e 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.5.23
-Entered-date: 29NOV01
+Version: 1.5.24
+Entered-date: 01DEC01
 Description: @BLURB@
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.5.23.tar.gz 
+       1000k lilypond-1.5.24.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.5.23.tar.gz 
+       1000k lilypond-1.5.24.tar.gz 
 Copying-policy: GPL
 End
index bf2fd2f6e584b72baf42fccfeb879a28be4818a4..6053f4d2c2033fc2b62a97c6983a48002044c784 100644 (file)
@@ -1,5 +1,5 @@
 %define name lilypond
-%define version 1.5.23
+%define version 1.5.24
 %define release 1mdk
 
 Name: %{name}
index 4140712f8a79254afdb64dd21cec82d48edf2624..07da5dde40bfb37c925f881268e1f11a6a5d639f 100644 (file)
@@ -1,11 +1,11 @@
 %define info yes
 
 Name: lilypond
-Version: 1.5.23
+Version: 1.5.24
 Release: 1
 License: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.23.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.24.tar.gz
 Summary: Create and print music notation 
 URL: http://www.lilypond.org/
 BuildRoot: /tmp/lilypond-install
index 6acea87cbb7102918b9a9a351f42be1e219ee41b..5bf5530c94dab94873867bea55b09bb5e68cba20 100644 (file)
 
 Distribution: SuSE Linux 7.0 (i386)
 Name: lilypond
-Version: 1.5.23
+Version: 1.5.24
 Release: 2
 Copyright:    GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.23.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.24.tar.gz
 # music notation software for.. ?
 Summary: A program for printing sheet music.
 URL: http://www.lilypond.org/
index 7f02a51e5dcdffaf73e07cca64f037f1e9746ba0..e3c781c1bcea9ef685be3d978b8045e4cc4da64f 100644 (file)
@@ -27,6 +27,7 @@
                        '((":|:" . (":|" . "|:"))
                          ("||:" . ("||" . "|:"))
                          ("|" . ("|" . ""))
+                         ("||:" . ("||" . "|:"))
                          ("|s" . (nil . "|"))
                          ("|:" . ("|" . "|:"))
                          ("|." . ("|." . nil))
index f7afad28fcbb0b561f081445099f87547c195268..b0feb6008fbec2b73ff54486fa0aea6f73f05ed5 100644 (file)
@@ -95,6 +95,8 @@
 (define (beam-dir-majority count total)
   (dir-compare (car count) (cdr count)))
 
+(beam-dir-majority '(0 . 0) '(0 . 0))
+
 (define (beam-dir-mean count total)
   (dir-compare (car total) (cdr total)))
 
index 5e09ffe9ad3ba307c410b23e2fb1383c9ef7cfcb..fd68506d0da1958a4f7d031e7b035ddb1ea4a85b 100644 (file)
                (molecule-callback . ,Text_item::brew_molecule)
                (X-offset-callbacks . (,Side_position_interface::centered_on_parent ,Side_position_interface::aligned_on_self))
                (padding . 0.6)
-               (direction . -1)
+;              (direction . -1)
                (self-alignment-X . 0)
+               (self-alignment-Y . 0)
                (font-family . number)
                (font-relative-size . -3)
                (font-shape . upright)
                (break-align-symbol . Clef_item)
                (visibility-lambda . ,begin-of-line-visible)
                (font-family . roman)
-               (meta . ,(grob-description break-aligned-interface text-interface font-interface))
+               (meta . ,(grob-description break-aligned-interface text-interface font-interface))              
+       ))
+
+       (StaffSpacing . (
+               (breakable . #t)
+               (X-extent-callback . #f)
+               (Y-extent-callback . #f)
+
+               (meta . ,(grob-description staff-spacing-interface))
+       ))
+       (NoteSpacing . (
+               (X-extent-callback . #f)
+               (Y-extent-callback . #f)
+
+               (meta . ,(grob-description note-spacing-interface))
        ))
 
        (StaffSymbol . (
index 42129c4b399d956c17aee9ea02a08c1ef7f92134..9050f64050b67f0a4413848c98fcaef45dd52bb8 100644 (file)
    )
  )
 
+(lily-interface
+ 'staff-spacing-interface
+ ""
+ '(
+   ))
+
+(lily-interface
+ 'note-spacing-interface
+ ""
+ '(
+   ))
 
 (lily-interface
  'clef-interface
index 0fd88bb740c7abd5efd5b6b346fd973b81512ed8..0025dacb7ce4e444614284896fb4e220c8a54a51 100644 (file)
@@ -63,7 +63,7 @@
 
 (define (sign x)
   (if (= x 0)
-      1
+      0
       (if (< x 0) -1 1)))
 
 (define (write-me n x)
index 52a9a4a5e3f66a1cbe73648d0e13fd01ff0372f6..98127c076f23fb94654ba1c020141a108ee1b462 100644 (file)
 
 (define (unfold-repeats music)
 "
-[Rune Zedeler]
-
-Han-Wen Nienhuys wrote:
-
-> It shouldn't be hard to write a Scheme function to replace all repeats
-> with unfold repeats.
-[...]
-> Left to the reader as an exercise.
-
-With thanks to Han-Wen:
-
-
-"
+This function replaces all repeats  with unfold repeats. It was 
+written by Rune Zedeler. "
   (let* ((es (ly-get-mus-property music 'elements))
          (e (ly-get-mus-property music 'element))
          (body (ly-get-mus-property music 'body))
@@ -59,3 +48,34 @@ With thanks to Han-Wen:
 
     music))
 
+(define  (pitchify-scripts music)
+  "Copy the pitch fields of the Note_requests into  Text_script_requests, to aid
+Fingering_engraver."
+  (define (find-note musics)
+    (filter-list (lambda (m) (equal? (ly-music-name m) "Note_req")) musics)
+    )
+  (define (find-scripts musics)
+    (filter-list (lambda (m) (equal? (ly-music-name m) "Text_script_req")) musics))
+
+  (let* (
+        (e (ly-get-mus-property music 'element))
+        (es (ly-get-mus-property music 'elements))
+        (notes (find-note es))
+        (pitch (if (pair? notes) (ly-get-mus-property (car  notes) 'pitch) #f))
+        )
+
+    (if pitch
+       (map (lambda (x) (ly-set-mus-property x 'pitch pitch)) (find-scripts es))
+       )
+       
+    (if (pair? es)
+        (ly-set-mus-property
+         music 'elements
+         (map pitchify-scripts es)))
+
+    (if (music? e)
+        (ly-set-mus-property
+         music 'element
+         (pitchify-scripts e)))
+
+    music))
index 30ec4a4ce0844002fc1808de573c5851659fbcdd..80c76752e3d9c30e47f35b1532c65dd71fcf98e8 100644 (file)
@@ -19,7 +19,6 @@
 ;;     elif symbol == 'char':
 ;;         out.write ('moveto( %f %f); char(%d)' % (x,y,rest))
 
-
 ;; (define (dispatch x y expr)
 ;;  (let ((keyword (car expr))) 
 ;;   (cond
 ;;    ))
 
 
-;; guile < 1.4 compatibility for eval
-(if (or (equal? (minor-version) "4")
-       (equal? (minor-version) "3.4"))
-    (define (ly-eval e m)
-      (eval-in-module e m))
-    (define (ly-eval e m)
-      (eval e m)))
 
-(define-module (scm sketch))
-(debug-enable 'backtrace)
+(define-module (scm sketch) )
+;   :export (sketch-output-expression)
+;  :no-backtrace
 
 (define this-module (current-module))
 
@@ -47,7 +40,8 @@
   (display (dispatch expr) port))
 
 (use-modules
- (guile))
+ (guile)
+ (guile-user))
 
 (use-modules (ice-9 format))
 
index 744c6ac5093a240b901bf4d962559f43d3b63243..fe15316b4150bff52bfe763e5c94612f733c7b7f 100644 (file)
@@ -40,7 +40,7 @@ of @PACKAGE_NAME@
 
 built = r"""<hr>
 <p><font size="-1">
-This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ by<br>
+This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ (@BRANCH@) by<br>
 </font>
 <address><font size="-1">@GCOS@ &lt;<a href="mailto:@MAILADDRESS@">@MAILADDRESS@</a>&gt;,
 @LOCALTIME@.</font></address>"""
@@ -218,6 +218,7 @@ def do_file (f):
                else:
                        s = s + footer
 
+
        #URUGRGOUSNGUOUNRIU
        index = index_url
        top = top_url
@@ -231,6 +232,12 @@ def do_file (f):
                #       index = "./index.html"
                #       top = "./"
 
+
+       versiontup = string.split(package_version, '.')
+       branch_str = 'stable-branch' 
+       if string.atoi ( versiontup[1]) %  2:
+               branch_str = 'development-branch'
+               
        s = re.sub ('@INDEX@', index, s)
        s = re.sub ('@TOP@', top, s)
        s = re.sub ('@PACKAGE_NAME@', package_name, s)
@@ -239,7 +246,8 @@ def do_file (f):
        s = re.sub ('@GCOS@', gcos, s)
        s = re.sub ('@LOCALTIME@', localtime, s)
        s = re.sub ('@MAILADDRESS@', mail_address, s)
-
+       s = re.sub ('@BRANCH@', branch_str, s)  
+  
        m = re.match ('.*?<!-- (@[a-zA-Z0-9_-]*@)=(.*?) -->', s, re.DOTALL)
        while m:
                at_var = m.group (1)