]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.14 release/1.5.14
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 29 Sep 2001 11:09:44 +0000 (13:09 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 29 Sep 2001 11:09:44 +0000 (13:09 +0200)
===========

* Bugfix: revert font-relative-size for grace Accidentals

* Bugfix: hara kiri'd piano staffs doesn't take space anymore.

* Bugfix: reinstate rest-collisions.

* Bugfix: key items have the c0 position again.

* Make \property Voice.GrobName = \turnOff work again.

* More intelligent symbol-cache, in less code. Turned off by default, doesn't
work with -O2 yet.

* Documentation fixes: change documentation of Moment and make-moment,
add Translator::{name,description}

* Junk STL implementation of Scheme_hash_table in favor of GUILE
hashtables with automatic resizing.

1.5.12.j

40 files changed:
CHANGES
Documentation/user/GNUmakefile
Documentation/user/internals.itely
Documentation/user/refman.itely
VERSION
input/regression/hara-kiri-pianostaff.ly [new file with mode: 0644]
input/regression/stem-direction-down.ly
input/test/beam-neutral-direction.ly
input/test/default-neutral-dir.ly
lily/align-interface.cc
lily/clef-engraver.cc
lily/dot-column-engraver.cc
lily/engraver-group-engraver.cc
lily/grob.cc
lily/include/hara-kiri-group-spanner.hh
lily/include/lily-guile.hh
lily/include/scm-hash.hh
lily/include/symbol-cache.hh [deleted file]
lily/key-engraver.cc
lily/key-item.cc
lily/lily-guile.cc
lily/music-output-def.cc
lily/rhythmic-column-engraver.cc
lily/scm-hash.cc
lily/score.cc
lily/separating-group-spanner.cc
lily/symbol-cache.cc [deleted file]
ly/german-chords-init.ly
ly/grace-init.ly
ly/params-init.ly
ly/property-init.ly
make/out/lilypond.lsm
make/out/lilypond.mandrake.spec
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
scm/backend-documentation-lib.scm
scm/engraver-documentation-lib.scm
scm/generate-documentation.scm
scm/translator-property-description.scm
tex/lily-ps-defs.tex

diff --git a/CHANGES b/CHANGES
index d6cbd881b6ded7d3abad53dc5d7bce6e0407739f..260e05ce78e678a885518a6e54cb35efd08c3656 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,26 @@
+1.5.13.hwn2
+===========
+
+* Bugfix: revert font-relative-size for grace Accidentals
+
+* Bugfix: hara kiri'd piano staffs doesn't take space anymore.
+
+* Bugfix: reinstate rest-collisions.
+
+* Bugfix: key items have the c0 position again.
+
+* Make \property Voice.GrobName = \turnOff work again.
+
+* More intelligent symbol-cache, in less code. Turned off by default, doesn't
+work with -O2 yet.
+
+* Documentation fixes: change documentation of Moment and make-moment,
+add Translator::{name,description}
+
+* Junk STL implementation of Scheme_hash_table in favor of GUILE
+hashtables with automatic resizing. 
+
+
 1.5.12.jcn2
 ===========
 
index 85afa59a41dfe846af22e83a578b48d0d08ac3c5..6d9035e8ab97596e56aee4f50256b55cf170d486 100644 (file)
@@ -24,7 +24,7 @@ LOCALSTEPMAKE_TEMPLATES=lilypond ly
 # Hmm, what about?
 # local-dist: check-info
 
-info: check-info
+info: #  check-info  # -> reinstate when actively hacking doco.
 
 include $(depth)/make/stepmake.make 
 
index 030961124e8123871f83ddcb45034f3e063373ba..51fc93f0489366c3dca70658c6ada033ac46028d 100644 (file)
@@ -115,15 +115,17 @@ Type predicate, return true if @var{obj} is an input location.
 @node Moment
 @section Moment
 
-Moment is a rational number. Since GUILE doesn't support them natively,
-so we created our own rational data type.
+Moment is a point in musical time. It is consists of a pair of
+rationals (@var{m},@var{g}), where @var{m} is the timing for the  main
+notes, and @var{g} the timing for  grace notes. In absence of grace
+notes, @var{g} is zero.
 
 @defun moment? obj
 Type predicate, return true if @var{obj} is a moment.
 @end defun
 
 @defun make-moment num den
-create the rational number @var{num}/@var{den}. 
+create the rational number with main timing @var{num}/@var{den}. 
 @end defun
 
 @node Duration
@@ -236,6 +238,13 @@ retrieve the value of @var{sym} from context @var{tr}
 set value of property @var{sym} in context @var{tr} to @var{val}.
 @end defun
 
+@defun Translator::name tr
+Return the type name of the translator @var{tr}.
+@end defun 
+
+@defun Translator::description tr
+Return an alist of properties of  translator @var{tr}.
+@end defun
 
 @node Grobs
 @section Grobs
index 10a69dcbfc36c8349381f880b79a0df210d6703b..e9ba808c3c6378ace2201ec14d89d556b4df39c5 100644 (file)
@@ -1004,7 +1004,6 @@ beams) can be tweaked through grob-properties @code{height} and
 span. Both are measured in half staff-spaces, @code{staff-position=0}
 corresponds to the middle staff line.
 
