]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.29
authorfred <fred>
Tue, 26 Mar 2002 22:46:20 +0000 (22:46 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:46:20 +0000 (22:46 +0000)
61 files changed:
TODO
input/test/sleur.ly
input/test/slur-area.ly [new file with mode: 0644]
lily/all-font-metrics.cc
lily/bar.cc
lily/beam.cc
lily/breathing-sign.cc
lily/chord-name.cc
lily/crescendo.cc
lily/dots.cc
lily/extender-spanner.cc
lily/font-metric.cc
lily/hyphen-spanner.cc
lily/include/bar.hh
lily/include/beam.hh
lily/include/breathing-sign.hh
lily/include/chord-name.hh
lily/include/crescendo.hh
lily/include/dots.hh
lily/include/extender-spanner.hh
lily/include/hyphen-spanner.hh
lily/include/key-item.hh
lily/include/local-key-item.hh
lily/include/ly-smobs.icc
lily/include/molecule.hh
lily/include/multi-measure-rest.hh
lily/include/note-head.hh
lily/include/paper-outputter.hh
lily/include/rest.hh
lily/include/score-element.hh
lily/include/script.hh
lily/include/span-bar.hh
lily/include/staff-symbol.hh
lily/include/stem-tremolo.hh
lily/include/stem.hh
lily/include/text-item.hh
lily/include/tie.hh
lily/include/time-signature.hh
lily/include/tuplet-spanner.hh
lily/include/volta-spanner.hh
lily/key-item.cc
lily/local-key-item.cc
lily/moment.cc
lily/multi-measure-rest.cc
lily/note-head.cc
lily/rest.cc
lily/scm-hash.cc
lily/score-element.cc
lily/script.cc
lily/span-bar.cc
lily/staff-symbol.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/text-item.cc
lily/time-signature.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/params-as.ly
mf/as5.af
mf/as9.af
midi2ly/mudela-stream.cc

diff --git a/TODO b/TODO
index f5a11cecd9ea95ce20c399e01fef00a522e80f60..259faaf8aff781944910b772662b66b0c5425f0f 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,6 +10,8 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 
 .* TODO
 . * use hash tabs iso. alist_ for elt property?
+. * unhardcode stuff in bezier-bow: all sizes other than 20pt are
+    broken
 . * control paper-size/-file from commandline ?
   lilypond --paper=paper16 foo.ly
   lilypond --paper=paper20 foo.ly
@@ -17,6 +19,22 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 . * entangle ly/* paper-params papersize stuff
 . * fix tremolos.
 . * change ) c4  to c4-)
+. * automated marks. 
+. * There should be no pagebreak below the title of the movement!!
+. * tempo:
+
+>   - Tempo Indications:
+>     * \tempo 4 = 60 should be printed
+>     * There should be commands like \alloegro that also do something
+>       sensible in midi.
+> 
+. *  - It should be possible to have Bar numbers on every bar.
+
+. * dynamics: 
+>       * Notes should be spaced out for crescendos (had to use c^"      ")
+>       * something like c-.->\ff looks ugly.  The dynamc indication should
+>         appear left of the marks
+> 
 . * 
 There's insufficient leading between lines of lyrics, so risers like
 `l' and 'b' collide with the bottom of the line above.
index 0b69da1a7b5add4fc1f467337faa624b75c25dcd..66d3d96948eb0e4f7defee9b6d1f9dd9dfe3ee0b 100644 (file)
@@ -1,8 +1,8 @@
 \header{
-title = "sleur";
-subtitle = "test slurs.";
 enteredby =     "jcn";
 copyright =     "public domain";
+TestedFeatures =        "This file tests Feta embedded slurs" +
+        "(Feta definitively is not an abbreviation of Font-En-TjA)";
 }
 
 \version "1.3.5";
@@ -167,7 +167,7 @@ clipping = \notes\transpose c'{
 }
 
 \score{
-       \notes{ 
+       \context Staff \notes{ 
 %              \property Voice.pletvisibility = 0;
                % use blend for fast check
                \blend
diff --git a/input/test/slur-area.ly b/input/test/slur-area.ly
new file mode 100644 (file)
index 0000000..f16bb43
--- /dev/null
@@ -0,0 +1,26 @@
+\score{
+\notes\relative c''{
+
+\property Voice.slurVerticalDirection = #1
+\property Voice.stemVerticalDirection = #-1
+a(a' a,)a
+a(a a')a,
+a(d a)a
+a(a d)a
+
+e'8(e e e e e e)e
+a,8(d a a a a a)a
+a(a a a a a d)a
+
+c,(g' c e f d b)g 
+c,(g' c e f d b)g 
+
+\property Voice.noAutoBeaming = ##t
+\property Voice.stemVerticalDirection = #1
+a8(a a a a a a)a
+
+}
+\paper{
+indent=0.0\mm;
+}
+}
index 88f46c07a905895610a1999f9a648f85657e7d37..81a41334301c06b6861c1e46b2137b579bda6f1c 100644 (file)
@@ -147,6 +147,3 @@ All_font_metrics::font_descriptions () const
 }
 
 
-
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS(Font_metric);
index 90de71251c4796c240c84562c1ad47e7909b23c4..e4f66f1d35763b8f488db84228b9a7d0996c3181 100644 (file)
@@ -29,14 +29,11 @@ Bar::get_bar_size () const
 }
 
 
-Molecule*
-Bar::do_brew_molecule_p () const
+Molecule 
+Bar::do_brew_molecule () const
 {
   String s = ly_scm2string (get_elt_property ("glyph"));
-  Molecule *output
-    = new Molecule (lookup_l ()->bar (s, get_bar_size (), paper_l ()));
-  
-  return output;
+  return lookup_l ()->bar (s, get_bar_size (), paper_l ());
 }
 
 
index 33f354eb26b8db304806210a67b50ab5e97b092c..d96e15a637bcd0921b38793e176e652250dada3a 100644 (file)
@@ -708,12 +708,12 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
 }
 
 
-Molecule*
-Beam::do_brew_molecule_p () const
+Molecule 
+Beam::do_brew_molecule () const
 {
-  Molecule *mol_p = new Molecule;
+  Molecule mol;
   if (!stem_count ())
-    return mol_p;
+    return mol;
   Real x0,dx;
   if (visible_stem_count ())
     {
@@ -739,12 +739,12 @@ Beam::do_brew_molecule_p () const
       Molecule sb = stem_beams (i, next, prev);
       Real x = i->hpos_f ()-x0;
       sb.translate (Offset (x, x * dydx + y));
-      mol_p->add_molecule (sb);
+      mol.add_molecule (sb);
     }
-  mol_p->translate_axis (x0 
+  mol.translate_axis (x0 
     - spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS), X_AXIS);
 
-  return mol_p;
+  return mol;
 }
 
 int
index f6672d2059a962620c6f3301afd765e6585914c0..54120930f3a3698f020b49addb26f7a7bab2a0f2 100644 (file)
@@ -26,8 +26,8 @@ Breathing_sign::Breathing_sign ()
   set_elt_property ("breakable", SCM_BOOL_T);
 }
 
-Molecule*
-Breathing_sign::do_brew_molecule_p () const
+Molecule 
+Breathing_sign::do_brew_molecule () const
 {
   Staff_symbol_referencer_interface si (this);
   
@@ -35,9 +35,7 @@ Breathing_sign::do_brew_molecule_p () const
   Interval i1(0, space / 6), i2(-space / 2, space / 2);
   Box b(i1, i2);
 
-  Molecule *output = new Molecule (lookup_l()->filledbox(b));
-  return output;
+  return lookup_l()->filledbox(b);
 }
 
 void
index ba971322fc8650f8f39fe3a87d653589f10f3a11..e395663bd1f54b6d1d7a64952a19dccc3cd6c1c2 100644 (file)
@@ -221,8 +221,8 @@ Chord_name::banter (Array<Musical_pitch> pitch_arr, Chord_mol* name_p) const
   TODO:
     fix silly to-and-fro scm conversions
  */
-Molecule*
-Chord_name::do_brew_molecule_p () const
+Molecule 
+Chord_name::do_brew_molecule () const
 {
   Array<Musical_pitch> pitch_arr;
   scm_to_array (get_elt_property ("pitches"), &pitch_arr);
@@ -286,16 +286,16 @@ Chord_name::do_brew_molecule_p () const
   if (!name.addition_mol.empty_b ())
     name.addition_mol.translate (Offset (0, super_y));
 
-  Molecule* mol_p = new Molecule;
-  mol_p->add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0);
+  Molecule  mol;
+  mol.add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0);
   // huh?
   if (!name.modifier_mol.empty_b ())
