]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.96
authorfred <fred>
Tue, 26 Mar 2002 23:57:10 +0000 (23:57 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:57:10 +0000 (23:57 +0000)
15 files changed:
input/scarlatti-properties.ly
lily/align-interface.cc
lily/break-align-item.cc
lily/crescendo.cc
lily/dynamic-engraver.cc
lily/hyphen-spanner.cc
lily/include/crescendo.hh
lily/include/score-element.hh
lily/include/spaceable-element.hh
lily/include/text-spanner.hh [new file with mode: 0644]
lily/lyric-extender.cc
lily/spacing-spanner.cc
lily/stem-tremolo.cc
lily/syllable-group.cc
lily/tie.cc

index 4dc3154eaa2f912b14765471d75f94af88aab431..b364b406d20f82d4a350608fcad4af75c5d268d8 100644 (file)
@@ -3,20 +3,32 @@
 
 \version "1.3.93";
 
-rh=\property Thread.noteHeadStyle=##f 
-lh=\property Thread.noteHeadStyle = #'diamond
-n=\property Thread.fontSize=#0  
-sm=\property Thread.fontSize=#-1 
+rh=\property Thread.NoteHead \push #'style = #'default
+lh=\property Thread.NoteHead \push #'style = #'diamond
+
+n = \property Thread.NoteHead \pop #'font-size % = #'diamond %\property Thread.fontSize=#0  
+sm=\property Thread.NoteHead \push #'font-size = #-1 
+
 % su=\property Voice.verticalDirection=#1  
 % sd=\property Voice.verticalDirection=#-1
 
 su=\property Voice.Stem \push #'direction = #1
 sd=\property Voice.Stem \push #'direction = #-1  
 
-zs=\property Voice.forceHorizontalShift=#0.0
+
+%{
 ls=\property Voice.forceHorizontalShift=#-0.6
 sls=\property Voice.forceHorizontalShift=#-0.22
 rs=\property Voice.forceHorizontalShift=#0.6
 srs=\property Voice.forceHorizontalShift=#0.22
+%}
+zs = \property Voice.NoteColumn \pop #'force-hshift  % #0.0
+ls = \property Voice.NoteColumn \push #'force-hshift = #-0.6
+sls= \property Voice.NoteColumn \push #'force-hshift = #-0.22
+rs = \property Voice.NoteColumn \push #'force-hshift = #0.6
+srs= \property Voice.NoteColumn \push  #'force-hshift = #0.22
+
+
+
 ab=\property Voice.noAutoBeaming=##f
 xb=\property Voice.noAutoBeaming=##t
index 8bc3f13f251e42d9d008f01f6dabea9843db9cda..12c8683d78fa4e71b7cfd6b894f6c0103de6e655 100644 (file)
@@ -54,7 +54,7 @@ Align_interface::do_side_processing (Score_element * me, Axis a)
     = Pointer_group_interface__extract_elements (  me, (Score_element*) 0, "elements");
   for (int i=0; i < all_elts.size(); i++) 
     {
-      Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (me, a);
+      Interval y = all_elts[i]->extent(me, a);
       if (!y.empty_b())
        {
          Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
index b8d87a0112088d0f222f51b4efd2d9d5884907dd..1ffdb1325c7fab7e08d9a14ce46d6705c111237b 100644 (file)
@@ -87,7 +87,7 @@ Break_align_interface::do_alignment (Score_element *me)
   
   for (int i=0; i < all_elems.size(); i++) 
     {
-      Interval y = all_elems[i]->extent(X_AXIS);
+      Interval y = all_elems[i]->extent(all_elems[i], X_AXIS);
       if (!y.empty_b())
        elems.push (dynamic_cast<Score_element*> (all_elems[i]));
     }
@@ -175,13 +175,13 @@ Break_align_interface::do_alignment (Score_element *me)
 
   Real pre_space = elems[0]->relative_coordinate (column, X_AXIS);
 
-  Real xl = elems[0]->extent (X_AXIS)[LEFT];
+  Real xl = elems[0]->extent (elems[0],X_AXIS)[LEFT];
   if (!isinf (xl))
     pre_space += xl;
   else
     programming_error ("Infinity reached. ");
 
-  Real xr = elems.top ()->extent (X_AXIS)[RIGHT];
+  Real xr = elems.top ()->extent (elems.top (), X_AXIS)[RIGHT];
   Real spring_len = elems.top ()->relative_coordinate (column, X_AXIS);
   if (!isinf (xr))
     spring_len += xr;
index 616e43125306c54148218ddf91ac3af809ee89ae..3e021dbc02cf00c54cbb1b7836eb1a0713af40aa 100644 (file)
 #include "debug.hh"
 #include "paper-column.hh"
 
-void
-Crescendo::set_interface (Score_element*s)
-{
-  s->set_elt_property ("dynamic-drul", gh_cons (SCM_EOL, SCM_EOL));
-}
-
-
-
-MAKE_SCHEME_CALLBACK(Crescendo,brew_molecule,1);
-
-/*
-
-  TODO:
-
-  * should span the crescendo on any dynamic-text items, and
-  calculate their dimensions to determine shortening; junk shortening
-  code and related elt props.
-
-  * separate the dashed-line version and the hairpin version into two
-  brew_molecule functions.
+MAKE_SCHEME_CALLBACK (Crescendo, brew_molecule, 1);
 
-  * generalise dashed-line into generic text spanner, for ottava, accelerando, etc.
-
-  
-*/
 SCM
 Crescendo::brew_molecule (SCM smob) 
 {
   Score_element *me= unsmob_element (smob);
-  Spanner * sp = dynamic_cast<Spanner*>(me);
-  Real ss = me->paper_l ()->get_var ("staffspace");
-  Real sl = me->paper_l ()->get_var ("stafflinethickness");  
+  Spanner *span = dynamic_cast<Spanner*>(me);
+  Real staff_space = me->paper_l ()->get_var ("staffspace");
+  Real line = me->paper_l ()->get_var ("stafflinethickness");  
   
-  Real absdyn_dim = gh_scm2double (me->get_elt_property ("shorten-for-letter"));
-  Real extra_left =  sp->get_broken_left_end_align ();
+  Real broken_left =  span->get_broken_left_end_align ();
 
-  SCM dir = me->get_elt_property("grow-direction");
-  SCM dyns = me->get_elt_property ("dynamic-drul");
-
-  if (!isdir_b (dir) || !gh_pair_p (dyns))
+  SCM s = me->get_elt_property("grow-direction");
+  if (!isdir_b (s))
     {
       me->suicide ();
       return SCM_EOL;
     }
   
-  Direction gd = to_dir (dir);
+  Direction grow_dir = to_dir (s);
 
-  bool dynleft= unsmob_element (gh_car (dyns));
-  bool dynright = unsmob_element (gh_cdr (dyns));
-  
-  if (dynleft)
-    extra_left += absdyn_dim;
-
-  Real width = sp->spanner_length()- sp->get_broken_left_end_align ();
-
-  if (dynleft)
-    {
-      width -= absdyn_dim;
-    }
-  if (dynright)
-    {
-      width -= absdyn_dim;
-    }
+  Real width = span->spanner_length ();
+  width -= span->get_broken_left_end_align ();
 
   if (width < 0)
     {
-      warning (_ ("crescendo") + " " + _ ("too small"));
+      warning (_ ((grow_dir < 0) ? "decrescendo too small"
+                 : "crescendo too small"));
       width = 0;
     }
 
@@ -89,68 +50,28 @@ Crescendo::brew_molecule (SCM smob)
   Direction d = LEFT;
   do
     {
-      Paper_column* s = dynamic_cast<Paper_column*>(sp->get_bound (d)); // UGH
+      Paper_column* s = dynamic_cast<Paper_column*> (span->get_bound (d)); // UGH
       broken[d] = (!s->musical_b ());
     }
   while (flip (&d) != LEFT);
   
-  Molecule m;
+  bool continued = broken[Direction (-grow_dir)];
+  Real height = staff_space * gh_scm2double (me->get_elt_property ("height"));
+  Real thick = line * gh_scm2double (me->get_elt_property ("thickness"));
   
-  Real pad = 0;
-  SCM s = me->get_elt_property ("start-text");
-  if (gh_string_p (s))
-    {
-      Molecule start_text (me->lookup_l ()->text ("italic",
-                                             ly_scm2string (s),
-                                                 me->paper_l ()));
-      m.add_molecule (start_text);
-
-      pad = me->paper_l ()->get_var ("staffspace") / 2;        //  ugh.
-
-      width -= start_text.extent (X_AXIS).length ();
-      width -= pad;
-      width = width >? 0;
-    }
-
-  SCM at;
-  s =me->get_elt_property ("spanner");
-  Real height;
-
-  if (gh_string_p (s) && ly_scm2string (s) == "dashed-line")
-    {
-      Real thick = gh_scm2double (me->get_elt_property ("dash-thickness")) * sl ;
-      Real dash = gh_scm2double (me->get_elt_property  ("dash-length")) * ss;
-      
-      height = thick;
-      at = gh_list (ly_symbol2scm (ly_scm2string (s).ch_C ()),
-                   gh_double2scm (thick),
-                   gh_double2scm (dash),
-                   gh_double2scm (width),
-                   SCM_UNDEFINED);
-    }
-  else
-    {
-      bool continued = broken[Direction (-gd)];
-      height = ss * gh_scm2double (me->get_elt_property ("height"));
-      Real thick = sl * gh_scm2double (me->get_elt_property ("thickness"));
-      
-      const char* hairpin = (gd < 0)? "decrescendo" :  "crescendo";
-
-      at = gh_list (ly_symbol2scm (hairpin),
+  const char* type = (grow_dir < 0) ? "decrescendo" :  "crescendo";
+  SCM hairpin = gh_list (ly_symbol2scm (type),
                    gh_double2scm (thick),
                    gh_double2scm (width),
                    gh_double2scm (height),
                    gh_double2scm (continued ? height/2 : 0.0),
                    SCM_UNDEFINED);
-    }
-  Box b (Interval (0, width), Interval (-2*height, 2*height));
-  Molecule span (b, at);
 
-  m.add_at_edge (X_AXIS, RIGHT, span, pad);
-  m.translate_axis (extra_left, X_AXIS);
+  Box b (Interval (0, width), Interval (-2*height, 2*height));
+  Molecule mol (b, hairpin);
+  mol.translate_axis (broken_left, X_AXIS);
 
-  return m.create_scheme ();
+  return mol.create_scheme ();
 }
 
 
index a1fc434742f92cb2b28f6e622b5b886d76108443..d7bc14459fdd0392d2b4821978f3baa9e6f761b7 100644 (file)
@@ -107,6 +107,9 @@ Dynamic_engraver::do_try_music (Music * m)
          if (line_spanner_)
            line_spanner_->suicide ();
          line_spanner_ = 0;
+         if (cresc_p_)
+           cresc_p_->suicide ();
+         cresc_p_ = 0;
        }
       else if ((s->span_type_str_ == "crescendo"
           || s->span_type_str_ == "decrescendo"))
@@ -225,64 +228,49 @@ Dynamic_engraver::do_process_music ()
       else
        {
          current_cresc_req_ = accepted_spanreqs_drul_[START];
-         cresc_p_  = new Spanner (get_property ("Crescendo"));
-         Crescendo::set_interface (cresc_p_);
-         cresc_p_->set_elt_property
-           ("grow-direction",
-            gh_int2scm ((accepted_spanreqs_drul_[START]->span_type_str_ == "crescendo")
-                        ? BIGGER : SMALLER));
-             
-         SCM s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Text").ch_C());
-         if (gh_string_p (s))
-           {
-             cresc_p_->set_elt_property ("start-text", s);
-             daddy_trans_l_->set_property (accepted_spanreqs_drul_[START]->span_type_str_
-                                           + "Text", SCM_UNDEFINED);
-           }
-
-         s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Spanner").ch_C());
-
 
          /*
            TODO: Use symbols.
           */
-         if (gh_string_p (s)) //&& ly_scm2string (s) != "hairpin")
+         SCM s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Spanner").ch_C());
+
+         if (!gh_string_p (s) || ly_scm2string (s) == "hairpin")
+           {
+             cresc_p_  = new Spanner (get_property ("Crescendo"));
+             cresc_p_->set_elt_property ("grow-direction",
+                                         gh_int2scm ((accepted_spanreqs_drul_[START]->span_type_str_ == "crescendo")
+                                                     ? BIGGER : SMALLER));
+             
+           }
+         /*
+           This is a convenient (and legacy) interface to TextSpanners
+           for use in (de)crescendi.
+           Hmm.
+          */
+         else
            {
-             cresc_p_->set_elt_property ("spanner", s);
+             cresc_p_  = new Spanner (get_property ("TextSpanner"));
+             cresc_p_->set_elt_property ("type", s);
              daddy_trans_l_->set_property (accepted_spanreqs_drul_[START]->span_type_str_
                                            + "Spanner", SCM_UNDEFINED);
+             s = get_property ((accepted_spanreqs_drul_[START]->span_type_str_ + "Text").ch_C());
+             if (gh_string_p (s))
+               {
+                 cresc_p_->set_elt_property ("edge-text",
+                                             gh_cons (s, ly_str02scm ("")));
+                 daddy_trans_l_->set_property (accepted_spanreqs_drul_[START]->span_type_str_
+                                               + "Text", SCM_UNDEFINED);
+               }
            }
-
+       
          Score_element *cc = unsmob_element (get_property ("currentMusicalColumn"));
          cresc_p_->set_bound (LEFT, cc);
 
-
-         /* 
-             We know how wide the text is, if we can be sure that the
-             text already has relevant pointers into the paperdef,
-             and it has its font-size property set.
-
-             Since font-size may be set by a context higher up, we
-             can not be sure of the size.
-
-
-             We shouldn't try to do this stuff here, the Item should
-             do it when the score is finished.  We could maybe
-             set a callback to have the Item do the alignment if
-             it is not a special symbol, like Crescendo.
-         */
-
-         
          if (text_p_)
            {
-             index_set_cell (cresc_p_->get_elt_property ("dynamic-drul"),
-                             LEFT, text_p_->self_scm ());
-
-             if (finished_cresc_p_
-             // I don't see why, but we need this check
-                 && gh_pair_p (finished_cresc_p_->get_elt_property ("dynamic-drul")))
-               index_set_cell (finished_cresc_p_->get_elt_property ("dynamic-drul"),
-                               RIGHT, text_p_->self_scm ());
+             Side_position::set_direction (text_p_, LEFT);
+             Side_position::set_axis (text_p_, X_AXIS);
+             Side_position::add_support (text_p_, cresc_p_);
            }
 
          Axis_group_interface::add_element (line_spanner_, cresc_p_);
index eb64b7d13469e21e7c19bc1ce8b0254172f771ed..3ff71c7743420fd640854ae71088d5ba313731a8 100644 (file)
@@ -37,9 +37,7 @@ Hyphen_spanner::brew_molecule (SCM smob)
   
   do
     {
-      Real  x = sp->get_bound (d)->relative_coordinate (common, X_AXIS);
-      Interval ext =  sp->get_bound (d)->extent (X_AXIS);
-      bounds[d] = (x + ext[-d]);
+      bounds[d] = sp->get_bound (d)->extent (common, X_AXIS)[-d];
     }
   while (flip (&d) != LEFT);
 
index e7e4a16c522903b0a185ffe12770907a6fe33975..0fe05d839650f06c77675ebeaabae1079a5b01f6 100644 (file)
@@ -19,8 +19,7 @@
 struct Crescendo
 {
 public:
-  DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
-  static void set_interface(Score_element*);
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
   static bool has_interface (Score_element*);
 };
 
index 99742defe0d9ea2ee76f236ad81146d3006aace8..81fa3115fce0ad28a88e22ae4dfcb56ea4611f10 100644 (file)
@@ -18,8 +18,8 @@
     for administration of what was done already
     */
 enum Score_element_status {
-  ORPHAN=0,                    // not yet added to pstaff
-  VIRGIN,                      // added to pstaff
+  ORPHAN=0,                    // not yet added to Paper_score
+  VIRGIN,      
   PRECALCING,
   PRECALCED,           // calcs before spacing done
   POSTCALCING,         // busy calculating. This is used to trap cyclic deps.
@@ -152,7 +152,8 @@ public:
 
 public:
   bool empty_b (Axis a) const;
-  Interval extent (Axis) const;
+
+  Interval extent (Score_element * refpoint, Axis) const;
  
   /**
     translate in one direction
index 9b719077072d641e5f015fb6c4393e9e8d7567e8..577f8902e1f842329d02305697aa15f88abb59f7 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
+
 /*
   properties :
 
@@ -21,7 +22,6 @@
   
   dir-list -- list of stem directions.
  */
-
 struct Spaceable_element
 {
   /// set a minimum distance
diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh
new file mode 100644 (file)
index 0000000..34f4432
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  text-spanner.hh -- declare Text_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+
+#ifndef TEXT_SPANNER_HH
+#define TEXT_SPANNER_HH
+
+#include "lily-guile.hh"
+
+class Text_spanner
+{
+public:
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+  static bool has_interface (Score_element*);
+};
+
+#endif /* TEXT_SPANNER_HH */
index fb09d42307e3056932fa5fff0fbb643f044d3db3..744e3d6e2174f3719b1e55def8fd0a0adfb9d7b6 100644 (file)
@@ -21,8 +21,10 @@ SCM
 Lyric_extender::brew_molecule (SCM smob) 
 {
   Spanner *sp = dynamic_cast<Spanner*> (unsmob_element (smob));
-  
-  Real leftext = sp->get_bound (LEFT)->extent (X_AXIS).length ();
+
+  // ugh: refp
+  Real leftext = sp->get_bound (LEFT)->extent (sp->get_bound (LEFT),
+                                              X_AXIS).length ();
   Real ss = sp->paper_l ()->get_var ("staffspace");
   Real sl = sp->paper_l ()->get_var ("stafflinethickness");  
   Real righttrim = 0.5; // default to half a staffspace gap on the right
index 43ef9b974ad0480587fc86f14d8d382914422829..a1f329fc37a59267e37226ddf603b046df90194f 100644 (file)
@@ -128,7 +128,7 @@ Spacing_spanner::do_measure (Score_element*me, Link_array<Score_element> cols)
            }
          else
            {
-             Interval ext (rc->extent (X_AXIS));
+             Interval ext (rc->extent (rc, X_AXIS));
              right_dist =  ext.empty_b() ? 0.0 : - ext [LEFT];
            }
 
@@ -186,7 +186,7 @@ Real
 Spacing_spanner::default_bar_spacing (Score_element*me, Score_element *lc, Score_element *rc,
                                      Moment shortest) 
 {
-  Real symbol_distance = lc->extent (X_AXIS)[RIGHT] ;
+  Real symbol_distance = lc->extent (lc,X_AXIS)[RIGHT] ;
   Real durational_distance = 0;
   Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc);
 
index 2db2edad8aae981d3791a9f4ca7c6b7e08b4ac27..46d14dcfea6fa82ed2cd6ed1b66baaa46b589c25 100644 (file)
@@ -126,8 +126,11 @@ Stem_tremolo::brew_molecule (SCM smob)
       */
       Real whole_note_correction;
       if (Stem::invisible_b (stem ))
-       whole_note_correction = -Stem::get_direction (stem )
-         * Stem::support_head (stem )->extent (X_AXIS).length () / 2;
+       {
+         Score_element *hed = Stem::support_head (stem );
+         whole_note_correction = -Stem::get_direction (stem )
+           *hed->extent (hed, X_AXIS).length () / 2;
+       }
       else
        whole_note_correction = 0;
         
index f1438f69f8012b10c82efa167c7afdb4144669ca..66dc8830c4d92f68c6e7a7d1fb4f6ad1a6b21d40 100644 (file)
@@ -67,9 +67,9 @@ Syllable_group::add_lyric(Score_element * lyric)
   lyric_list_.push(lyric);
   /* record longest and shortest lyrics */
   if( longest_lyric_l_ ) {
-    if(lyric->extent(X_AXIS).length() > (longest_lyric_l_->extent(X_AXIS)).length())
+    if(lyric->extent(lyric,X_AXIS).length() > (longest_lyric_l_->extent(longest_lyric_l_, X_AXIS)).length())
       longest_lyric_l_ = lyric;
-    if(lyric->extent(X_AXIS).length() < (shortest_lyric_l_->extent(X_AXIS)).length())
+    if(lyric->extent(lyric, X_AXIS).length() < (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length())
       shortest_lyric_l_ = lyric;
   }
   else
@@ -90,7 +90,7 @@ Syllable_group::add_extender(Score_element * extender)
     // Right:
     Real ss = extender->paper_l ()->get_var ("staffspace");
     extender->set_elt_property("right-trim-amount", 
-                              gh_double2scm(-notehead_l_->extent(X_AXIS).length()/ss));
+                              gh_double2scm(-notehead_l_->extent(notehead_l_, X_AXIS).length()/ss));
   }
 }
 
@@ -122,7 +122,7 @@ Syllable_group::set_lyric_align(const char *punc, Score_element *default_notehea
       lyric->set_parent(notehead_l_, X_AXIS);
       lyric->add_offset_callback (Side_position::centered_on_parent_proc, X_AXIS);
       // reference is on the right of the notehead; move it left half way, and add translation
-      lyric->translate_axis (group_translation_f_-(notehead_l_->extent(X_AXIS)).center(), X_AXIS);
+      lyric->translate_axis (group_translation_f_-(notehead_l_->extent(notehead_l_, X_AXIS)).center(), X_AXIS);
     }
   }
   return (notehead_l_);
@@ -142,11 +142,11 @@ Syllable_group::amount_to_translate()
   Real translate = 0.0;
   if(alignment_i_ != CENTER) {
     // FIXME: do we really know the lyric extent here? Some font sizing comes later?
-    if((longest_lyric_l_->extent(X_AXIS)).length() <
-       (shortest_lyric_l_->extent(X_AXIS)).length() * 2 )
-      translate = alignment_i_*(longest_lyric_l_->extent(X_AXIS)).length()/2;
-    else
-      translate = alignment_i_*(shortest_lyric_l_->extent(X_AXIS)).length();
+    Real l1 = longest_lyric_l_->extent(longest_lyric_l_, X_AXIS).length() / 2;
+    Real l2 = shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS).length();
+
+    translate = l1 <? l2;
+    translate *= alignment_i_ ;
   }
   return translate;
 }
@@ -215,10 +215,10 @@ Syllable_group::adjust_melisma_align()
     switch (alignment_i_) {
       //  case LEFT: // that's all
     case CENTER: // move right so smallest lyric is left-aligned on notehead
-      translation += (shortest_lyric_l_->extent(X_AXIS)).length()/2;
+      translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length()/2;
       break;
     case RIGHT: // move right so smallest lyric is left-aligned on notehead
-      translation += (shortest_lyric_l_->extent(X_AXIS)).length();
+      translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length();
       break;
     }
     group_translation_f_ += translation;
index f3952962883fe0115aa15447d2ffa25c392f2307..39bc2306de81bbc0e3156c945b4f8cc115419d12 100644 (file)
@@ -137,31 +137,29 @@ Tie::get_control_points (SCM smob)
 
   Real left_x;
   if (Note_head::has_interface (me->get_bound (LEFT)))
-    left_x = l->extent (X_AXIS)[RIGHT] + x_gap_f;
+    left_x = l->extent (l, X_AXIS)[RIGHT] + x_gap_f;
   else
-    left_x = l->extent (X_AXIS).length () / 2;
+    left_x = l->extent (l, X_AXIS).length () / 2;
 
   Real width;
   if (Note_head::has_interface (me->get_bound (LEFT))
       && Note_head::has_interface (me->get_bound (RIGHT)))
     {
-      width = r->relative_coordinate (commonx, X_AXIS)
-       + r->extent (X_AXIS)[LEFT]
-       - l->relative_coordinate (commonx, X_AXIS)
-       - l->extent (X_AXIS)[RIGHT]
+      width = 
+       + r->extent (commonx,X_AXIS)[LEFT]
+       - l->extent (commonx, X_AXIS)[RIGHT]
        -2 * x_gap_f;
     }
   else
     {
       if (Note_head::has_interface (me->get_bound (LEFT)))
        width = r->relative_coordinate (commonx, X_AXIS)
-         - l->relative_coordinate (commonx, X_AXIS)
-         - l->extent (X_AXIS)[RIGHT]
+         - l->extent (commonx, X_AXIS)[RIGHT]
          - 2 * x_gap_f;
       else
-       width = r->relative_coordinate (commonx, X_AXIS)
-         - l->extent (X_AXIS).length () / 2
-         + r->extent (X_AXIS)[LEFT]
+       width = 
+         - l->extent (l, X_AXIS).length () / 2
+         + r->extent (commonx, X_AXIS)[LEFT]
          - l->relative_coordinate (commonx, X_AXIS)
          - 2 * x_gap_f;
     }
@@ -180,7 +178,8 @@ Tie::get_control_points (SCM smob)
   
   Offset leave_dir = b.control_[1] - b.control_[0];
 
-  Real dx = (head (me, headdir)->extent (X_AXIS).length () + x_gap_f)/2.0;
+  Score_element *hed =head (me, headdir);
+  Real dx = (hed->extent (hed, X_AXIS).length () + x_gap_f)/2.0;
   Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
 
   /*