-
 Set @code{height} to zero, to get horizontal beams:
 
 @lilypond[fragment,relative,verbatim]
@@ -1021,7 +1020,9 @@ horizontal, falls two staff spaces:
   \property Voice.Beam \set #'height = #-4
   [c8 c] 
 @end lilypond
-@cindex @code{default-neutral-direction}
+
+@c TODO -> why this ref? Document? 
+@cindex @code{neutral-direction}
 
 @node Expressive marks
 @section Expressive marks
diff --git a/VERSION b/VERSION
index 9872a2184a7a2d4f2d9fef6425725eb18540f98c..b236aa99dc7f221524bc70af4782ad8f69c77128 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=13
+PATCH_LEVEL=14
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff --git a/input/regression/hara-kiri-pianostaff.ly b/input/regression/hara-kiri-pianostaff.ly
new file mode 100644 (file)
index 0000000..786e49f
--- /dev/null
@@ -0,0 +1,18 @@
+\header {
+texidoc = "Hara kiri should not upset fixed distance alignment like in pianostaff. In this example the middle staff is harakiried."
+}
+
+       
+\score { \notes \transpose c'''
+ \context PianoStaff <
+   \context Staff = up {  c c c c \break }
+   \context Staff = mid {  s1 \break }
+   \context Staff = down {  c4 c c c \break }
+ >
+ \paper {
+  \translator {
+   \HaraKiriStaffContext
+  }
+ }
+}
+
index 857dea910d1f9ca59c6f8c8ad51f2e4bc2da9618..74ecc47b3ae0a33d5af20b28284c5f88ac77ed9b 100644 (file)
@@ -8,7 +8,7 @@ texidoc="Similarly, if @code{'neutral-direction} is set to @code{-1}.  "
 
 \score{
        \notes\relative c{
-       \property Voice.Stem \override #'default-neutral-direction = #-1
+       \property Voice.Stem \override #'neutral-direction = #-1
                 
            b''4 ~ b8()b8 e4 e,
        }
index 2e41028339574c8d2335f32c13f1d1f9b8a706a4..422b54bc6658872eeeeabf4ea109e1fb1a457d25 100644 (file)
@@ -3,7 +3,7 @@
 
 fragment = \notes {
   [b''8 b]
-  \property Voice.Beam \set #'default-neutral-direction = #-1
+  \property Voice.Beam \set #'neutral-direction = #-1
   [b b]
 }
 
index 2bbfff601a10bf6926997768fba50e1f397bb553..11e51df31c6e24efd7b79fbb21c9ea6882da66ca 100644 (file)
@@ -2,12 +2,12 @@
 \header { texidoc = "
 The direction of a perfectly centred beams can be
 controlled through @code{Voice.Beam}'s grob-property
-@code{default-neutral-direction}
+directly@code{neutral-direction}
 "}
 
 \paper { linewidth = -1.}
 \score {\notes \relative c {
   [b''8 b]
-  \property Voice.Beam \set #'default-neutral-direction = #-1
+  \property Voice.Beam \set #'neutral-direction = #-1
   [b b]
 }}
index 8211c349af283717552e9abeba981fac6f614c2b..42d7846cb4a9ac28b355113628c27628c86359f2 100644 (file)
@@ -11,6 +11,7 @@
 #include "grob.hh"
 #include "group-interface.hh"
 #include "axis-group-interface.hh"
+#include "hara-kiri-group-spanner.hh"
 #include "paper-def.hh"
 
 MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
@@ -50,13 +51,11 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   me->set_grob_property ("alignment-done", SCM_BOOL_T);
   
   SCM d =   me->get_grob_property ("stacking-dir");
-
   
   Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
 
-
   SCM force = me->get_grob_property ("forced-distance");
 
   Real dy = 0.0;
@@ -74,7 +73,26 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   v.set_empty ();
   Array<Real> translates;
   
-  for (int j=0 ;  j < elems.size (); j++) 
+  for (int j= elems.size (); j--; ) 
+    {
+      /*
+       This is not very elegant, in that we need special support for
+       hara kiri. Unfortunately, the generic wiring of
+       force_hara_kiri_callback () (extent and offset callback) is
+       such that we might get into a loop if we call extent() or
+       offset() the elements.
+       
+        
+       */
+      if (a == Y_AXIS
+         && Hara_kiri_group_spanner::has_interface (elems[j]))
+       Hara_kiri_group_spanner::consider_suicide (elems[j]);
+
+      if (!ly_pair_p (elems[j]-> immutable_property_alist_))
+       elems.del(j);
+    }
+
+  for (int j =0; j < elems.size (); j++)
     {
       where_f += stacking_dir * dy;
       translates.push (where_f);
index 4d2da95856f0c3892bbb8d4ffcf32e4b5d105949..a04db27dac52460bf75c94da01c2c4888161657e 100644 (file)
@@ -83,16 +83,6 @@ Clef_engraver::acknowledge_grob (Grob_info info)
          && gh_string_p (get_property ("clefGlyph")))
        create_clef ();
 
-      if (Key_item::has_interface (item))
-       {
-         /*
-           Key_item adapts its formatting to make sure that the
-           accidentals stay in the upper half of the staff. It needs
-           to know c0-pos for this. (?)
-         */
-
-         item->set_grob_property ("c0-position", get_property ("centralCPosition"));
-       }
     } 
 }
 
@@ -204,6 +194,6 @@ Clef_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Clef_engraver,
 /* descr */       "Determine and set reference point for pitches",
 /* creats*/       "Clef OctavateEight",
-/* acks  */       "bar-line-interface key-interface",
+/* acks  */       "bar-line-interface",
 /* reads */       "clefPosition clefGlyph centralCPosition clefOctavation explicitClefVisibility",
 /* write */       "");
index 9523b7ea91e67f7a7fbcb5829017bdae8c3e12c9..f36be6ed05659f67483aed5c6c95cb29333ad193 100644 (file)
@@ -84,6 +84,6 @@ ENTER_DESCRIPTION(Dot_column_engraver,
 If omitted, then dots appear on top of the notes.
 ",
 /* creats*/       "DotColumn",
-/* acks  */       "dot-column-interface stem-interface",
+/* acks  */       "rhythmic-head-interface dot-column-interface stem-interface",
 /* reads */       "",
 /* write */       "");
index 56fe566fcaec3bf68cf2073b387b4c54630d6ad1..8dd6e1a4ce9a05d1f5d69d4eeedaed85418d0800 100644 (file)
@@ -56,7 +56,15 @@ Engraver_group_engraver::acknowledge_grobs ()
        nm = ly_cdr (nm);
       else
        {
-         assert (info.grob_l_->immutable_property_alist_ == SCM_EOL); 
+         /*
+           it's tempting to put an assert for
+           immutable_property_alist_ == '(), but in fact, some
+           engravers (clef-engraver) add some more information to the
+           immutable_property_alist_ (after it has been '()-ed).
+
+           We ignore the grob anyway. He who has no name, shall not
+           be helped.  */
+         
          continue;
        }
  
index f1f80e720a6d57a19037713f6e8e3c2b23c28f63..82b177151687b8801711902640c013e311168895 100644 (file)
@@ -92,12 +92,14 @@ Grob::Grob (SCM basicprops)
     }
 
   SCM meta = get_grob_property ("meta");
-  SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+  if (gh_pair_p (meta))
+    {
+      SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
   
-  set_grob_property ("interfaces",ly_cdr (ifs));
+      set_grob_property ("interfaces",ly_cdr (ifs));
+    }
 }
 
-
 Grob::Grob (Grob const&s)
    : dim_cache_ (s.dim_cache_)
 {
index 9f1fc528db9cae8a0a3ee446973b3c6b3ed8a3e1..1b2f1b30cd6a9608abdc4e8c2063ff642c2cea51 100644 (file)
@@ -13,7 +13,6 @@
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-
 class Hara_kiri_group_spanner 
 {
 public:
index 65ca5ebb2d392ad8755c805c3e1856b868a069f4..f49e505447109bd0f439e5334392e8f077e5a116 100644 (file)
@@ -73,7 +73,27 @@ SCM ly_last (SCM list);
 SCM ly_str02scm (char const*c);
 SCM ly_write2scm (SCM s);
 SCM ly_deep_copy (SCM);
-SCM ly_symbol2scm (char const *);
+
+#ifdef 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
+  variable per ly_symbol2scm() use, and one boolean evaluation for
+  every call.
+
+  The overall speedup of lily is about 5% on a run of wtk1-fugue2
+
+*/
+#define ly_symbol2scm(x) ({ static SCM cached;  \
+ (__builtin_constant_p (x)) \
+  ? ((cached) ? cached : scm_permanent_object (cached = gh_symbol2scm((char*)x))) \
+  : gh_symbol2scm(x); })
+#else
+inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((char*)x); }
+#endif 
+
+
+
 String ly_scm2string (SCM s);
 String ly_symbol2string (SCM);
 SCM ly_offset2scm (Offset);
index 5b50c22c0179833f3bb5250f2d09e67a5c3b97a4..ba13e2ef06188824637ca80068fdced953058350 100644 (file)
 #define SCM_HASH_HH
 
 
-#include <map>
-
 #include "lily-guile.hh"
 #include "smobs.hh"
 
 
-struct SCM_less
-{
-  bool operator () (SCM s1, SCM s2) const
-  {
-    return long (s1) < long (s2);
-  }
-};
-
-typedef std::map<SCM,SCM, SCM_less> Scm_stl_map;
-
 /**
    auto resizing hash table. 
 
@@ -58,8 +46,9 @@ typedef std::map<SCM,SCM, SCM_less> Scm_stl_map;
 
   - use GUILE hashtables iso STL.
  */
-class Scheme_hash_table :  private Scm_stl_map
-{
+
+class Scheme_hash_table
+{  
 public:
   bool try_retrieve (SCM key, SCM *val);
   bool elem_b (SCM key) const;
@@ -75,8 +64,13 @@ public:
   Scheme_hash_table (Scheme_hash_table const &);
 
   SCM to_alist () const;
+private:
+  SCM hash_tab_;
+  unsigned elt_count_;
+  
   DECLARE_SMOBS (Scheme_hash_table,foo);
 };
 
+
 #endif /* SCM_HASH_HH */
 
diff --git a/lily/include/symbol-cache.hh b/lily/include/symbol-cache.hh
deleted file mode 100644 (file)
index 82023ee..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*   
-  symbol-cache.hh -- declare Symbol cacher.
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef SYMBOL_CACHE_HH
-#define SYMBOL_CACHE_HH
-
-#if 1
-
-/*
-  A per file cache: for each compilation unit, there is a separate
-  cache that maps the address of a string directly to a SCM value
-
- */
-struct Symbol_cache_pair{
-  const char * key;
-  SCM val ;
-};
-
-static Symbol_cache_pair *private_symbol_cache;
-static Symbol_cache_pair *private_symbol_cache_end;
-
-static SCM
-symbol (const char *ch) __attribute__ ((unused));
-
- SCM
-symbol (const char *ch)
-{
-  Symbol_cache_pair * lo = private_symbol_cache;
-  Symbol_cache_pair * hi = private_symbol_cache_end -1;
-
-  if (lo)
-    {
-      do
-       {
-         Symbol_cache_pair * mid = lo + (hi - lo) / 2 ;
-         if (mid->key > ch)
-           hi = mid;
-         else
-           lo = mid;
-       }
-      while ((hi - lo) > 1);
-      if (lo->key== ch)
-       return lo->val;
-    }
-
-  
-  Symbol_cache_pair * p = private_symbol_cache;
-  for (; p < private_symbol_cache_end
-        && p->key < ch ; p++)
-    ;
-
-  int idx = p - private_symbol_cache;
-  
-  SCM sym = gh_symbol2scm ((char*) ch);
-  scm_permanent_object (sym);
-  
-  int sz = private_symbol_cache_end - private_symbol_cache;
-  sz ++ ;
-  private_symbol_cache
-    = (Symbol_cache_pair*) realloc (private_symbol_cache,
-                                   sizeof (Symbol_cache_pair)* sz);
-  private_symbol_cache_end = private_symbol_cache + sz;
-  for (p = private_symbol_cache_end -1;
-       p != private_symbol_cache + idx; p --)
-    *p = * (p - 1);
-
-  p->key = ch;
-  p->val = sym;
-    
-  return sym;
-}
-#endif /* SYMBOL_CACHE_HH */
-#endif
index 17ffce32374982aa04897e62d2bd7e786f145c93..445d1972656af812639fa4b9f9237191aa22811b 100644 (file)
@@ -26,14 +26,12 @@ class Key_engraver : public Engraver
 {
   void create_key (bool);
   void read_req (Key_change_req const * r);
+  Key_change_req * keyreq_l_;
+  Item * item_p_;
 
 public:
   TRANSLATOR_DECLARATIONS(Key_engraver);
 
-  Key_change_req * keyreq_l_;
-  Item * item_p_;
-  Protected_scm old_accs_;     // ugh. -> property
-    
 protected:
   virtual void initialize ();
   virtual void finalize ();
@@ -48,15 +46,16 @@ protected:
 void
 Key_engraver::finalize ()
 {
-  old_accs_ = SCM_EOL;         // unprotect can not  be called from dtor.
 }
 
+
 Key_engraver::Key_engraver ()
 {
   keyreq_l_ = 0;
   item_p_ = 0;
 }
 
+
 void
 Key_engraver::create_key (bool def)
 {
@@ -64,20 +63,18 @@ Key_engraver::create_key (bool def)
     {
       item_p_ = new Item (get_property ("KeySignature"));
 
-      item_p_->set_grob_property ("c0-position", gh_int2scm (0));
-
+      item_p_->set_grob_property ("c0-position",
+                                 get_property ("centralCPosition"));
+      
       // todo: put this in basic props.
-      item_p_->set_grob_property ("old-accidentals", old_accs_);
+      item_p_->set_grob_property ("old-accidentals", get_property ("lastKeySignature"));
       item_p_->set_grob_property ("new-accidentals", get_property ("keySignature"));
 
       Staff_symbol_referencer::set_interface (item_p_);
       Key_item::set_interface (item_p_);
-
-      
       announce_grob (item_p_,keyreq_l_);
     }
 
-
   if (!def)
     {
       SCM vis = get_property ("explicitKeySignatureVisibility"); 
@@ -106,6 +103,7 @@ Key_engraver::try_music (Music * req_l)
   return  false;
 }
 
+
 void
 Key_engraver::acknowledge_grob (Grob_info info)
 {
@@ -122,21 +120,21 @@ Key_engraver::acknowledge_grob (Grob_info info)
     {
       create_key (true);
     }
-
 }
 
+
 void
 Key_engraver::create_grobs ()
 {
-  if (keyreq_l_ || old_accs_ != get_property ("keySignature"))
-    {
-      create_key (false);
-    }
+  if (keyreq_l_ ||
+      get_property ("lastKeySignature") != get_property ("keySignature"))
+    create_key (false);
 }
 
+
 void
 Key_engraver::stop_translation_timestep ()
-{ 
+{
   if (item_p_) 
     {
       typeset_grob (item_p_);
@@ -144,6 +142,7 @@ Key_engraver::stop_translation_timestep ()
     }
 }
 
+
 void
 Key_engraver::read_req (Key_change_req const * r)
 {
@@ -162,34 +161,36 @@ Key_engraver::read_req (Key_change_req const * r)
          n = scm_delete_x (ly_car (s), n);
        }
     }
+  
   for (SCM s = n ; gh_pair_p (s); s = ly_cdr (s))
     if (gh_scm2int (ly_cdar (s)))
       accs = gh_cons (ly_car (s), accs);
 
-  old_accs_ = get_property ("keySignature");
+  daddy_trans_l_->set_property ("lastKeySignature",
+                               get_property ("keySignature"));
   daddy_trans_l_->set_property ("keySignature", accs);
 }
 
+
 void
 Key_engraver::start_translation_timestep ()
 {
   keyreq_l_ = 0;
-  old_accs_ = get_property ("keySignature");
+  daddy_trans_l_->set_property ("lastKeySignature", get_property ("keySignature"));
 }
 
+
 void
 Key_engraver::initialize ()
 {
   daddy_trans_l_->set_property ("keySignature", SCM_EOL);
-  old_accs_ = SCM_EOL;
+  daddy_trans_l_->set_property ("lastKeySignature", SCM_EOL);
 }
 
 
-
-
 ENTER_DESCRIPTION(Key_engraver,
 /* descr */       "",
 /* creats*/       "KeySignature",
 /* acks  */       "bar-line-interface clef-interface",
-/* reads */       "keySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature",
-/* write */       "");
+/* reads */       "keySignature lastKeySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature",
+/* write */       "lastKeySignature");
index 563910435f8d917071c1f16111c9550272f93b8a..47526b042d17236d99f4de53a4cded2b85ae92ed 100644 (file)
@@ -95,11 +95,16 @@ Key_item::brew_molecule (SCM smob)
 
   SCM newas = me->get_grob_property ("new-accidentals");  
   Molecule mol;
+
+  SCM c0s = me->get_grob_property ("c0-position");
+  int c0p=0;
+  if (gh_number_p (c0s))
+     c0p = gh_scm2int (c0s);
+
   /*
     SCM lists are stacks, so we work from right to left, ending with
     the cancellation signature.
   */
-  int c0p = gh_scm2int (me->get_grob_property ("c0-position"));
 
   for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s))
     {
@@ -154,10 +159,6 @@ Key_item::brew_molecule (SCM smob)
   return mol.smobbed_copy ();
 }
 
-
-
-
-
 bool
 Key_item::has_interface (Grob*m)
 {
index 12b259ea83f27edd4d93d34fde48cc14362decf3..e613c2041c4387b8aa56f6d71404146b3801a867 100644 (file)
@@ -115,12 +115,6 @@ ly_quote_scm (SCM s)
 }
 
 
-SCM
-ly_symbol2scm (const char *s)
-{
-  return gh_symbol2scm ((char *)s);
-}
-
 
 String
 ly_symbol2string (SCM s)
@@ -167,7 +161,6 @@ void
 read_lily_scm_file (String fn)
 {
   gh_eval_str ((char *) gulp_file_to_string (fn).ch_C ());
-  //  scm_c_eval_string ((char *) gulp_file_to_string (fn).ch_C ());
 }
 
 extern "C" {
index c37cf1178b9dee97f18c8c024bc1564df7d87cf7..308b02577336d62ae691d63c9690c9d98b6a702e 100644 (file)
@@ -128,9 +128,9 @@ Music_output_def::get_global_translator_p ()
 int
 Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
 {
-  Translator_def * def = unsmob_translator_def (s);
+  Music_output_def * def = unsmob_music_output_def (s);
   scm_puts ("#<Music_output_def ", p);
-  scm_write (def->type_name_, p);
+  //scm_write (def->type_name_, p);
   scm_puts (">", p);
   return 1;
 }
index 8c6faa3d704334bf08f8752777034d43b0730c58..ac1515162a31870c97060ce27c11392f6b1a3c33 100644 (file)
@@ -122,6 +122,6 @@ Rhythmic_column_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Rhythmic_column_engraver,
 /* descr */       "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
 /* creats*/       "NoteColumn",
-/* acks  */       "stem-interface note-head-interface dot-column-interface",
+/* acks  */       "stem-interface rhythmicb-head-interface dot-column-interface",
 /* reads */       "",
 /* write */       "");
index 08cac970949a14a460360f7035c68583e95e2c71..b8bc8d8d03a28577e4fcecda3ca6b57286eea00d 100644 (file)
 #include "scm-hash.hh"
 #include "ly-smobs.icc"
 
+void
+copy_scm_hashes (SCM dest, SCM src)
+{
+  for (int i = SCM_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));
+      }
+}
+
 
 Scheme_hash_table::Scheme_hash_table ()
 {
+  hash_tab_ = SCM_EOL;
   smobify_self ();
+  hash_tab_ = scm_make_vector (gh_int2scm (119), SCM_EOL);
+  elt_count_ = 0;
 }
 
 
 Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src)
-  : Scm_stl_map (src)
+
 {
+  hash_tab_ = SCM_EOL;
+  elt_count_ = src.elt_count_;
   smobify_self ();
+
+  hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11 ), SCM_EOL);  
+  copy_scm_hashes (hash_tab_, src.hash_tab_);
 }
 
 void
 Scheme_hash_table::operator = (Scheme_hash_table const & src)
 {
-  Scm_stl_map::operator = (src);
-       
-  // we do not copy the self_scm () field!
+  if (&src == this)
+    return;
+  
+  elt_count_ = src.elt_count_;
+  hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11), SCM_EOL);  
+  copy_scm_hashes (hash_tab_, src.hash_tab_);
 }
 
 SCM
 Scheme_hash_table::mark_smob (SCM s)
 {
-  /*
-    can't typecheck naively, since GC bit lives in CAR of S
-   */
-  
   Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s);
-
-  for (Scm_stl_map::const_iterator i= me->begin (); i != me->end (); i++)
-    {
-      scm_gc_mark ((*i).first);
-      scm_gc_mark ((*i).second);
-    }
+  scm_gc_mark (me->hash_tab_);
   return SCM_EOL;
 }
 
@@ -54,54 +66,72 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*)
 {
   assert (unsmob (s));
   char str[1000];
-  sprintf (str, "#<Scheme_hash_table 0x%0x ", s);
-  scm_puts (str, p);      
-  Scheme_hash_table *me = unsmob (s);
-  for (Scm_stl_map::const_iterator i = me->begin (); i != me->end (); i++)
-    {
-      scm_display ((*i).first, p);
-      scm_puts (" = ",p);      
-      scm_display ((*i).second, p);
-      scm_puts ("\n",p);            
-    }
-  scm_puts ("> ",p);        
-  return 1;
+  sprintf (str, "#<Scheme_hash_table 0x%0lx ", SCM_UNPACK(s));
+   Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s);
+   scm_display (me->hash_tab_, p);      
+   scm_puts ("> ",p);        
+   return 1;
 }
 
 bool
 Scheme_hash_table::try_retrieve (SCM k, SCM *v)
 {
-  Scm_stl_map ::const_iterator i (find (k));
-  bool found = i != end ();
-  if (found)
-    *v = (*i).second;
-  return found;
+  SCM handle = scm_hashq_get_handle (hash_tab_, k);
+  if (ly_pair_p (handle))
+    {
+      *v = ly_cdr (handle);
+      return true;
+    }
+  else
+    return false;
+
 }
 
 bool
 Scheme_hash_table::elem_b (SCM k) const
 {
-  Scm_stl_map::const_iterator i (find (k));
-  return i != end ();
+  return ly_pair_p (scm_hashq_get_handle (hash_tab_, k));
 }
 
 void
 Scheme_hash_table::set (SCM k, SCM v)
 {
- (*this)[k] = v;
+  assert (gh_symbol_p (k));
+  SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
+  if (ly_cdr (handle) == SCM_UNDEFINED)
+    {
+      elt_count_++;
+    }
+  
+  gh_set_cdr_x (handle, v);
+
+  /*
+    resize if getting too large.
+  */
+  if (elt_count_ > 2 * SCM_LENGTH (hash_tab_))
+    {
+      SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL);
+      copy_scm_hashes (nh, hash_tab_);
+      hash_tab_ = nh;
+    }
+  
 }
 
 // UGH. 
 SCM
 Scheme_hash_table::get (SCM k)const
 {
-  return (* (Scheme_hash_table*)this)[k]; 
+  /*
+    42 will stick out like a sore thumb, hopefully.
+   */
+  return scm_hashq_ref (hash_tab_, k, SCM_MAKINUM(42));
 }
 
 void
 Scheme_hash_table::remove (SCM k)
 {
-  Scm_stl_map::erase (k);
+  scm_hashq_remove_x (hash_tab_, k);
+  elt_count_ --;
 }
 
 Scheme_hash_table::~Scheme_hash_table ()
@@ -112,13 +142,17 @@ SCM
 Scheme_hash_table::to_alist () const
 {
   SCM l = SCM_EOL;
-  for (Scm_stl_map ::const_iterator i = begin (); i != end (); i++)
-    l = gh_cons (gh_cons ((*i).first, (*i).second), l);
+  for (int i = SCM_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);
+      }
   return l;  
 }
 
 
 
+
 IMPLEMENT_UNSMOB (Scheme_hash_table,scheme_hash);
 IMPLEMENT_SMOBS (Scheme_hash_table);
 IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table);
index 024810c1b567532f5d7d5480487cbecba170c2aa..9cc2f6d0c652fee8540e645d15927dbaf5ff3706 100644 (file)
@@ -51,9 +51,7 @@ Score::Score (Score const &s)
   /*
     TODO: this is not very elegant.... 
    */
-  /*  store_locations_global_b = (scm_c_eval_string ("point-and-click") !=  SCM_BOOL_F);*/
   store_locations_global_b = (gh_eval_str ("point-and-click") !=  SCM_BOOL_F);
-      
 
   Music * m =unsmob_music (s.music_);
   music_ =  m?m->clone ()->self_scm () : SCM_EOL;
index 89bceab5d4c0dce07302e9112541da72d7eb741e..f989389674047ee63cfbe12071bb4df9f1c40e4a 100644 (file)
@@ -95,7 +95,6 @@ Separating_group_spanner::set_spacing_rods (SCM smob)
       if (rb)
        find_rods (rb, ly_cdr (s));
     }
-
   find_musical_sequences (me);
 #if 0
   /*
diff --git a/lily/symbol-cache.cc b/lily/symbol-cache.cc
deleted file mode 100644 (file)
index d247ccd..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*   
-  symbol-cache.cc --  implement a cache for literal symbols, eg
-    symbol ("foo-bar")
-    
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#include <map>
-#include "lily-guile.hh" 
-
-#if 0
-
-typedef map<const char*, SCM> Literal_symbol_map;
-Literal_symbol_map literal_map;
-
-
-SCM
-symbol (const char*s)
-{
-  Literal_symbol_map::const_iterator i = literal_map.find (s);
-  if (i != literal_map.end ())
-    return (*i).second;
-
-  SCM sym = gh_symbol2scm ((char*)s);
-  scm_permanent_object (sym);
-  literal_map[s] = sym;
-  return sym;
-}
-
-
-/*
-  This is a gory trick to cache the value gh_symbol2scm (), without
-  cluttering up the C code with snarf macros.
-  
-  You should *ONLY* use symbol () for arguments that are literal
-  strings!
-  
-  without (wtk1-fugue2)
-
-       real    0m20.157s
-       user    0m19.800s
-       sys     0m0.140s
-
-  with: (per file.)
-
-       real    0m19.284s
-       user    0m18.630s
-       sys     0m0.190s
-
-
-  global with STL map
-
-       real    0m20.616s
-       user    0m19.360s
-       sys     0m0.080s
-
-  global with binsearch.
-
-       real    0m19.352s
-       user    0m18.710s
-       sys     0m0.230s
-
-  local binsearch
-
-   user 18.8
-
-  local with binsearch, and other optimizations.
-
-   17.7
-*/
-#endif
-
-
index cb741eba1442e72b071ca5876ba3e9e6ce9a7f3c..644b6efe3cadc20fa6a4835ee5da13029bdd13a5 100644 (file)
@@ -1,10 +1,10 @@
-\version "1.3.148"
+\version "1.5.12"
 
-%  german-chords.ly:
+%  german-chords-init.ly:
 % german/norwegian/danish?
 
 % To get Bb instead of B, use
-% \include "german-chords.ly"
+% \include "german-chords-init.ly"
 % #(set! german-Bb #t)
 
 #(define german-Bb #f)
@@ -14,7 +14,8 @@
                      (list 7 (+ (if german-Bb 0 1) (caddr pitch)))
                      (cdr pitch)
                 )))
-     (cons
+       (list
+        'columns
        (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car dopitch))
        (accidental->text-super (cadr dopitch))
      )
index 691498d1bd00aaa847793c49a961d364684b4c80..b33942fde1ecddf0c6daffd16982b7beb810a487 100644 (file)
@@ -26,6 +26,7 @@ startGraceMusic = {
 }
 
 stopGraceMusic = {
+    \property Staff.Accidentals \revert #'font-relative-size
     \property Voice.Beam \revert #'space-function
     \property Voice.Beam \revert #'thickness
 
@@ -41,5 +42,4 @@ stopGraceMusic = {
     % be smaller as well.
 
     \property Voice.fontSize \unset
-    \property Staff.LocalKeyItem \revert #'font-relative-size
 }
index 8bf36b290628f9478587353362cfca70a6279577..afc951023faeef64a59b71efaaf25620a4f712b3 100644 (file)
@@ -5,7 +5,7 @@
 papersizename = \papersize 
 
 % ly2dvi now uses `papersize' internally (and on cmd line)
-papersize = \papersize
+%papersize = \papersize
 
 % FIXME
 % direct PostScript line height for single line staves
index 83ea32eb9ab09981ec9efcfeb8a5272774088221..1d26dc2a03b0107a4d5cbd102b6613c9e9a974f3 100644 (file)
@@ -164,4 +164,4 @@ hideStaffSwitch = \property PianoStaff.followVoice = ##f
 % To remove a Volta bracet or some other graphical object,
 % set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff
 
-turnOff = #'((meta .  ((interfaces . ()))))
+turnOff = #'()
index cb7289fd43a3d74eebe691002eeabb0bdfa60c4b..d12c232a557ae1a726f2edee64192b4e1ed6bec0 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.5.13
-Entered-date: 24SEP01
+Version: 1.5.14
+Entered-date: 29SEP01
 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.13.tar.gz 
+       1000k lilypond-1.5.14.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.5.13.tar.gz 
+       1000k lilypond-1.5.14.tar.gz 
 Copying-policy: GPL
 End
index 307132114c9923d99b412ba04977f6e191ef433c..0c791bdf0966b278f3a9e7eaab271c770deedacd 100644 (file)
@@ -1,5 +1,5 @@
 %define name lilypond
-%define version 1.5.13
+%define version 1.5.14
 %define release 1mdk
 
 Name: %{name}
index 1f2c5eda2eaf159c030f5541942ce3bd35c04ad9..89aac5523121d7cbf064b83545990789824f5820 100644 (file)
@@ -1,11 +1,11 @@
 %define info yes
 
 Name: lilypond
-Version: 1.5.13
+Version: 1.5.14
 Release: 1
 License: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.13.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.14.tar.gz
 Summary: Create and print music notation 
 URL: http://www.lilypond.org/
 BuildRoot: /tmp/lilypond-install
index 26262549260b482290838c57c617456643fb1961..aade40834432ccca6c32deb2798e231cd668589f 100644 (file)
 
 Distribution: SuSE Linux 7.0 (i386)
 Name: lilypond
-Version: 1.5.13
+Version: 1.5.14
 Release: 2
 Copyright:    GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.13.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.14.tar.gz
 # music notation software for.. ?
 Summary: A program for printing sheet music.
 URL: http://www.lilypond.org/
index 63d2937e15827bb2137fe05aed656202c83004dd..3ea5632c0bb37965095eadd741e264244e176a8c 100644 (file)
 ;; alist of property descriptions
 
 
+;;;;;; TODO: sort out symbol vs. string stuff.
+;;;;;; TODO: use flatten write iso. string-append; might be possible to fold
+;;;;;; in symbol->string integrally.
+
 (define (backend-property->texi sym)
   (let* ((name (symbol->string sym))
        (type (object-property sym 'backend-type?))
      (node (grob-name name))
      (texi-section 2 (grob-name name) #f)
      "\n"
-     (let* ((grob (string->symbol name))
+     (let* ((grob name)
            (engravers (filter-list
                        (lambda (x) (engraver-makes-grob? name x)) all-engravers-list))
            (engraver-names (map Translator::name engravers))
            )
 
        (string-append
-       name " grobs are created by: "
+       (symbol->string name) " grobs are created by: "
        (human-listify (map ref-ify
                            (map engraver-name engraver-names)))))
 
            (apply string-append ifacedoc))))
      
-(define (engraver-makes-grob? name grav)
-  (memq name (assoc 'grobs-created (Translator::description grav)))
+(define (engraver-makes-grob? name-symbol grav)
+  (memq name-symbol (assoc 'grobs-created (Translator::description grav)))
   )
 
 (define (document-all-grobs name)
index 6183686e0c52e7fac071290ac8a59cccea85b6a9..e19bce865b795b4f831fdf9d4afdbd32fd761de8 100644 (file)
@@ -28,7 +28,7 @@
         (name (Translator::name engraver))
         (name-sym (string->symbol name))
         (desc (cdr (assoc 'description (Translator::description engraver))))
-        (grobs (cdr (assoc 'grobs-created (Translator::description engraver))))
+        (grobs (engraver-grobs engraver))
         )
 
     (string-append
         (apply string-append 
                (map document-engraver-by-name consists))))))
 
-(define (engraver-grobs  name)
+(define (engraver-grobs  grav)
   (let* (
-        (eg (find-engraver-by-name name all-engravers-list))
-      )
+        (eg (if (string? grav)
+                (find-engraver-by-name grav all-engravers-list)
+                grav))
+            
+            )
 
     (if (eq? eg #f)
        '()
-       (cdr (assoc 'grobs-created (Translator::description eg)))
+       (map symbol->string (cdr (assoc 'grobs-created (Translator::description eg))))
        )
   ))
 
index 5e3f8f805f207ce67032cac57603ec0a3891ac49..9dad6f22f976e5ced1bd4e2c97596314f653909d 100644 (file)
@@ -1,4 +1,3 @@
-
 ;;; generate-documentation.scm -- Generate documentation
 ;;;
 ;;; source file of the GNU LilyPond music typesetter
@@ -30,7 +29,7 @@
             (document-music "LilyPond music properties") 
             (document-paper "LilyPond interpretation contexts")
             (document-all-engravers "LilyPond engravers")
-            (document-all-engraver-properties "LilyPond context properties")        
+            (document-all-engraver-properties "LilyPond context properties")
             (document-all-grobs "LilyPond backend")
             (document-all-interfaces "LilyPond interfaces")
             (document-all-backend-properties "LilyPond backend properties")
index fe6c8252fde329cd6b4a17820ed11635b7ef14ae..ed548ddeeea23a26478547b9e3673588b47669e2 100644 (file)
@@ -210,6 +210,9 @@ The format is (NAME . ALTER), where NAME is from 0 .. 6 and ALTER from  -1, 1.
 ")
 (translator-property-description 'keySignature list? "The current key signature. This is an alist containing (NAME . ALTER) or ((OCTAVE . NAME) . ALTER) pairs, where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2 ")
 
+(translator-property-description 'lastKeySignature list? "Last key
+signature before a key signature change.")
+
 (translator-property-description 'localKeySignature list? "the key
 signature at this point in the measure.  The format is the same as for keySignature. "
 ) 
index 79cb916235c0ae6c814b9b32207f7649e19f7886..0172a73d1891c6c7c096554d33b650be0c8ee83d 100644 (file)
@@ -9,6 +9,7 @@
 %
 % escape the colon with \string to avoid problems with french babel
 %
+\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}}
 \def\lilySpace{ }
 \def\turnOnPostScript{%
         % This sets CTM so that you get to the currentpoint
@@ -20,8 +21,7 @@
                         % FUCKING REDHAT XDVI -- ARG!
                         skeel ##1 @endspecial}%
         }
+        \PSsetTeXdimen{lilypondpaperblotdiameter}
 }
-\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}}
-\PSsetTeXdimen{lilypondpaperblotdiameter}
 \def\turnOnExperimentalFeatures{}