-    mol_p->add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0);
+    mol.add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0);
   if (!name.addition_mol.empty_b ())
-    mol_p->add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0);
+    mol.add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0);
   if (!name.inversion_mol.empty_b ())
-    mol_p->add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0);
+    mol.add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0);
   if (!name.bass_mol.empty_b ())
-    mol_p->add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0);
-  return mol_p;
+    mol.add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0);
+  return mol;
 }
index 481d30bca713b4c7335cf3542176dfec5a55b89a..3f0f16b637dd1423e6b70eb866188c3f200da3c0 100644 (file)
@@ -22,8 +22,8 @@ Crescendo::Crescendo ()
 
 
 
-Molecule*
-Crescendo::do_brew_molecule_p () const
+Molecule 
+Crescendo::do_brew_molecule () const
 {
   Real absdyn_dim = paper_l ()-> get_var ("crescendo_shorten");
   Real extra_left =  get_broken_left_end_align ();
@@ -33,9 +33,11 @@ Crescendo::do_brew_molecule_p () const
 
   if (!isdir_b (dir) || !gh_pair_p (dyns))
     {
-Crescendo * me = (Crescendo*)this;
+      Crescendo * me = (Crescendo*)this;
       me->set_elt_property ("transparent", SCM_BOOL_T);
-      return new Molecule;
+      Molecule m;
+      
+      return m;
     }
   
   Direction gd = to_dir (dir);
@@ -78,10 +80,9 @@ Crescendo * me = (Crescendo*)this;
   Real thick = paper_l ()->get_var ("crescendo_thickness");
 
   const char* hairpin = (gd < 0)? "decrescendo" :  "crescendo";
-  Molecule * m
-    = new Molecule;
-  m->dim_.x () = Interval (0, width);
-  m->dim_.y () = Interval (-2*height, 2*height);
+
+  Box b (Interval (0, width),
+        Interval (-2*height, 2*height));
 
   SCM at = gh_list (ly_symbol2scm (hairpin),
                     gh_double2scm (thick),
@@ -90,8 +91,9 @@ Crescendo * me = (Crescendo*)this;
                     gh_double2scm (continued ? height/2 : 0.0),
                     SCM_UNDEFINED);
 
-  m->add_atom (at);
-  m->translate_axis (extra_left, X_AXIS);
+  Molecule m (b, at);
+  
+  m.translate_axis (extra_left, X_AXIS);
   return m;
 }
 
index 36e0a348441704b42a84fe3e9e0e96b31503d81d..f63f77ddae1e57d08191c2cf3840591aede312a6 100644 (file)
@@ -39,14 +39,11 @@ Dots::do_post_processing ()
        si.set_position (p  + directional_element (this).get ());
     }
 }
-Molecule* 
-Dots::do_brew_molecule_p () const
+Molecule  
+Dots::do_brew_molecule () const
 {
-  Molecule *out = new Molecule;
-  Molecule fill = lookup_l ()->fill (Box (Interval (0,0),
-                                         Interval (0,0)));
-  out->add_molecule (fill);
-
+  Molecule mol (lookup_l ()->fill (Box (Interval (0,0),
+                                         Interval (0,0))));
   Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
 
   Real dw = d.dim_[X_AXIS].length ();
@@ -56,10 +53,10 @@ Dots::do_brew_molecule_p () const
   for (int i = gh_scm2int (get_elt_property ("dot-count")); i--; )
     {
       d.translate_axis (2*dw,X_AXIS);
-      out->add_molecule (d);
+      mol.add_molecule (d);
     }
 
-  return out;
+  return mol;
 }
 
 
index e70e848035afa923f404c0a22cc7ad35a5dd1781..ff02c16d92efbb71aa4be8d5eeec2cc2722f31f7 100644 (file)
@@ -30,10 +30,10 @@ Extender_spanner::Extender_spanner ()
 
 
 
-Molecule*
-Extender_spanner::do_brew_molecule_p () const
+Molecule 
+Extender_spanner::do_brew_molecule () const
 {
-  Molecule* mol_p = new Molecule;
+  Molecule  mol;
 
   Real w = spanner_length ();
   
@@ -42,9 +42,9 @@ Extender_spanner::do_brew_molecule_p () const
   Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h)));
   a.translate (Offset (dx_f_drul_[LEFT], 0));
 
-  mol_p->add_molecule (a);
+  mol.add_molecule (a);
 
-  return mol_p;
+  return mol;
 }
 
 
index c872d5b8d9e90292152b624964860b3f56cdb991..ef615ae0a9f7e73f3b813b3816a195f71a9be66a 100644 (file)
@@ -126,3 +126,5 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state * )
 }
 
 IMPLEMENT_UNSMOB(Font_metric, metrics);
+IMPLEMENT_SMOBS(Font_metric);
+
index be36b99bf61ccbf8bc7d749d581a55c42ca43673..65470ea81c4204e414228bf39055ff20d45e2425 100644 (file)
@@ -30,10 +30,10 @@ Hyphen_spanner::Hyphen_spanner ()
   dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback);
 }
 
-Molecule*
-Hyphen_spanner::do_brew_molecule_p () const
+Molecule 
+Hyphen_spanner::do_brew_molecule () const
 {
-  Molecule* mol_p = new Molecule;
+  Molecule  mol;
 
   Real w = spanner_length ();
 
@@ -50,9 +50,9 @@ Hyphen_spanner::do_brew_molecule_p () const
   Molecule a = lookup_l ()->filledbox ( Box (Interval ((w-l)/2,(w+l)/2), Interval (h,h+th)));
   a.translate (Offset (dx_f_drul_[LEFT], 0));
 
-  mol_p->add_molecule (a);
+  mol.add_molecule (a);
 
-  return mol_p;
+  return mol;
 }
 
 
index 21ee05890c46ef9e8e052204d4b74b130513f9fc..1e4f8c539a64ae5c4ad64264eccc33cd1237c47d 100644 (file)
@@ -17,7 +17,7 @@ public:
   Bar();
 protected:
   virtual void do_pre_processing ();
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule  do_brew_molecule () const;
   virtual Real get_bar_size () const;
 };
 #endif // BAR_HH
index 966f3f08e8ac9d03f455bef3ee54318c47983f9b..aff606c7a99aacbe39b078a22062aefeae2e76ea 100644 (file)
@@ -47,7 +47,7 @@ protected:
  
   virtual void do_pre_processing ();
   virtual void do_post_processing ();
-  virtual Molecule*do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 
   Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
 private:
index bda300aaa010f1777d3d98d5bd6f661410ed65db..83cf87e5e8266a38494ba9c0405e07b5f0b09ee3 100644 (file)
@@ -20,7 +20,7 @@ public:
   Breathing_sign ();
 protected:
   virtual void do_post_processing ();
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 };
 
 
index dc49f205c23f6ce26d891de2c3a94902a5559580..ae1ddc0500a030fc3d084d1b75ffaec2dc3229a0 100644 (file)
@@ -40,7 +40,7 @@ public:
   void banter (Array<Musical_pitch> pitch_arr, Chord_mol* name_p) const;
 
 protected:
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 };
 
 #endif // CHORD_NAME_HH
index ef7b6f3310e647aecdf87d4e29ffac9d987134b5..115b98b9fd720c288ed40029ee44b607d09f83b5 100644 (file)
@@ -21,7 +21,7 @@ public:
   Crescendo();
 protected:
   VIRTUAL_COPY_CONS(Score_element);
-  virtual Molecule*do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
     
 private:
   Molecule get_symbol() const;
index 647a1255135e89f7a12d348e15b9cc36b46fe997..6a36c9ef06e6e2ce02e6e9be9da9da80781c4d80 100644 (file)
@@ -21,7 +21,7 @@ class Dots :
   public Item
 {
 protected:
-  virtual Molecule * do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   virtual void do_post_processing ();
 public:
   
index cb24e42ded4344e5aedc57ad8111dd4c9c787a81..0fa11e6f5750579305bec02b3feddf94e8992fb9 100644 (file)
@@ -34,7 +34,7 @@ public:
   void set_textitem (Direction, Item*);
 
 protected:
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   void do_post_processing ();
  
   VIRTUAL_COPY_CONS (Score_element);
index 3086facc32154c0fff6b4f2705c67e5a44034c42..2530a5e1161514a9787ddf5b7138335f32097262 100644 (file)
@@ -25,7 +25,7 @@ Hyphen_spanner ();
   void set_textitem (Direction, Item*);
 
 protected:
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   Interval do_height () const;
 
   void do_post_processing ();
index 6c78e9f29e91a8768a2213aa4224336122158869..55f320c9c9bed87d35eeae45b52700c0e7603822 100644 (file)
@@ -36,7 +36,7 @@ public:
   int calculate_position(int p, int a) const;
 
 protected:
-  virtual Molecule* do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 };
 
 #endif // KEYITEM_HH
index b1d20b3ac4f89ea2ed2332ea6f9cc261cc4d8397..3e2063167b0e0106af822f7416057b425525a86b 100644 (file)
@@ -50,7 +50,7 @@ public:
   void add_pitch (Musical_pitch, bool cautionary, bool natural);
 protected:
   virtual void do_pre_processing();
-  virtual Molecule* do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 };
 #endif // LOCALKEYITEM_HH
 
index 97da61e6d00c8637b7b095d7355d8e03ce0feee4..10e9b03f30e68f5df77dae402906b2f72285081d 100644 (file)
@@ -18,7 +18,18 @@ unsmob_ ## name ( SCM s)                     \
     return SMOB_TO_TYPE(CL, s);                        \
   else                                         \
     return 0;                                  \
-}
+}\
+SCM smobify (CL *cl)\
+{\
+  SCM s;                                                               \
+                                                                       \
+  SCM_NEWCELL(s);                                                      \
+  SCM_SETCAR(s,CL::smob_tag_);                                         \
+  void * me_p = cl;                                                    \
+  SCM_SETCDR(s,me_p);                                                  \
+return s;\
+}\
+
 
 
 #define IMPLEMENT_SMOBS(CL)\
@@ -55,14 +66,8 @@ CL::smobify_self ()                                                  \
     This is local. We don't assign to self_scm_ directly, to assure    \
     that S isn't GC-ed from under us.                                  \
    */                                                                  \
-  SCM s;                                                               \
-                                                                       \
-  SCM_NEWCELL(s);                                                      \
+  SCM s = smobify (this); \
   self_scm_ = s;                                                       \
-                                                                       \
-  SCM_SETCAR(s,smob_tag_);                                             \
-  void * me_p = this;                                                  \
-  SCM_SETCDR(s,me_p);                                                  \
   scm_protect_object (s);                                              \
                                                                        \
 /* no scm_done_malloc() !  */ \
index f5e94ef60aadf6aa94e532af47043e573ea76389..7342d0d406fcc72e190f80407bf88c4682a57de3 100644 (file)
@@ -8,45 +8,51 @@
 #ifndef MOLECULE_HH
 #define MOLECULE_HH
 
+#include <stdlib.h>            // size_t
 #include "lily-proto.hh"
 #include "box.hh"
 #include "axes.hh"
 #include "direction.hh"
-#include "cons.hh"
-#include "protected-scm.hh"
-
-//#define ATOM_SMOB
+#include "lily-guile.hh"
 
 /** a group of individually translated symbols. You can add molecules
     to the top, to the right, etc.
 
+    It is implemented as a "tree" of scheme expressions, as in
+
+     Expr = combine Expr Expr
+              | translate Offset Expr
+             | SCHEME
+             ;
+
+    SCHEME is a Scheme expression that --when eval'd-- produces the
+    desired output.  
+
+
+    Because of the way that Molecule is implemented, it is the most
+    efficient to add "fresh" molecules to what you're going to build.
+    
     Dimension behavior:
 
     Empty molecules have empty dimensions.  If add_at_edge is used to
     init the molecule, we assume that
     DIMENSIONS = (Interval(0,0),Interval(0,0)
-
+    
 */
 class Molecule {
-  Protected_scm atom_list_;
-
-  friend class Paper_outputter;
-
+  /// can't alloc on heap.
+  void * operator new (size_t s); 
 public:
   Box dim_;
-
+  SCM expr_;
+  
+  Molecule (Box, SCM s);
   Molecule();
-  ~Molecule();
 
   /**
      Set dimensions to empty, or to (Interval(0,0),Interval(0,0) */
   void set_empty (bool);
   void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding);
-
-  /**
-     Add an atom.  The molecule assumes responsibility for cleaning.
-   */
-  void add_atom (SCM as);    
   void add_molecule (Molecule const &m);
   void translate (Offset);
   
@@ -62,13 +68,10 @@ public:
   void translate_axis (Real,Axis);
 
   
+  
   /// how big is #this#? 
   Box extent() const;
   Interval extent (Axis) const;
-
-  Molecule (const Molecule&s);
-
-  void operator=(const Molecule&);  
   bool empty_b() const;
   void print ()const;
 };
index b86e566146519a9acd4938a4a80edff56f89d2eb..527e93fcd68c20f4e7931648dcc8d247e8b3358c 100644 (file)
@@ -21,7 +21,7 @@ public:
   void add_column (Item*);
   Molecule compound_rest (int)const;
 protected:
-  virtual Molecule *do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   VIRTUAL_COPY_CONS (Score_element);
 
   virtual void do_add_processing ();
index 25fdda52b49739298e18a3cbd2cd43cb6dcfd1b8..fbebc0a4042a58916685a3fbf0434d379fc740e9 100644 (file)
@@ -24,7 +24,7 @@ public:
 protected:
   
   virtual void do_pre_processing();
-  virtual Molecule* do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 };
 #endif // NOTEHEAD_HH
 
index 09e8f58bddac135ffcd271673ac3b47a9e20b7c8..3a1d343c2772229d486e4bc0e032e2e874f6f91d 100644 (file)
@@ -16,6 +16,7 @@
 #include "lily-guile.hh"
 #include "protected-scm.hh"
 
+// huh?
 #ifdef __powerpc__
 #include "protected-scm.hh"
 #endif
@@ -31,8 +32,6 @@ public:
   Paper_outputter ();
 
   void dump_onto (Paper_stream *);
-
-
   void output_int_def (String k, int v);
   void output_Real_def (String k, Real v);
   void output_String_def (String k, String v);
@@ -41,7 +40,7 @@ public:
   void output_font_def (int i, String str);
   void output_font_switch (int i);
   void output_header ();
-  void output_molecule (Molecule const *, Offset, char const *);
+  void output_molecule (SCM expr, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
 
index ce95e6396bc4b2f4035508eeacfc016b7032001c..56b13441a6a4a5a7bb829fe85d03d031ba525831 100644 (file)
@@ -16,6 +16,6 @@ class  Rest : public Rhythmic_head
 {
 protected:
   virtual void do_post_processing ();
-  virtual Molecule * do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 };
 #endif // REST_HH
index 2a962607fd387180003333718397ab366b8ea0cf..e3bec466effb37c587f251da14e0711d01fd87b8 100644 (file)
@@ -62,7 +62,7 @@ public:
   int status_i_;
 
   Paper_score *pscore_l_;
-  Molecule * output_p_;
+
   Score_element ();
   Score_element (Score_element const&);
   virtual void print () const;
@@ -137,7 +137,7 @@ protected:
   /// do printing of derived info.
   virtual void do_print () const;
   /// generate the molecule    
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   ///executed directly after the item is added to the Paper_score
   virtual void do_add_processing ();
   /// do calculations before determining horizontal spacing
index 8902a94bbf035ff91934b6e42155383cdb8c034e..b9c0be1238116e6f3d7835429fe49dfa3a868133 100644 (file)
@@ -26,7 +26,7 @@ public:
 protected:
   virtual void do_pre_processing ();
   virtual void do_post_processing ();
-  Molecule* do_brew_molecule_p () const;
+  Molecule do_brew_molecule () const;
 };
 
 #endif /* Stem_SCRIPT_HH */
index 77b6429fe38cafd4ad90f4dd692356742bcc67c5..8100bbafedec5078ca1dc7c92f2da88e1da6c3ce 100644 (file)
@@ -38,7 +38,7 @@ protected:
   
   virtual void do_pre_processing();
   virtual void do_post_processing();
-  virtual Molecule * do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 };
 
 #endif // SPAN_BAR_HH
index ea6a4086539d8049ecf7efbd4ac461f350d8de5c..88821052fe5cdc84afc14cff39b1b54876e09a37 100644 (file)
@@ -23,6 +23,6 @@ public:
   int line_count () const;
 protected:
   VIRTUAL_COPY_CONS(Score_element);
-  virtual Molecule* do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 };
 #endif // STAFFSYM_HH
index 9ef3b068292778cb80d5ce83b828859dff2d72fb..2e963007e26aa438c542f93720866c4247139f94 100644 (file)
@@ -16,7 +16,7 @@
 class Stem_tremolo : public Item {
 protected:
   Stem * stem_l () const;
-  virtual Molecule *do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 
   static Interval dim_callback (Dimension_cache const*);
 public:
index 2f8298c4d80192d865e55d3b44ed62b768eab419..b31627019fa6f5b3850b0e9d01b246c83599917a 100644 (file)
@@ -91,7 +91,7 @@ protected:
 
   virtual void do_pre_processing();
   static Interval dim_callback (Dimension_cache const*);
-  virtual Molecule* do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 
   void set_spacing_hints () ;
 };
index e3c7a89c33fc66ff398b809f62e43167b837507d..f6aaa02928310b469ca24ae66b4e9712d0678b06 100644 (file)
@@ -20,7 +20,7 @@ class Text_item : public Item
 public:
   VIRTUAL_COPY_CONS (Score_element);
 protected:
-  virtual Molecule *do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
 };
 
 #endif /* Text_ITEM_HH */
index 5e07334424d9901e3b5c1e10ca68bfaf1e66aceb..53dc0733ec0d2c2c8110d6c1683a85d9e877a965 100644 (file)
@@ -29,7 +29,7 @@ public:
   virtual Direction get_default_dir() const;
 
 protected:
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   virtual Array<Offset> get_encompass_offset_arr () const;
   Bezier get_curve () const;
 
index 4d02f04693f216423ae97c6e43bd26d4f57fa62c..3bdc1208e19a0eb318e5759268d98ab75d0dd0b0 100644 (file)
@@ -24,7 +24,7 @@ class Time_signature: public Item
   Molecule time_signature (int, int)const;
   
 protected:
-  virtual Molecule*do_brew_molecule_p() const;
+  virtual Molecule do_brew_molecule() const;
 public:
   Time_signature () ;
 
index e20141319792a79f8b16e235319141cf5b9ca7c4..a38a9dcb4c3f7343a4902b0eb77b016bffc66203 100644 (file)
@@ -28,7 +28,7 @@ protected:
   void calc_dy (Real *) const;
   void calc_position_and_height (Real*,Real *dy)const;
   
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   VIRTUAL_COPY_CONS(Score_element);
   virtual void do_add_processing ();
   virtual void do_post_processing ();
index a4f32c035463e97c89f91ddb363e7541e3a0cd30..bdc42ffdf43ffe6bec523f0122bf3d93a6505af7 100644 (file)
@@ -22,7 +22,7 @@ public:
   void add_bar (Bar*);
  
 protected:
-  virtual Molecule* do_brew_molecule_p () const;
+  virtual Molecule do_brew_molecule () const;
   VIRTUAL_COPY_CONS (Score_element);
 
   virtual void do_add_processing ();
index 56ab8a050678f1981b0099205fe583828a9b523e..55c594c01cfa03552c204bb07b7960c9edb03e9b 100644 (file)
@@ -93,10 +93,10 @@ Key_item::calculate_position(int p, int a) const
   - space the `natural' signs wider
   - dehair this
  */
-Molecule*
-Key_item::do_brew_molecule_p() const
+Molecule 
+Key_item::do_brew_molecule() const
 {
-  Molecule*output = new Molecule;
+  Molecule mol;
 
   Staff_symbol_referencer_interface si (this);
   Real inter = si.staff_space ()/2.0;
@@ -118,7 +118,7 @@ Key_item::do_brew_molecule_p() const
               Molecule m =lookup_l ()->afm_find ("accidentals-0");
 
               m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS);
-              output->add_at_edge (X_AXIS, RIGHT, m,0);        
+              mol.add_at_edge (X_AXIS, RIGHT, m,0);    
             }
         }
 
@@ -130,17 +130,17 @@ Key_item::do_brew_molecule_p() const
       Interval x(0, inter);
       Interval y(0,0);
 
-      output->add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0);
+      mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0);
     }
  
   for (int i =0; i < pitch_arr_.size(); i++) 
     {
       Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i]));
       m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS);
-      output->add_at_edge (X_AXIS, RIGHT, m, 0);
+      mol.add_at_edge (X_AXIS, RIGHT, m, 0);
     }
 
-  return output;
+  return mol;
 }
 
 
index d18824b443a58c77df4ab3504b8ace86a5d517f9..249abd0743389dd843a477ec07924803cff7e359 100644 (file)
@@ -58,13 +58,17 @@ Local_key_item::accidental (int j, bool cautionary, bool natural) const
   return m;
 }
 
-Molecule*
-Local_key_item::do_brew_molecule_p() const
+/*
+  UGH. clean me up
+ */
+Molecule 
+Local_key_item::do_brew_molecule() const
 {
-  Molecule*output = new Molecule;
+  Molecule mol;
   Staff_symbol_referencer_interface si (this);
   Real note_distance = si.staff_space ()/2;
-  Molecule *octave_mol_p = 0;
+  Molecule octave_mol;
+  bool oct_b = false;
   int lastoct = -100;
   
   for  (int i = 0; i <  accidental_arr_.size(); i++) 
@@ -73,14 +77,14 @@ Local_key_item::do_brew_molecule_p() const
       // do one octave
       if (p.octave_i_ != lastoct) 
        {
-         if (octave_mol_p)
+         if (oct_b)
            {
              Real dy =lastoct*7* note_distance;
-             octave_mol_p->translate_axis (dy, Y_AXIS);
-             output->add_molecule (*octave_mol_p);
-             delete octave_mol_p;
+             octave_mol.translate_axis (dy, Y_AXIS);
+             mol.add_molecule (octave_mol);
+             octave_mol = Molecule ();
            }
-         octave_mol_p= new Molecule;
+         oct_b = true; 
        }
       
       lastoct = p.octave_i_;
@@ -94,15 +98,15 @@ Local_key_item::do_brew_molecule_p() const
                              accidental_arr_[i].natural_b_));
 
       m.translate_axis (dy, Y_AXIS);
-      octave_mol_p->add_at_edge (X_AXIS, RIGHT, m, 0);
+      octave_mol.add_at_edge (X_AXIS, RIGHT, m, 0);
     }
 
-  if (octave_mol_p)
+  if (oct_b)
     {
       Real dy =lastoct*7*note_distance;
-      octave_mol_p->translate_axis (dy, Y_AXIS);
-      output->add_molecule (*octave_mol_p);
-      delete octave_mol_p;
+      octave_mol.translate_axis (dy, Y_AXIS);
+      mol.add_molecule (octave_mol);
+      octave_mol = Molecule ();
     }
   
  if (accidental_arr_.size()) 
@@ -123,10 +127,10 @@ Local_key_item::do_brew_molecule_p() const
        Box b(Interval (0, gh_scm2double (pads[d]) * note_distance),
              Interval (0,0));
        Molecule m (lookup_l ()->fill (b));
-       output->add_at_edge (X_AXIS, d, m, 0);
+       mol.add_at_edge (X_AXIS, d, m, 0);
       } while ( flip (&d)!= LEFT);
     }
 
-  return output;
+  return mol;
 }
 
index 3d7a69474e88fcfa3f2781dc68338a83bde7ecab..45002d8eed960afa0f791885a3d2f9632f1d3795 100644 (file)
@@ -64,6 +64,7 @@ make_rational (SCM n, SCM d)
 
 #include "ly-smobs.icc"
 
+IMPLEMENT_UNSMOB(Moment,moment);
 IMPLEMENT_SMOBS(Moment);
 
 void
index 2b5ff1ac50eefb8110454b4ec4546bd19e03ed61..cba889d3f71924ee7f05401f26b33cca8c8abf56 100644 (file)
@@ -30,8 +30,8 @@ Multi_measure_rest::Multi_measure_rest ()
    [TODO]                                      17
  * variable-sized multi-measure rest symbol: |====| ??
 */
-Molecule*
-Multi_measure_rest::do_brew_molecule_p () const
+Molecule 
+Multi_measure_rest::do_brew_molecule () const
 {
   Real staff_space
     = staff_symbol_referencer (this).staff_space ();
@@ -48,7 +48,7 @@ Multi_measure_rest::do_brew_molecule_p () const
       sp_iv[d] = coldim[-d]  ;
     }
   while ((flip (&d)) != LEFT);
-  Molecule *mol_p  = new Molecule;
+  Molecule mol;
   Real x_off = 0.0;
 
   Real rx  = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
@@ -119,17 +119,17 @@ Multi_measure_rest::do_brew_molecule_p () const
       s = lookup_l ()->afm_find (idx);
     }
   
-  mol_p->add_molecule (s);
+  mol.add_molecule (s);
 
   if (measures > 1)
     {
       Molecule s (lookup_l ()->text ("number", to_str (measures), paper_l ()));
       s.align_to (X_AXIS, CENTER);
       s.translate_axis (3.0 * staff_space, Y_AXIS);
-      mol_p->add_molecule (s);
+      mol.add_molecule (s);
     }
-  mol_p->translate_axis (x_off, X_AXIS);
-  return mol_p;
+  mol.translate_axis (x_off, X_AXIS);
+  return mol;
 }
 
 /*
index d7da247660a90f0b37a419021e636ae9bbe7b97f..188d967f3bd6bce78c810e26f595a6c5b1c81af1 100644 (file)
@@ -26,7 +26,7 @@ Note_head::ledger_line (Interval xwid) const
 {
   Drul_array<Molecule> endings;
   endings[LEFT] = lookup_l()->afm_find ("noteheads-ledgerending");
-  Molecule * e = &endings[LEFT];
+  Molecule *e = &endings[LEFT];
   endings[RIGHT] = *e;
   
   Real thick = e->dim_[Y_AXIS].length();
@@ -79,8 +79,8 @@ Note_head::do_pre_processing ()
 
 
 
-Molecule*
-Note_head::do_brew_molecule_p() const 
+Molecule 
+Note_head::do_brew_molecule() const 
 {
   Staff_symbol_referencer_interface si (this);
   
@@ -98,15 +98,14 @@ Note_head::do_brew_molecule_p() const
       type = ly_scm2string (style);
     }
   
-  Molecule*  out =
-    new Molecule (lookup_l()->afm_find (String ("noteheads-") + to_str (balltype_i ()) + type));
+  Molecule   out = lookup_l()->afm_find (String ("noteheads-") + to_str (balltype_i ()) + type);
 
-  Box ledgerless = out->dim_;
+  Box ledgerless = out.dim_;
 
   if (streepjes_i) 
     {
       Direction dir = (Direction)sign (p);
-      Interval hd = out->dim_[X_AXIS];
+      Interval hd = out.dim_[X_AXIS];
       Real hw = hd.length ()/4;
       
       Molecule ledger (ledger_line  (Interval (hd[LEFT] - hw,
@@ -119,11 +118,11 @@ Note_head::do_brew_molecule_p() const
          Molecule s (ledger);
          s.translate_axis (-dir * inter_f * (i*2 + parity),
                           Y_AXIS);
-         out->add_molecule (s);
+         out.add_molecule (s);
        }
     }
 
-  out->dim_ = ledgerless;
+  out.dim_ = ledgerless;
   return out;
 }
 
index 671c59bf723b9b0e7dbb4d08f69d5d0580463020..783372390c783e7a0886d4189fef4feec0dc17ac 100644 (file)
@@ -37,8 +37,8 @@ Rest::do_post_processing ()
 }
 
 
-Molecule *
-Rest::do_brew_molecule_p () const
+Molecule 
+Rest::do_brew_molecule () const
 {
   bool ledger_b =false;
 
@@ -58,7 +58,7 @@ Rest::do_brew_molecule_p () const
 
   String idx =  ("rests-") + to_str (balltype_i ()) + (ledger_b ? "o" : "") + style;
 
-  return new Molecule(lookup_l ()->afm_find (idx));
+  return lookup_l ()->afm_find (idx);
 }
 
 
index e864d60875993f4168232cf5fcdff9e931211c20..83357769fa3c9d26f730e11e34d1bdf1226abb70 100644 (file)
@@ -31,8 +31,6 @@ Scheme_hash_table::do_smobify_self ()
 {
 }
 
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS(Scheme_hash_table);
 
 SCM
 Scheme_hash_table::mark_smob (SCM s)
@@ -108,3 +106,7 @@ Scheme_hash_table::to_alist () const
   return l;  
 }
 
+
+#include "ly-smobs.icc"
+IMPLEMENT_UNSMOB(Scheme_hash_table,scheme_hash);
+IMPLEMENT_SMOBS(Scheme_hash_table);
index 63a89e500f630105df6ed02fc2c793eb3348399c..bdc28e626aff13416e360958c365f685a23cd1e7 100644 (file)
@@ -30,7 +30,6 @@
 
 Score_element::Score_element()
 {
-  output_p_ =0;
   dim_cache_[X_AXIS] = new Dimension_cache;
   dim_cache_[Y_AXIS] = new Dimension_cache;
   dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this;
@@ -66,7 +65,6 @@ Score_element::Score_element (Score_element const&s)
   original_l_ =(Score_element*) &s;
   element_property_alist_ = SCM_EOL; // onstack;
 
-  output_p_ =0;
   status_i_ = s.status_i_;
   lookup_l_ = s.lookup_l_;
   pscore_l_ = s.pscore_l_;
@@ -76,7 +74,6 @@ Score_element::Score_element (Score_element const&s)
 
 Score_element::~Score_element()
 {
-  assert (!output_p_);
   assert (status_i_ >=0);
   status_i_  = -1;
 
@@ -146,12 +143,8 @@ Interval
 Score_element::molecule_extent(Dimension_cache const *c)
 {
   Score_element *s = dynamic_cast<Score_element*>(c->element_l());
-  Molecule*m = s->do_brew_molecule_p();
-  
-  Interval iv =  m->extent()[c->axis ()];
-
-  delete m;
-  return iv;
+  Molecule m = s->do_brew_molecule();
+  return   m.extent()[c->axis ()];
 }
 
 
@@ -255,11 +248,8 @@ Score_element::output_processing ()
   if (to_boolean  (get_elt_property ("transparent")))
     return;
 
-  // we're being silly here. 
-  if (output_p_)
-    delete output_p_;
   
-  output_p_ = do_brew_molecule_p ();
+  Molecule m (do_brew_molecule ());
   Offset o (relative_coordinate (0, X_AXIS), relative_coordinate (0, Y_AXIS));
 
   SCM s = get_elt_property ("extra-offset");
@@ -270,12 +260,7 @@ Score_element::output_processing ()
       o[Y_AXIS] += il * gh_scm2double (gh_cdr (s));      
     }
   
-  pscore_l_->outputter_l_->output_molecule (output_p_,
-                                           o,
-                                           classname(this));
-
-  delete output_p_;
-  output_p_ =0;
+  pscore_l_->outputter_l_->output_molecule (m.expr_, o, classname(this));
 }
 
 /*
@@ -316,22 +301,20 @@ Score_element::do_add_processing()
 
 
 
-Molecule*
-Score_element::do_brew_molecule_p() const
+Molecule 
+Score_element::do_brew_molecule() const
 {
   SCM glyph = get_elt_property ("glyph");
   if (gh_string_p (glyph))
     {
-      Molecule*output = new Molecule (lookup_l ()->afm_find (String (ly_scm2string (glyph))));
+      return lookup_l ()->afm_find (String (ly_scm2string (glyph)));
       
-      return output;
     }
   else
     {
       Interval emp;
       emp.set_empty ();
-      Molecule a (lookup_l ()->fill (Box (emp,emp)));
-      return new Molecule (a);
+      return lookup_l ()->fill (Box (emp,emp));
     }
 }
 
@@ -609,8 +592,8 @@ Score_element::fixup_refpoint ()
 
 #include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS(Score_element);
 IMPLEMENT_UNSMOB(Score_element, element);
+IMPLEMENT_SMOBS(Score_element);
 SCM
 Score_element::mark_smob (SCM ses)
 {
index 494faed2b4703446636f553ed9f46df9dfa078d1..7e19e16940ab95320646df44fd6949be31948e24 100644 (file)
@@ -56,15 +56,15 @@ Script::do_post_processing ()
   i.set_direction (d);
 }
 
-Molecule*
-Script::do_brew_molecule_p () const
+Molecule 
+Script::do_brew_molecule () const
 {
   Direction dir = DOWN;
   SCM d = get_elt_property ("direction");
   if (isdir_b (d))
     dir = to_dir (d);
   
-  return new Molecule (get_molecule (dir));
+  return get_molecule (dir);
 }
 
 
index 4393de2def4b7392a23383329a6505d1062d4733..0ee3142afdb8076c6cc1ae18b750fab693c10a6f 100644 (file)
@@ -123,15 +123,15 @@ Span_bar::height_callback (Dimension_cache const *c)
   return s->get_spanned_interval ();
 }
 
-Molecule*
-Span_bar::do_brew_molecule_p () const
+Molecule 
+Span_bar::do_brew_molecule () const
 {
   Interval iv (get_spanned_interval ());
-  Molecule*output = new Molecule;
+  Molecule output;
   SCM s = get_elt_property ("glyph");
   if (gh_string_p (s) && !iv.empty_b())
     {
-      output->add_molecule (lookup_l ()->bar (ly_scm2string (s),
+      output.add_molecule (lookup_l ()->bar (ly_scm2string (s),
                                              iv.length (),
                                              paper_l ()));
     }
index 10d7927201b4aaffa53b71754734aaf6487e9cb6..21123e75d96de75f9bfe88e3bd1e97fc08f37a2a 100644 (file)
@@ -15,8 +15,8 @@
 
 
 
-Molecule*
-Staff_symbol::do_brew_molecule_p() const
+Molecule 
+Staff_symbol::do_brew_molecule() const
 {
   Score_element * common
     = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
@@ -28,18 +28,18 @@ Staff_symbol::do_brew_molecule_p() const
     ;
 
   Real t = paper_l ()->get_var ("stafflinethickness");
-  Molecule rule  = lookup_l ()->filledbox (Box (Interval (0,width),
-                                               Interval (-t/2, t/2)));
-
   int l = line_count ();
   
   Real height = (l-1) * staff_space () /2;
-  Molecule * m = new Molecule;
+  Molecule  m;
   for (int i=0; i < l; i++)
     {
-      Molecule a (rule);
+      Molecule a =
+       lookup_l ()->filledbox (Box (Interval (0,width),
+                                    Interval (-t/2, t/2)));
+
       a.translate_axis (height - i * staff_space (), Y_AXIS);
-      m->add_molecule (a);
+      m.add_molecule (a);
     }
 
   return m;
index 57b35d875e12b6e944b181f016a6bbac47c7403b..d6b2fcfa4ce1c624ea2da244f4ed01c606c49b97 100644 (file)
@@ -42,8 +42,8 @@ Stem_tremolo::dim_callback (Dimension_cache const *c)
 }
 
 
-Molecule*
-Stem_tremolo::do_brew_molecule_p () const
+Molecule 
+Stem_tremolo::do_brew_molecule () const
 {
   Stem * st = stem_l ();
   int mult =0;
@@ -85,20 +85,20 @@ Stem_tremolo::do_brew_molecule_p () const
       abbrev_flags = gh_scm2int (a);
   }
 
-  Molecule *beams= new Molecule
+  Molecule mol
   for (int i = 0; i < abbrev_flags; i++)
     {
       Molecule b (a);
       b.translate_axis (interbeam_f * i, Y_AXIS);
-      beams->add_molecule (b);
+      mol.add_molecule (b);
     }
-  beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS);
+  mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS);
 
   if (st)
     { 
       if (st->beam_l ())
         {
-         beams->translate (Offset(st->hpos_f () - hpos_f (),
+         mol.translate (Offset(st->hpos_f () - hpos_f (),
            st->stem_end_position () * half_staff_space - 
            directional_element (st->beam_l ()).get () * beams_i * interbeam_f));
        }
@@ -107,7 +107,7 @@ Stem_tremolo::do_brew_molecule_p () const
          /*
            Beams should intersect one beamthickness below staff end
           */
-         Real dy = - beams->extent ()[Y_AXIS].length () / 2 * st->get_direction ();
+         Real dy = - mol.extent ()[Y_AXIS].length () / 2 * st->get_direction ();
 
          /*
            uhg.  Should use relative coords and placement
@@ -117,7 +117,7 @@ Stem_tremolo::do_brew_molecule_p () const
            : 0.0;
         
          dy += st->stem_end_position ();
-         beams->translate (Offset(st->hpos_f () - hpos_f ()+
+         mol.translate (Offset(st->hpos_f () - hpos_f ()+
                                   whole_note_correction, dy));
        }
 
@@ -127,7 +127,7 @@ Stem_tremolo::do_brew_molecule_p () const
        */
     }
   
-  return beams;
+  return mol;
 }
 
 
index 2061caf1c2d2e0db5d20984b43b6107c298f8d1f..ce3312a9b11dd405d5eb47898c74e67b342456f9 100644 (file)
@@ -444,10 +444,10 @@ Stem::dim_callback (Dimension_cache const* c)
 
 const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh!
 
-Molecule*
-Stem::do_brew_molecule_p () const
+Molecule 
+Stem::do_brew_molecule () const
 {
-  Molecule *mol_p =new Molecule;
+  Molecule mol;
 
   Staff_symbol_referencer_interface si (first_head ());
   
@@ -468,17 +468,17 @@ Stem::do_brew_molecule_p () const
       Real stem_width = paper_l ()->get_var ("stemthickness");
       Molecule ss =lookup_l ()->filledbox (Box (Interval (-stem_width/2, stem_width/2),
                                                 Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)));
-      mol_p->add_molecule (ss);
+      mol.add_molecule (ss);
     }
 
   if (!beam_l () && abs (flag_i ()) > 2)
     {
       Molecule fl = flag ();
       fl.translate_axis(stem_y[get_direction ()]*dy, Y_AXIS);
-      mol_p->add_molecule (fl);
+      mol.add_molecule (fl);
     }
 
-  return mol_p;
+  return mol;
 }
 
 Real
index 034173e7c5688a18c6fe3d292b99340a9b91f0cd..ea0c6f2475aa8efc99a036004c48c2d6c9f313dd 100644 (file)
 #include "paper-def.hh"
 #include "lookup.hh"
 
-Molecule*
-Text_item::do_brew_molecule_p () const
+Molecule 
+Text_item::do_brew_molecule () const
 {
   SCM style = get_elt_property ("style");
   String st = gh_string_p (style) ?  ly_scm2string (style) : "";
   SCM txt = get_elt_property ("text");
   String t = gh_string_p (txt) ? ly_scm2string (txt) : "";
   
-  Molecule a= paper_l ()->lookup_l(0)->text (st, t, paper_l ());
-
-  return new Molecule (a);
+  return paper_l ()->lookup_l(0)->text (st, t, paper_l ());
 }
 
 
index 24f0fa73f0d8cd51a49da566cacad039146bbcd8..0c11decc33c32b5a435813f2bad4e3d33b9d9f1b 100644 (file)
@@ -19,8 +19,8 @@ Time_signature::Time_signature ()
 }
 
 // ugh.!
-Molecule*
-Time_signature::do_brew_molecule_p () const
+Molecule 
+Time_signature::do_brew_molecule () const
 {
   SCM st = get_elt_property ("style");
 
@@ -39,15 +39,15 @@ Time_signature::do_brew_molecule_p () const
       String style (ly_scm2string (st));
       if (style[0]=='1')
        {
-         return new Molecule (time_signature (n, 0));
+         return time_signature (n, 0);
        }
       else
        {
-         return new Molecule (special_time_signature (style, n, d));
+         return special_time_signature (style, n, d);
        }
     }
   else
-    return new Molecule (time_signature (n,d));
+    return     time_signature (n,d);
 }
 
 Molecule
index 766b636fe0d18317df743708365c44173ff33d53..36782cb6fc193f02dc2d538f28c891d76fbd3aed 100644 (file)
@@ -31,10 +31,10 @@ Tuplet_spanner::Tuplet_spanner ()
 /*
   TODO. 
  */
-Molecule*
-Tuplet_spanner::do_brew_molecule_p () const
+Molecule 
+Tuplet_spanner::do_brew_molecule () const
 {
-  Molecule* mol_p = new Molecule;
+  Molecule  mol;
 
   // Default behaviour: number always, bracket when no beam!
   bool par_beam = to_boolean (get_elt_property ("parallel-beam"));
@@ -82,7 +82,7 @@ Tuplet_spanner::do_brew_molecule_p () const
        
          num.translate_axis (dy/2, Y_AXIS);
 
-         mol_p->add_molecule (num);
+         mol.add_molecule (num);
        }
       
       Real thick = paper_l ()->get_var ("tuplet_thick");
@@ -99,12 +99,13 @@ Tuplet_spanner::do_brew_molecule_p () const
                                       gh_int2scm (dir),
                                       SCM_UNDEFINED);
 
-         mol_p->add_atom (at);
+         Box b;
+         mol.add_molecule (Molecule (b, at));
        }
 
-      mol_p->translate_axis (dir * staff_space, Y_AXIS);
+      mol.translate_axis (dir * staff_space, Y_AXIS);
     }
-  return mol_p;
+  return mol;
 }
   
 void
index fba5da483193ee74d88c127e5311fcd35754373b..0fac7a6c2338018cc5974f5bb74e04f9db33364f 100644 (file)
@@ -32,16 +32,16 @@ Volta_spanner::Volta_spanner ()
 /*
   FIXME: too complicated.
  */
-Molecule*
-Volta_spanner::do_brew_molecule_p () const
+Molecule 
+Volta_spanner::do_brew_molecule () const
 {
-  Molecule* mol_p = new Molecule;
+  Molecule  mol;
 
   Link_array<Bar> bar_arr
     = Group_interface__extract_elements (this, (Bar*)0, "bars");
 
   if (!bar_arr.size ())
-    return mol_p;
+    return mol;
 
   Link_array<Score_element> note_column_arr
     = Group_interface__extract_elements (this, (Score_element*)0, "note-columns");
@@ -68,8 +68,6 @@ Volta_spanner::do_brew_molecule_p () const
   Real w = spanner_length() - dx - get_broken_left_end_align ();
   Real h = paper_l()->get_var ("volta_spanner_height");
 
-  Molecule volta; 
-
   SCM at = (gh_list (ly_symbol2scm ("volta"),
                     gh_double2scm (h),
                     gh_double2scm (w),
@@ -77,10 +75,8 @@ Volta_spanner::do_brew_molecule_p () const
                     gh_int2scm (no_vertical_start),
                     gh_int2scm (no_vertical_end),
                     SCM_UNDEFINED));
-
-  volta.dim_[Y_AXIS] = Interval (- h/2, h/2);
-  volta.dim_[X_AXIS] = Interval (0, w);
-  volta.add_atom (at);
+  Box b (Interval (- h/2, h/2),  Interval (0, w));
+  Molecule volta(b,at);
   
   Molecule num (lookup_l ()->text ("volta",
                                   ly_scm2string (get_elt_property("text")),
@@ -103,10 +99,10 @@ Volta_spanner::do_brew_molecule_p () const
   Offset off (num.dim_.x ().length () + gap, 
              h / half_staff_space - gap);
   num.translate (off);
-  mol_p->add_molecule (volta);
-  mol_p->add_molecule (num);
-  mol_p->translate (Offset (0, dy));
-  return mol_p;
+  mol.add_molecule (volta);
+  mol.add_molecule (num);
+  mol.translate (Offset (0, dy));
+  return mol;
 }
   
 void
index 2a7838c996903965a8fd75203cb4531f0cabb5df..974dae0b7b9a4359d31b1102d85546edc3bedd0f 100644 (file)
@@ -67,6 +67,27 @@ slur_y_gap = 0.25 * \staffspace;
 slur_y_free = 0.75 * \staffspace;
 slur_x_minimum = 1.5 * \staffspace;
 
+
+% use tangent controls or area asymmetry?
+bezier_area = 1.0;
+bezier_asymmetry = 1.0;
+bezier_beautiful = 2.0;
+
+% The constants that define the valid areas for the middle control points
+% Used in de_uglyfy.  Bit empirical.
+bezier_control1 = 1.5;
+bezier_control2 = 0.8;
+bezier_control3 = -2.0;
+
+% URG: the magic constants for area asymmetry
+bezier_pct_c0 = -0.2;
+bezier_pct_c3 = 0.000006;
+bezier_pct_out_max = 0.8;
+bezier_pct_in_max = 1.2;
+bezier_area_steps = 1.0;
+
+bezier_before_blowfit = 0.5;
+
 %{
 Like beams, slurs often aren't as steep as the notes they encompass.
 This sets the amount of damping.
index a8fd2500e34c9f5f506df45e37a5ba33d3cfe6f1..72159223f04202548426f3038fafb096de85eab7 100644 (file)
--- a/mf/as5.af
+++ b/mf/as5.af
@@ -4,6 +4,12 @@
 
        Comment (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
 
+       Comment Thanks go to out to  participants in discussions on
+       Comment alt.ascii-art and rec.music.compose
+
+       Comment noteheads-0 by llizard/ejm <llizard_ejm@yahoo.com>
+       Comment and Shaun Mead <shaun.mead@ns.sympatico.ca>
+
        Comment Lines that start with TAB or FF make up the .afm
        Comment TABs are comments
        Comment `Comment' is the afm comment prefix
index c2597e99356de8ba66686c18e27ffa00e3b6450f..60af874e3731ce4a370b1c12755c985de70d2c44 100644 (file)
--- a/mf/as9.af
+++ b/mf/as9.af
@@ -3,6 +3,16 @@
        Comment part of LilyPond's [ascii music font]
 
        Comment (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+       
+       Comment Thanks go to out to  participants in discussions on
+       Comment alt.ascii-art and rec.music.compose
+
+       Comment first noteheads-2 (although erroneously named) by
+       Comment   Wesley Clifford <parallax@apk.net>
+       Comment rests-2 by Ben Norwood <bdn95@aber.ac.uk>
+       Comment accidentals--1 and suggestions for noteheads by
+       Comment   Ben Norwood <bdn95@aber.ac.uk>
+
 
        Comment Lines that start with TAB or FF make up the .afm
        Comment TABs are comments
index 1ec52fc4a11d157453d1cebdc6e4f8ff8aa73eb0..b185a9bbcd5152330f72ac42a644f6aeec220f4b 100644 (file)
@@ -100,7 +100,7 @@ Mudela_stream::header()
   *os_p_ << filename_str_g;
   *os_p_ << "\n\n";
   // ugh
-  *os_p_ << "\\version \"1.2.7\";\n";
+  *os_p_ << "\\version \"1.3.4\";\n";
 }
 
 void