]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.8 release/1.3.8
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Nov 1999 10:17:44 +0000 (11:17 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Nov 1999 10:17:44 +0000 (11:17 +0100)
63 files changed:
AUTHORS.txt
CHANGES
Documentation/programmer/regression-test.tely
Documentation/topdocs/AUTHORS.texi
Documentation/user/GNUmakefile
Documentation/user/lilypond.tely
Documentation/user/tutorial.itely
TODO
VERSION
input/bugs/k.ly [new file with mode: 0644]
input/bugs/knee.ly [new file with mode: 0644]
input/test/orchestscore.ly
input/test/spacing-tight.ly
input/test/staff-margin.ly
input/test/tie-accidental.ly
lily/afm.cc
lily/bar-script-engraver.cc
lily/crescendo.cc
lily/dimension-cache.cc
lily/directional-element.cc
lily/dynamic-engraver.cc
lily/graphical-axis-group.cc
lily/include/bar-script-engraver.hh
lily/include/crescendo.hh
lily/include/dimension-cache.hh
lily/include/key.hh
lily/include/lily-guile.hh
lily/include/local-key-item.hh
lily/include/property-inspect.hh
lily/include/rhythmic-head.hh
lily/include/score-element.hh
lily/include/script-engraver.hh
lily/include/script.hh
lily/include/staff-side.hh
lily/include/stem-staff-side.hh
lily/include/translator.hh
lily/key.cc
lily/lily-guile.cc
lily/local-key-engraver.cc
lily/local-key-item.cc
lily/note-heads-engraver.cc
lily/property-inspect.cc
lily/score-element.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/script.cc
lily/staff-margin-engraver.cc
lily/staff-side.cc
lily/stem-staff-side.cc
lily/text-engraver.cc
lily/time-signature-engraver.cc
ly/engraver.ly
make/out/lilypond.lsm
make/out/lilypond.spec
mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly
mutopia/gallina.ly
scm/generic-property.scm
stepmake/bin/ls-latex.py

index e0544a62416c75a5e33d17e1670e409e50b40875..3c9a62d947bc1a8989934be2fbf8dbe509cc8777 100644 (file)
@@ -32,6 +32,9 @@ list is alphabetically ordered.
 
    * Michael Krause <m.krause@tu-harburg.de>,     breathing signs
 
+   * Dirk Lattermann <dlatt@datenrat.de>,      minor improvements on
+     accidentals/ties/multi measure rests
+
    * Werner Lemberg <wl@gnu.org>,     misc bugfixes, some Beam and Stem
      code.
 
diff --git a/CHANGES b/CHANGES
index 1f9988ce1f1ada8e262b245526dc1e9be9ab3ce2..04fcd9ab2a4e7a104728151cbd5536a6cceab438 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,14 @@
+pl7.mb1
+       - bf: timeSignatureStyle works again
 
+pl 7.hwn1
+       - Dirk Latterman key/mmrest patches
+       - Offset callbacks in Dimension_cache
+       - Junked Staff_side_*
+       - Staff_sidify: interface class.
+       - prelude-{1,2} fixes.
+
+***********
 pl 6.uu2
        - bf: PS font selecting.
 
index 3675d89ca7c7f7d6cf20ebfc1a9676319fe0ebc4..2597e5a796b5a8c1f62726b14c66cb23890b5317 100644 (file)
@@ -47,6 +47,19 @@ colliding from barlines.
 
 @mudelafile{multi-measure-rest.ly}
 
+If @code{Score.skipBars} is set,
+the signs for four, two, and one measure rest are combined to
+produce the graphical representation of rests for up to 10 bars.
+The number of bars will be written above the sign.
+
+@mudelafile{mm-rest2.ly}
+
+A sharp sign after a double sharp sign, as well as a flat sign
+after a double flat sign is automatically prepended with a
+natural sign.
+
+@mudelafile{double-single-acc.ly}
+
 @section Stems
 
 Stem tremolos (official naming?) or rolls are tremolo signs that look
index 7dc58f37deb2dc3772264384df7aa16ad04966e7..a9969ccd58ef9d79ac91bf638bf056b84fe69bc1 100644 (file)
@@ -37,6 +37,8 @@ list is alphabetically ordered.
     mf/ital-*.mf (these were taken from the CM fonts)
 @item @email{m.krause@@tu-harburg.de, Michael Krause},
     breathing signs
+@item @email{dlatt@@datenrat.de, Dirk Lattermann},
+       minor improvements on accidentals/ties/multi measure rests
 @item @email{wl@@gnu.org, Werner Lemberg},
     misc bugfixes, some Beam and Stem code. 
 @item @email{drl@@vuse.vanderbilt.edu, David R. Linn},
index 24cc5c5cc4b5fd9ab82ddd6c5aea463a9a794337..7e2ea57cbe108b48eadb2aeb8e2795f1fe7b393d 100644 (file)
@@ -21,7 +21,6 @@ LOCALSTEPMAKE_TEMPLATES=lilypond mudela
 
 include $(depth)/make/stepmake.make 
 
-
 dvi: $(DVI_FILES)
 
 ps: $(PS_FILES)
index 24e06721ab54569965f334d78a27276cd07f0eb4..07cecc95ffdb028810f92b4c2face7a6d7538eb8 100644 (file)
@@ -75,8 +75,6 @@ Should add disclaimer, abstract
 "GNU LilyPond has no connection with the music package Rosegarden, other
 than the names being similar :-)"
 
-
-
 @end ignore
 
 @contents
index a5d540afc566468c6b5f7bf17d190647219463c3..cbaa5f041bb0b4e370940a4585f97ed2d8079822 100644 (file)
@@ -1,4 +1,3 @@
-
 @chapter Tutorial
 
 
diff --git a/TODO b/TODO
index 1b7b2100722fd7f8c65f81253e7d753a90a92f19..a3a4e28c8240c04cb4f6818b3c9633057056f7df 100644 (file)
--- a/TODO
+++ b/TODO
@@ -62,7 +62,6 @@ ChoirStaff bar line types in the rest of the scores
 
 . * make all Feta (including dynamics) available to the user in
     textual scripts. Examples: "D.S. al \coda", "\mf espress.".
 . * Write script that uses --find-old-relative to do auto relativization. 
 . * Junk shared cruft (duration, moment) in lib/
 
diff --git a/VERSION b/VERSION
index 2f0e519cda2386ef979225b50bd629d413c82224..d5ceba73aa4c9a4858a7af769d0993052ede9b21 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=7
+PATCH_LEVEL=8
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff --git a/input/bugs/k.ly b/input/bugs/k.ly
new file mode 100644 (file)
index 0000000..6709164
--- /dev/null
@@ -0,0 +1,2 @@
+\score { \notes {
+c4 \clef bass ; c4}}
diff --git a/input/bugs/knee.ly b/input/bugs/knee.ly
new file mode 100644 (file)
index 0000000..eee5e38
--- /dev/null
@@ -0,0 +1,8 @@
+\version "1.3.5";
+\score{
+       \notes\relative c'{
+               [c16 \stemdown c'' \stemboth c,, d]
+               \stemdown [d'' a \stemboth c,, g,]
+               \stemup [g c' \stemboth a'' d']
+       }
+}
index 5bda50efe0d6a70b067c6e141e33f3c89c2c007f..0cfe57e9362f6901f0fc7404909271a58a892148 100644 (file)
@@ -1,7 +1,7 @@
 \version "1.3.5";
 
 m = \notes \relative c''{
-c1 | c2 c | c c | c c | c c | c c | c c | c c | 
+c1 | c2 c | c c | c c | \break c c | c c | c c | c c | 
 }
 
 \score{ < 
@@ -88,6 +88,7 @@ c1 | c2 c | c c | c c | c c | c c | c c | c c |
     textheight = 260.\mm;
     \translator {
        \OrchestralScoreContext
+       barNumberScriptPadding = 10;
         minVerticalAlign = 2.2*\staffheight; 
     }
     \translator { \StaffContext
index 90a6e8bafccf0637e9d48ea18c28cb380e14f8e1..f9cbe7c071dbad252d89ac107833e435d6a98c0a 100644 (file)
@@ -1,6 +1,6 @@
 
 \score {
-       \notes { \time 2/2; c'2 c'2 \time 2/2; }
+       \notes { \time 2/2; f''2 c'2 \time 2/2; }
        \paper { linewidth = 2.5 \cm;
        indent = 0.0;
        }
index f2e5edf033894d133419668b3214ba04f5766fde..b6752444ce45cc4771d06f41914399f52308af8e 100644 (file)
@@ -11,6 +11,9 @@
     \context Staff = bass { \property Staff.instrument = "Left " \clef bass; c4 }>
 
 \paper {
+\translator { \ScoreContext
+       textVerticalAlignment = #0
+       }
 \translator { \StaffContext \consists "Staff_margin_engraver"; }
 \translator { \PianoStaffContext \consists "Staff_margin_engraver"; }
 }}
index 162e23d8cf6af9f1f272e39c3ce1ebb67c56c7c6..7b2e9c1c165d70bd17920d280f5350232207f5d7 100644 (file)
@@ -1,10 +1,20 @@
 
-thenotes = \notes \relative cis' { \time 4/4; gis'2 gis ~ |
-gis gis4 gis |
+thenotes = \notes \relative cis' { \time 4/4;
+gis'2 gis ~ |
+gis4 gis8 ~ gis g4 gis |
 g2 gis ~ |
 gis g4 gis |
 g2 gis( |
-)g gis4 gis | }
+)g! gis4 gis |
+
+\key a \major;
+gis2 g ~ |
+g4 gis8 ~ gis g4 gis |
+g2 gis ~ |
+gis g4 gis |
+g2 gis( |
+)g! gis4 gis | 
+}
 
 \score { < \context Staff \thenotes
        \context NoteNames \thenotes
index e35c6f669ed11772f2f0aacabcc0f4015a0d87c8..71a1e25ea98c9d7e8f26e44bdb5bf83c1dd3c5b7 100644 (file)
@@ -22,7 +22,6 @@ String &
 Adobe_font_char_metric::name ()
 {
   return N_;
-  
 }
 
 int &
index 627ca68fc687aab9ea0dd7f598ee35be7a25f4d5..243efae34e02f2db046ab116d8f984bde06f83b0 100644 (file)
@@ -21,7 +21,6 @@
 Bar_script_engraver::Bar_script_engraver ()
 {
   axis_ = Y_AXIS;
-  staff_side_p_ = 0;
   text_p_ =0;
   hang_on_clef_b_ = false;
   visibility_lambda_ 
@@ -48,21 +47,22 @@ void
 Bar_script_engraver::attach_script_to_item (Item *i)
 {
   Axis other_axis = Axis((axis_ + 1)%2);
-  if (staff_side_p_ && !staff_side_p_->parent_l(other_axis)) 
+  if (text_p_ && !text_p_->parent_l(other_axis)) 
     {
-      staff_side_p_->set_parent (i,other_axis);
-      staff_side_p_->set_parent (i,axis_);
+      text_p_->set_parent (i,other_axis);
+      text_p_->set_parent (i,axis_);
 
       if (!text_p_->parent_l(other_axis))
        text_p_->set_parent (i,other_axis);
-      staff_side_p_->add_support (i);
+
+      Staff_sidify (text_p_).add_support (i);
 
       /*
-       How do we make sure that staff_side_p_ has a dependency from
+       How do we make sure that text_p_ has a dependency from
        someone else? We can't use I for that,  so we use some other element.
        */
-      // staff_side_p_->set_elt_property ("dangling", SCM_BOOL_T)
-      get_staff_info ().command_pcol_l ()->add_dependency (staff_side_p_);
+      // text_p_->set_elt_property ("dangling", SCM_BOOL_T)
+      get_staff_info ().command_pcol_l ()->add_dependency (text_p_);
     }
 }
 
@@ -118,59 +118,42 @@ Bar_script_engraver::do_pre_move_processing ()
       typeset_element (text_p_);
       text_p_ =0;
     }
-  
-  if (staff_side_p_) 
-    {
-      typeset_element (staff_side_p_);
-      staff_side_p_ = 0;
-    }
 }
 
 
 void
 Bar_script_engraver::create_items (Request *rq)
 {
-  if (staff_side_p_ || text_p_)
+  if (text_p_)
     return;
   
-  staff_side_p_ = new Staff_side_item;
-  staff_side_p_->axis_ = axis_;
-  staff_side_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
-
-  
   text_p_ = new Text_item;
   text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+  Staff_sidify staffside(text_p_);
+  staffside.set_axis (axis_);
 
   SCM prop = get_property (type_ + "Direction", 0);
-  if (isdir_b (prop))
+  if (!isdir_b (prop))
     {
-      staff_side_p_->set_direction ( to_dir (prop));
-    }
-  else 
-    {
-      staff_side_p_->set_direction ( UP);
+      prop = gh_int2scm (UP);
     }
+  text_p_->set_elt_property ("direction", prop);
 
-  staff_side_p_->set_victim(text_p_);
-  
   SCM padding = get_property (type_ + "ScriptPadding", 0);
   if (gh_number_p(padding))
     {
-      staff_side_p_->set_elt_property ("padding", padding);
+      text_p_->set_elt_property ("padding", padding);
     }
   else
     {
-      staff_side_p_
+      text_p_
        ->set_elt_property ("padding",
                            gh_double2scm(paper_l ()->get_var ("interline")));
     }
   
-  staff_side_p_->set_elt_property ("visibility-lambda",
-                                  visibility_lambda_);
   text_p_->set_elt_property ("visibility-lambda",
                             visibility_lambda_);
   
   announce_element (Score_element_info (text_p_, rq));
-  announce_element (Score_element_info (staff_side_p_, rq));
 }
 
index c570a2b1530a9e5c912a42a18683b2a137930ff8..b8ab2137faed4ffa55c605484fdc50912c055d9b 100644 (file)
@@ -20,9 +20,6 @@ Crescendo::Crescendo ()
   dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false;
 }
 
-
-
-
 Molecule
 Crescendo::get_symbol () const
 {
index 6fc99bde284f48bee45184eeb3a604d4ffaa5edf..5899d4474a6afb7ee89c80023f5272b75dfbf7ad 100644 (file)
@@ -8,13 +8,17 @@
 
 #include "dimension-cache.hh"
 #include "parray.hh"
+#include "graphical-element.hh"
 
 Dimension_cache::Dimension_cache (Dimension_cache const &d)
 {
   init();
   callback_l_ = d.callback_l_;
   empty_b_ = d.empty_b_;
-  offset_ = d.offset_; //let's hope others will copy  the refpoint appropriately. 
+  basic_offset_ = d.basic_offset_;
+  extra_offset_ = d.extra_offset_;
+  off_valid_b_ = d.off_valid_b_;
+  off_callback_l_ = d.off_callback_l_;
 }
 
 Dimension_cache::Dimension_cache ()
@@ -26,47 +30,45 @@ void
 Dimension_cache::init()
 {
   callback_l_ =0;
-  offset_ =0.0;
+
+  basic_offset_ =0.0;
+  extra_offset_ =0.0;
+  
   elt_l_ = 0;
   dim_.set_empty ();
   parent_l_ =0;
   valid_b_ = false;
   empty_b_ = false;
+  off_valid_b_ = false;
+  off_callback_l_ =0;
 }
 
 
 void
 Dimension_cache::invalidate ()
 {
+  off_valid_b_ =false;
   valid_b_ = false;
-  invalidate_dependencies ();
 }
 
-void
-Dimension_cache::invalidate_dependencies ()
-{
-  for (int i=0; i < dependencies_l_arr_.size (); i++)
-    {
-      Dimension_cache * g = dependencies_l_arr_[i];
-      if (g->valid_b_)
-       {
-         g->invalidate ();
-       }
-    }
-}
 
 void
 Dimension_cache::set_offset (Real x)
 {
-  invalidate_dependencies ();
-  offset_ = x;
+  // ugh!
+  /*
+
+    UGH ! UGH !
+    
+   */
+  
+  basic_offset_ = x;
 }
 
 void
 Dimension_cache::translate (Real x)
 {
-  invalidate_dependencies ();
-  offset_ += x;
+  basic_offset_ += x;
 }
 
 Real
@@ -81,9 +83,31 @@ Dimension_cache::relative_coordinate (Dimension_cache *refp) const
     
    */
   if (refp == parent_l_)
-    return offset_;
+    return get_offset ();
+  else
+    return get_offset () + parent_l_->relative_coordinate (refp);
+}
+
+Axis
+Dimension_cache::axis () const
+{
+  if (elt_l_-> dim_cache_[X_AXIS] == this)
+    return X_AXIS;
   else
-    return offset_ + parent_l_->relative_coordinate (refp);
+    return Y_AXIS;
+}
+
+Real
+Dimension_cache::get_offset () const
+{
+  if (!off_valid_b_ && off_callback_l_ )
+    {
+      Dimension_cache *d = (Dimension_cache*) this;
+      d->off_valid_b_ = true;
+      d->basic_offset_ = (*off_callback_l_) (d);
+    }
+
+  return basic_offset_ + extra_offset_;
 }
 
 Dimension_cache *
@@ -142,3 +166,8 @@ Dimension_cache::set_callback (Dim_cache_callback c)
   callback_l_ =c;
 }
 
+void
+Dimension_cache::set_offset_callback (Offset_cache_callback c)
+{
+  off_callback_l_ =c;
+}
index 7d9e9a666a2ae9f26fffd147c3e8af2cd99c88ed..83a4aaecb5d0b9a1e8e261b310c8a8ddf8d9e40e 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "directional-element.hh"
-#include "property-inspect.hh"
+
 
 Directional_element::Directional_element ()
 {
index 8202c7157b7297978d8664db0ef64a5242f66475..101837a9cba5861fc6ec1ae28ece7dced471ac9f 100644 (file)
 class Dynamic_engraver : public Engraver
 {
   Text_item * text_p_;
-  Staff_side_item * staff_side_p_;
-  Staff_side_spanner * ss_span_p_;
-  Staff_side_spanner * to_end_ss_span_p_;
-  
-  
   Crescendo * to_end_cresc_p_;
   Crescendo * cresc_p_;
+
   Span_req * cresc_req_l_;
   Array<Request*> dynamic_req_l_arr_;
   void  typeset_all ();
@@ -54,9 +50,9 @@ Dynamic_engraver::Dynamic_engraver()
 {
   do_post_move_processing();
   text_p_ =0;
-  staff_side_p_ =0;
+
   to_end_cresc_p_ = cresc_p_ = 0;
-  ss_span_p_ = to_end_ss_span_p_=0;
+
   cresc_req_l_ = 0;
 }
 
@@ -98,7 +94,7 @@ void
 Dynamic_engraver::do_process_requests()
 {
   Crescendo*  new_cresc_p=0;
-  Staff_side_spanner * new_sss_p =0;
+
   for (int i=0; i < dynamic_req_l_arr_.size(); i++)
     {
       if (Text_script_req *absd =
@@ -115,39 +111,36 @@ Dynamic_engraver::do_process_requests()
          text_p_ = new Text_item;
          text_p_->text_str_ =  loud; // ugh
          text_p_->set_elt_property ("style", gh_str02scm ("dynamic"));
-
-         staff_side_p_ = new Staff_side_item;
-         staff_side_p_->set_elt_property ("script-priority",
-                                          gh_int2scm (100));
-                                          
-         staff_side_p_->set_victim (text_p_);
-         staff_side_p_->axis_ = Y_AXIS;
-         staff_side_p_->set_direction (DOWN);
+         text_p_->set_elt_property ("script-priority",
+                                    gh_int2scm (100));
+         Staff_sidify (text_p_).set_axis (Y_AXIS);
 
          
-         SCM prop = get_property ("verticalDirection", 0);
-         if (isdir_b (prop))
+         if (absd->get_direction ())
            {
-             staff_side_p_->set_direction (to_dir (prop));
+             text_p_->set_elt_property ("direction", gh_int2scm (absd->get_direction ()));
            }
 
-         prop = get_property ("dynamicDirection", 0);
-         if (gh_number_p(prop))
-           {
-             staff_side_p_->set_direction (to_dir (prop));
-           }
-         if (absd->get_direction ())
+
+         /*
+           UGH UGH 
+          */
+         SCM prop = get_property ("dynamicDirection", 0);
+         if (!isdir_b (prop))
            {
-             staff_side_p_->set_direction (absd->get_direction ());
+             prop = get_property ("verticalDirection", 0);
            }
 
+         if (isdir_b (prop) && to_dir (prop))
+           text_p_->set_elt_property ("direction", prop);
+
+
          prop = get_property ("dynamicPadding", 0);
          if (gh_number_p(prop))
            {
-             staff_side_p_->set_elt_property ("padding", prop);
+             text_p_->set_elt_property ("padding", prop);
            }
          announce_element (Score_element_info (text_p_, absd));
-         announce_element (Score_element_info (staff_side_p_, absd));
        }
       else if (Span_req *span_l
               = dynamic_cast <Span_req *> (dynamic_req_l_arr_[i]))
@@ -162,29 +155,8 @@ Dynamic_engraver::do_process_requests()
                {
                  assert (!to_end_cresc_p_);
                  to_end_cresc_p_ =cresc_p_;
-                 to_end_ss_span_p_ = ss_span_p_ ;
                  
                  cresc_p_ = 0;
-                 ss_span_p_ =0;
-
-
-
-                 
-                 SCM prop = get_property ("verticalDirection", 0);
-                 if (isdir_b (prop))
-                   {
-                     to_end_ss_span_p_->set_direction (to_dir (prop));
-                   }
-                 prop = get_property ("dynamicDirection", 0);
-                 if (isdir_b (prop))
-                   {
-                     to_end_ss_span_p_->set_direction (to_dir (prop));
-                   }
-                 prop = get_property ("dynamicPadding", 0);
-                 if (gh_number_p(prop))
-                   {
-                     to_end_ss_span_p_->set_elt_property ("padding",prop);
-                   }
                }
            }
          else if (span_l->span_dir_ == START)
@@ -193,14 +165,9 @@ Dynamic_engraver::do_process_requests()
              assert (!new_cresc_p);
              new_cresc_p  = new Crescendo;
              new_cresc_p->grow_dir_ = (span_l->span_type_str_ == "crescendo")  ? BIGGER : SMALLER;
-             announce_element (Score_element_info (new_cresc_p, span_l));
 
-             new_sss_p = new Staff_side_spanner;
-             new_sss_p->set_victim (new_cresc_p);
-             new_sss_p->axis_ = Y_AXIS;
-             // UGH.!
-             // new_sss_p->set_elt_property ("dangling", SCM_BOOL_T);
-             announce_element (Score_element_info (new_sss_p, span_l));
+             Staff_sidify (new_cresc_p).set_axis (Y_AXIS);
+             announce_element (Score_element_info (new_cresc_p, span_l));
            }
        }
     }
@@ -211,15 +178,13 @@ Dynamic_engraver::do_process_requests()
        {
          ::warning (_ ("Too many crescendi here"));
          typeset_element (cresc_p_);
-         typeset_element (ss_span_p_);
+
          cresc_p_ = 0;
-         ss_span_p_ =0;
        }
       
       cresc_p_ = new_cresc_p;
-      ss_span_p_ = new_sss_p;
       cresc_p_->set_bounds(LEFT,get_staff_info().musical_pcol_l ());
-      ss_span_p_->set_bounds (LEFT,get_staff_info().musical_pcol_l ());
+
       if (text_p_)
        {
          cresc_p_->dyn_b_drul_[LEFT] = true;
@@ -245,8 +210,6 @@ Dynamic_engraver::do_removal_processing ()
   if (cresc_p_)
     {
       typeset_element (cresc_p_ );
-      typeset_element (ss_span_p_);
-      ss_span_p_ =0;
       cresc_req_l_->warning (_ ("unended crescendo"));
       cresc_p_ =0;
     }
@@ -260,19 +223,17 @@ Dynamic_engraver::typeset_all ()
   if (to_end_cresc_p_)
     {
       to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_pcol_l ());
-      to_end_ss_span_p_->set_bounds(RIGHT,get_staff_info().musical_pcol_l ());
+
       typeset_element (to_end_cresc_p_);
-      typeset_element (to_end_ss_span_p_);
+
       to_end_cresc_p_ =0;
-      to_end_ss_span_p_ =0;
+
     }
   
   if (text_p_)
     {
       typeset_element (text_p_);
-      typeset_element (staff_side_p_);
       text_p_ =0;
-      staff_side_p_ =0;
     }
 }
 
@@ -284,14 +245,14 @@ Dynamic_engraver::acknowledge_element (Score_element_info i)
       || dynamic_cast<Note_head *> (i.elem_l_)
       )
     {
-      if (staff_side_p_)
-       staff_side_p_->add_support (i.elem_l_);
+      if (text_p_)
+       Staff_sidify (text_p_).add_support (i.elem_l_);
 
-      if (to_end_ss_span_p_)
-       to_end_ss_span_p_->add_support (i.elem_l_);
+      if (to_end_cresc_p_)
+       Staff_sidify (to_end_cresc_p_).add_support (i.elem_l_);
 
-      if (ss_span_p_)
-       ss_span_p_->add_support (i.elem_l_);
+      if (cresc_p_)
+       Staff_sidify(cresc_p_).add_support (i.elem_l_);
     }
 }
 
index 71f6def061316d1d15ab9ddfece1dc4a4ba78916..e0cfcaf1ef5f7deb2102de7213303bdf5059226a 100644 (file)
@@ -61,7 +61,7 @@ Graphical_axis_group::add_element (Graphical_element*e, Axis a1 , Axis a2)
       
       e->set_parent (this, as[i]);
 
-      e->dim_cache_[as[i]]->dependencies_l_arr_.push (dim_cache_[as[i]]);
+      //      e->dim_cache_[as[i]]->dependencies_l_arr_.push (dim_cache_[as[i]]);
     }
   assert (e->parent_l(Y_AXIS) == this || e->parent_l (X_AXIS) == this);
   elem_l_arr_.push (e);
@@ -92,7 +92,7 @@ Graphical_axis_group::do_remove (Graphical_element *e)
       if (e->parent_l (a) != this)
        continue;
       e->set_parent (0, a);
-      e->dim_cache_[a]->dependencies_l_arr_.clear ();
+      //      e->dim_cache_[a]->dependencies_l_arr_.clear ();
     }
 }
 
index a3642a29a68bb7acdbb9b11b4521b2203b3d9d36..727fa6e0f131cd0c5466fe94706624900c65e968 100644 (file)
@@ -21,7 +21,6 @@ class Bar_script_engraver : public Engraver
 public:
   VIRTUAL_COPY_CONS(Translator);
 protected:
-  Staff_side_item* staff_side_p_;
   Text_item* text_p_;
   Protected_scm visibility_lambda_;
   String type_;
index f0364a2c037126c366d77722c38b52cd650ab838..237cc49984375aee53b7e3d7663d1a3e997b1ae3 100644 (file)
 #ifndef CRESCENDO_HH
 #define CRESCENDO_HH
 
-#include "spanner.hh"
+#include "directional-spanner.hh"
 /**
   The hairpin symbol. (cresc)
+
+  (normal spanner?)
  */
-class Crescendo : public Spanner {
+class Crescendo : public Directional_spanner {
 public:
   int grow_dir_;
     
index d8b998132f6e6a8e66d7961c930f51290ce9d29e..e63ffc9ee2561f0e567cd3ea928a96ec7fc33b78 100644 (file)
@@ -16,7 +16,8 @@
 #include "parray.hh"
 
 class Dimension_cache;
-typedef Interval (*Dim_cache_callback)(Dimension_cache *);
+typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
+typedef Real (*Offset_cache_callback)(Dimension_cache const *);
 
 /**
   Adminstration of offset dimension info. 
@@ -32,20 +33,30 @@ class Dimension_cache
   /**
     The offset wrt. to the center of #parent_l_#
    */
-  Real offset_;
+
+  Real extra_offset_;
+  Real basic_offset_;
+  
+  bool off_valid_b_;
+
+  
   Graphical_element *elt_l_;
   Dim_cache_callback callback_l_;
   friend class Graphical_element;
 
   void init ();
 public:
+  Offset_cache_callback off_callback_l_;
+  
+  Axis axis () const;
+  Real get_offset () const;
   void set_callback (Dim_cache_callback);
   /** The #offset_# is defined with regard to this graphical_element/
     dimension_cache.  */
-  
+  void set_offset_callback (Offset_cache_callback);
   Dimension_cache * parent_l_;
-  Link_array<Dimension_cache> dependencies_l_arr_;
-  Graphical_element *element_l () { return elt_l_; }
+
+  Graphical_element *element_l () const { return elt_l_; }
 
   void invalidate ();
   void invalidate_dependencies ();
index af89371f22def36026c3686614e66fc40703817f..aa93545331bb166b0e16e16671d742d4c49b8e94 100644 (file)
@@ -15,6 +15,7 @@ class Octave_key {
 
 public:
   Array<int> accidental_i_arr_;
+  Array<bool> internal_forceacc_b_arr_;
   void clear ();
   Octave_key();
   void set (int i, int acc);
@@ -36,8 +37,12 @@ public:
   Octave_key const& oct (int) const;
   void set (int name, int acc);
   void set (Musical_pitch);
+  void set_internal_forceacc (Musical_pitch);
+  void clear_internal_forceacc (Musical_pitch);
 
   bool different_acc (Musical_pitch) const;
+  bool internal_forceacc (Musical_pitch) const;
+  bool double_to_single_acc (Musical_pitch) const;
   
   Key();
   void print () const;  
index 696e5a37391bf787f52865b3b2764b8a08a877d6..ddb21f4c5ce844e71256f37dea57f1f2710879d6 100644 (file)
@@ -36,6 +36,8 @@ SCM array_to_list (SCM *a , int l);
 void read_lily_scm_file (String);
 void init_lily_guile ();
 
+bool isdir_b (SCM s);
+Direction to_dir (SCM s);
 
 
 void init_ly_protection ();
@@ -60,4 +62,5 @@ public:\
 /* end define */
 
 
+
 #endif // LILY_GUILE_HH
index b11793cd92ad496c51af84c9bef9d8b3c662eb5e..931c984c6ea43a3fba9bf58c77ea1591a84b15f5 100644 (file)
@@ -16,10 +16,12 @@ struct Local_key_cautionary_tuple
 {
   Musical_pitch pitch_;
   bool cautionary_b_;
+  bool natural_b_;
 
   Local_key_cautionary_tuple ()
     {
       cautionary_b_ = false;
+         natural_b_ = false;
     }
   static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
     {
@@ -45,7 +47,7 @@ class Local_key_item : public Note_head_side, public Staff_symbol_referencer {
 public:
   int c0_position_i_;
   Local_key_item ();
-  void add_pitch (Musical_pitch, bool cautionary);
+  void add_pitch (Musical_pitch, bool cautionary, bool natural);
 protected:
   virtual void do_pre_processing();
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
index 31d26ac3e9e38f721935db32eb8fb87c9914c2d0..3188ddbfa418320a84de1e515f8a00ab65905247 100644 (file)
@@ -13,8 +13,6 @@
 #include "direction.hh"
 #include "lily-guile.hh"
 
-bool isdir_b (SCM s);
-Direction to_dir (SCM s);
 
 #endif /* PROPERTY_INSPECT_HH */
 
index 3d912e0cb0cd8791445eba9e19e4e0f88e111f25..25d63ecd14260d568026380171925c59fb19c6e4 100644 (file)
@@ -17,9 +17,8 @@ class Rhythmic_head : public Item, public Staff_symbol_referencer
 {
 public:
   Stem * stem_l_;
-  int balltype_i_;
-
   Dots * dots_l_;
+    int balltype_i_;
 
   void add_dots (Dots *);
   Rhythmic_head ();
index 55fe6efa2b4dbba505fe7d6a3559af760678db32..79a3daca6c5da198e6d3ababd5a271cab2195d47 100644 (file)
@@ -101,7 +101,7 @@ public:
      #funcptr# is the function to call to update this element.
    */
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
-
+  static SCM handle_broken_smobs (SCM, Line_of_score*);
 
   virtual Score_element *find_broken_piece (Line_of_score*) const;
 protected:
@@ -131,9 +131,6 @@ protected:
   /// generate rods & springs
   virtual void do_space_processing ();
 
-  /// do postbreak substs on array of pointers.
-  virtual void do_substitute_arrays ();
-
   virtual void do_breakable_col_processing ();
   /// do calculations after determining horizontal spacing
   virtual void do_post_processing ();
@@ -146,7 +143,7 @@ protected:
   virtual void handle_broken_dependents ();
   virtual Link_array<Score_element> get_extra_dependencies () const;
 
-  static Interval dim_cache_callback (Dimension_cache*);
+  static Interval dim_cache_callback (Dimension_cache const*);
 public:
 
   DECLARE_SMOBS;
index fef7fce66ba817d64864c56e3b6e2951a7c76b0c..9cdb243775856eb343fdfd64eb5ce277aa7c51a6 100644 (file)
@@ -13,7 +13,6 @@
 
 class Script_engraver : public Engraver {
   Link_array<Script> script_p_arr_;
-  Link_array<Staff_side_item> staff_side_p_arr_;
   Link_array<Articulation_req> script_req_l_arr_;
 
 public:
index a9beecb022544933e52a8e05e5ba1593b68ea7ea..8902a94bbf035ff91934b6e42155383cdb8c034e 100644 (file)
    Articulation marks (and the like) that are attached to notes/stems.
    Needs support from Staff_side for proper operation.  Staff_side
    handles the positioning.
-
 */
 class Script : public Item
 {
-  Staff_side_item * staff_side_l_;
-
   Molecule get_molecule (Direction d) const;
 public:
-  Script ();
-  void set_staff_side (Staff_side_item*);
-
+  
 protected:
-  virtual void do_print () const;
-  virtual void do_substitute_element_pointer (Score_element*o,
-                                             Score_element*n);
   virtual void do_pre_processing ();
   virtual void do_post_processing ();
   Molecule* do_brew_molecule_p () const;
index 81510632aa429d7acfd1f0c910bade5f94576cba..382d0d6cf36ec8f7bb8c20e9b4694c704d2a2c38 100644 (file)
 #include "staff-symbol-referencer.hh"
 #include "directional-element.hh"
 
-/**
-   Position myself next to a set of elements.  Configurable in axis
-   and direction.
-
-  Properties:
-
-    padding :: Real
-
-    Amount of extra space to add.
-*/
-class Staff_side_element :  public Staff_symbol_referencer,
-  public Directional_element
+struct Staff_sidify
 {
-  void position_self ();
-
+  Score_element * elt_l_;
 public:
-  Score_element * to_position_l_;
-  
+  Staff_sidify (Score_element*);
+  static Real position_self (Dimension_cache const *);
 
-  Link_array<Score_element> support_l_arr_;
-  Axis axis_;
-  //junkme.
-  bool staff_support_b_;
+  void set_axis (Axis);
+  Axis get_axis () const;
   
-  Staff_side_element ();
-  void set_victim (Score_element*);
+  bool is_staff_side_b ();
   void add_support (Score_element*);
+  Real aligned_position (Dimension_cache const*);
 
-  VIRTUAL_COPY_CONS(Score_element);
-  virtual Direction get_default_direction () const;
-protected:
-  virtual Interval do_height () const;
-  virtual void do_print () const;
-  virtual void do_add_processing ();
-  virtual void do_substitute_element_pointer (Score_element*,Score_element*);
-  virtual void do_pre_processing ();
-  virtual void do_post_processing ();
+  
+  Direction get_direction () const;
+  void set_direction (Direction);
 };
 
-class Staff_side_item : public Staff_side_element, public Item
-{
-public:
-  VIRTUAL_COPY_CONS(Score_element);
-protected:
-  virtual Interval do_width () const;
-  virtual void do_print () const;
-};
 
-class Staff_side_spanner : public Staff_side_element, public Spanner
-{
-public:
-  VIRTUAL_COPY_CONS(Score_element);
-protected:
-  virtual void do_print () const;
-};
 
 #endif /* STAFF_SIDE_HH */
 
index 2279a6e54bef740a3bde24e4942a468d1456b205..10dd3b5e5267c0345943f431f65365abc10d5dc4 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef Stem_STAFF_SIDE_HH
 #define Stem_STAFF_SIDE_HH
 
+#error
+
 #include "staff-side.hh"
 /**
    Position self, analogous to Staff_side_item, but use Stem direction
index 598544b142d8cbdf24ddd4714903127acee43b2d..c97234aa1585425817cd03b1f5296c99ba287e73 100644 (file)
@@ -13,7 +13,7 @@
 #include "string.hh"
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
-#include "property-inspect.hh"
+#include "lily-guile.hh"
 #include "dictionary.hh"
 #include "parray.hh"
 #include "input.hh"
index 1e2b30c27618bbd6ac53f1bc4063317bbb40d17e..40e5c7de94293cb760871926cc5257cb38f365db 100644 (file)
@@ -19,7 +19,7 @@ void
 Octave_key::print () const
 {
   for (int i= 0; i < 7 ; i++)
-    DEBUG_OUT << "note " << i << " acc: " << accidental_i_arr_[i] << '\n';
+    DEBUG_OUT << "note " << i << " acc: " << accidental_i_arr_[i] << " iforce: " << internal_forceacc_b_arr_[i] << '\n';
 }
 
 
@@ -27,6 +27,7 @@ Octave_key::print () const
 Octave_key::Octave_key()
 {
   accidental_i_arr_.set_size (7);
+  internal_forceacc_b_arr_.set_size(7);
   clear ();
 }
 
@@ -34,7 +35,10 @@ void
 Octave_key::clear ()
 {
   for (int i= 0; i < 7 ; i++)
+  {
     accidental_i_arr_[i] = 0;
+    internal_forceacc_b_arr_[i] = false;
+  }
 }
 
 Key::Key()
@@ -90,6 +94,20 @@ Key::set (Musical_pitch p)
   octaves_[i].set (p.notename_i_,p.accidental_i_);
 }
 
+void
+Key::set_internal_forceacc (Musical_pitch p)
+{
+  int   i = octave_to_index (p.octave_i_);
+  octaves_[i].internal_forceacc_b_arr_[p.notename_i_] = true;
+}
+
+void
+Key::clear_internal_forceacc (Musical_pitch p)
+{
+  int   i = octave_to_index (p.octave_i_);
+  octaves_[i].internal_forceacc_b_arr_[p.notename_i_] = false;
+}
+
 void
 Key::set (int n, int a)
 {
@@ -118,3 +136,21 @@ Key::different_acc (Musical_pitch p)const
 {
   return oct (p.octave_i_).acc (p.notename_i_) == p.accidental_i_;
 }
+
+
+bool
+Key::internal_forceacc (Musical_pitch p)const
+{
+  return oct (p.octave_i_).internal_forceacc_b_arr_[p.notename_i_];
+}
+
+
+bool
+Key::double_to_single_acc (Musical_pitch p) const
+{
+  return ((oct (p.octave_i_).acc (p.notename_i_) == -2
+      && p.accidental_i_ == -1)
+         
+        || (oct (p.octave_i_).acc (p.notename_i_) == 2
+           && p.accidental_i_ == 1));
+}
index c88ba15d4869158c0572a3193962e4c21fae8573..6e7d4f9eecf242e347a15f69eeef8abf6e2a90cc 100644 (file)
@@ -18,6 +18,7 @@
 #include "simple-file-storage.hh"
 #include "file-path.hh"
 #include "debug.hh"
+#include "direction.hh"
 
 SCM
 ly_str02scm (char const*c)
@@ -268,3 +269,22 @@ unsigned int ly_scm_hash (SCM s)
 {
   return scm_ihashv (s, ~1u);
 }
+
+
+
+bool
+isdir_b (SCM s)
+{
+  if (gh_number_p (s))
+    {
+      int i = gh_scm2int (s);
+      return i>= -1 && i <= 1; 
+    }
+  return false;
+}
+
+Direction
+to_dir (SCM s)
+{
+  return (Direction) gh_scm2int (s);
+}
index 32d793d6d880dd8883ce7aa62eede1e6d2e41495..a78a19b681f1ff3e090209881c009106155bc51c 100644 (file)
@@ -56,39 +56,59 @@ Local_key_engraver::do_creation_processing ()
 void
 Local_key_engraver::process_acknowledged ()
 {
-  if (!key_item_p_ && mel_l_arr_.size()) 
+    if (!key_item_p_ && mel_l_arr_.size()) 
     {
-      SCM f = get_property ("forgetAccidentals",0);
-      bool forget = gh_boolean_p (f) && gh_scm2bool(f);
-      for (int i=0; i  < mel_l_arr_.size(); i++) 
-       {
-         Item * support_l = support_l_arr_[i];
-         Note_req * note_l = mel_l_arr_[i];
-
-          if (tied_l_arr_.find_l (support_l) && !forget)
-            local_key_.set (note_l->pitch_);
-
-         if (!note_l->forceacc_b_
-             && local_key_.different_acc (note_l->pitch_))
-           continue;
-         if (!key_item_p_) 
+        SCM f = get_property ("forgetAccidentals",0);
+        bool forget = gh_boolean_p (f) && gh_scm2bool(f);
+        for (int i=0; i  < mel_l_arr_.size(); i++) 
            {
-             key_item_p_ = new Local_key_item;
-             announce_element (Score_element_info (key_item_p_, 0));         
-           }
-
-         key_item_p_->add_pitch (note_l->pitch_,
-                                 note_l->cautionary_b_);
-         key_item_p_->add_support (support_l);
+               Item * support_l = support_l_arr_[i];
+               Note_req * note_l = mel_l_arr_[i];
+
+            /* see if there's a tie that "changes" the accidental */
+            /* works because if there's a tie, the note to the left
+               is of the same pitch as the actual note */
+            bool tie_changes = tied_l_arr_.find_l (support_l)
+                  && !local_key_.different_acc (note_l->pitch_);
+
+            if (!forget
+
+                && ((note_l->forceacc_b_
+                || !local_key_.different_acc (note_l->pitch_)
+                        || local_key_.internal_forceacc (note_l->pitch_)))
+
+             && !tie_changes)
+             {
+                 if (!key_item_p_) 
+                    {
+                        key_item_p_ = new Local_key_item;
+                        announce_element (Score_element_info (key_item_p_, 0));
+                    }
+
+                    key_item_p_->add_pitch (note_l->pitch_,
+                                     note_l->cautionary_b_,
+                                         local_key_.double_to_single_acc(note_l->pitch_));
+                    key_item_p_->add_support (support_l);
+             }
          
-         if (!forget)
-           local_key_.set (note_l->pitch_);
-       }
+                if (!forget)
+                        {
+                                local_key_.set (note_l->pitch_);
+                 if (!tied_l_arr_.find_l (support_l))
+                            {
+                                local_key_.clear_internal_forceacc (note_l->pitch_);
+                            }
+                 else if (tie_changes)
+                                {
+                     local_key_.set_internal_forceacc (note_l->pitch_);
+                            }
+                       }
+        }
     }
-  if (key_item_p_ && grace_align_l_)
+    if (key_item_p_ && grace_align_l_)
     {
-      grace_align_l_->add_support (key_item_p_);
-      grace_align_l_ =0;
+        grace_align_l_->add_support (key_item_p_);
+        grace_align_l_ =0;
     }
   
 }
index 479fc4ba1d821d55abf586a9d2012298e9a4e080..1ff239da0fa6aef7ef9714974aa688e1e9716feb 100644 (file)
@@ -20,15 +20,17 @@ Local_key_item::Local_key_item ()
 }
 
 void
-Local_key_item::add_pitch (Musical_pitch p, bool cautionary)
+Local_key_item::add_pitch (Musical_pitch p, bool cautionary, bool natural)
 {
   for (int i=0; i< accidental_arr_.size(); i++)
     if (!Musical_pitch::compare (p, accidental_arr_[i].pitch_))
       return;
+         /* maybe natural (and cautionary) should be modif. nonetheless? */
 
   Local_key_cautionary_tuple t;
   t.pitch_ = p;
   t.cautionary_b_ = cautionary;
+  t.natural_b_ = natural;
   accidental_arr_.push (t);
 }
 
index c3640041517798a49a612fb5f937a4ca74072641..1f817347bf72e4ea0895cd2a0c1aacb2159118bc 100644 (file)
@@ -62,7 +62,8 @@ Note_heads_engraver::do_process_requests()
     {
       Note_head *note_p  = new Note_head;
       Note_req * note_req_l = note_req_l_arr_[i];
-      note_p->balltype_i_ = note_req_l->duration_.durlog_i_;
+      
+      note_p->balltype_i_ = note_req_l->duration_.durlog_i_ <? 2;
 
       if (note_req_l->duration_.dots_i_)
        {
index af4e5a607d94a6c1ac6033e51c38d06163c28000..89a97caa09899b8eed4e09e217d5e9046da5ba8b 100644 (file)
@@ -7,21 +7,3 @@
   
  */
 
-#include "property-inspect.hh"
-
-bool
-isdir_b (SCM s)
-{
-  if (gh_number_p (s))
-    {
-      int i = gh_scm2int (s);
-      return i>= -1 && i <= 1; 
-    }
-  return false;
-}
-
-Direction
-to_dir (SCM s)
-{
-  return (Direction) gh_scm2int (s);
-}
index 9c4e59c1a58fb5cbbd56694f3a5bca4db746cc84..f3f0322ba4c597cd8ab9022be7ccc69d15560d67 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <string.h>
 
+#include "misc.hh"
 #include "paper-score.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 
 
 Interval
-Score_element::dim_cache_callback (Dimension_cache*c)
+Score_element::dim_cache_callback (Dimension_cache const*c)
 {
-  Score_element *  e =dynamic_cast<Score_element*>c->element_l());
+  Score_element *  e =dynamic_cast<Score_element*> (c->element_l());
   if(e->dim_cache_[X_AXIS] == c)
     return e->do_width ();
   else
     return e->do_height ();
 }
 
+
+
+Real
+set_alignment_callback (Dimension_cache const *c)
+{
+  String s ("self-alignment-");
+  Axis ax = c->axis ();
+  s +=  (ax == X_AXIS) ? "X" : "Y";
+  Score_element *elm = dynamic_cast<Score_element*> (c->element_l ());
+  SCM align (elm->get_elt_property (s));
+  if (isdir_b (align))
+    {
+      Direction d = to_dir (align);
+      Interval ext(elm->extent (ax));
+      if (d)
+       {
+         return - ext[d];
+       }
+      return - ext.center ();
+    }
+  else
+    return 0.0;
+}
+
+
 Score_element::Score_element()
 {
   output_p_ =0;
@@ -204,12 +230,23 @@ Score_element::add_processing()
   if (status_i_)
     return;
   status_i_ ++;
+
+  if (get_elt_property ("self-alignment-X") != SCM_UNDEFINED)
+    {
+      dim_cache_[X_AXIS]->set_offset_callback (set_alignment_callback);
+    }
+  
+  if (get_elt_property ("self-alignment-Y") != SCM_UNDEFINED)
+    {
+      dim_cache_[Y_AXIS]->set_offset_callback (set_alignment_callback);
+    }
+  
   do_add_processing();
 }
 
 void
 Score_element::calculate_dependencies (int final, int busy,
-                                   Score_element_method_pointer funcptr)
+                                      Score_element_method_pointer funcptr)
 {
   assert (status_i_ >=0);
 
@@ -337,6 +374,36 @@ Score_element::substitute_dependency (Score_element* old, Score_element* new_l)
   old->do_substitute_element_pointer (this, 0);
 }
 
+
+/**
+   Do break substitution, and return new value.
+ */
+SCM 
+Score_element::handle_broken_smobs (SCM s, Line_of_score * line)
+{
+  if (SMOB_IS_TYPE_B (Score_element, s))
+    {
+      Score_element *sc = SMOB_TO_TYPE (Score_element, s);
+      Score_element * br =0;
+      if (sc->line_l () != line)
+       {
+         br = sc->find_broken_piece (line);
+       }
+
+      if (br)
+       return br->self_scm_;
+    }
+  else if (gh_pair_p (s))
+    {
+      /*
+       UGH! breaks on circular lists.
+       */
+      gh_set_car_x (s, handle_broken_smobs (gh_car (s), line));
+      gh_set_cdr_x (s, handle_broken_smobs (gh_cdr (s), line));
+    }
+  return s;
+}
+
 void
 Score_element::handle_broken_dependencies()
 {
@@ -344,7 +411,7 @@ Score_element::handle_broken_dependencies()
   if (!line)
     return;
 
-  do_substitute_arrays ();
+  element_property_alist_ = handle_broken_smobs (element_property_alist_, line);
 
   Link_array<Score_element> new_deps;
 
@@ -366,28 +433,14 @@ Score_element::handle_broken_dependencies()
 
 
 /*
-  This sux.
-
-  unlike with spanners, the number of items can increase
-
-  span: item1
-
-  becomes
-
-  span: item1 item2 item3
-
-  How to let span (a derived class) know that this happened?
-
-
   TODO: cleanify.
  */
 void
 Score_element::handle_prebroken_dependencies()
 {
-  /*  dynamic_cast<Item*> (this) && 
-  if (!break_status_dir ())
-    return;
-  */
+  element_property_alist_
+    = handle_broken_smobs (element_property_alist_, line_l ());
+
   Link_array<Score_element> old_arr, new_arr;
   
   for (int i=0; i < dependency_size(); i++) 
@@ -449,10 +502,6 @@ Score_element::do_print () const
 {
 }
 
-void
-Score_element::do_substitute_arrays ()
-{
-}
 
 
 Score_element*
@@ -479,6 +528,8 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *)
      
   scm_puts ("#<Score_element ", port);
   scm_puts ((char *)sc->name (), port);
+  scm_puts ("properties = ", port);
+  scm_display (sc->element_property_alist_, port);
   scm_puts (" >", port);
   return 1;
 }
index b3a8db33fe3cf0287503609e421eb8bd931abb71..e144890ea4b672cdb304cc48a045d70e5f56ffab 100644 (file)
@@ -19,7 +19,7 @@ class Script_column_engraver : public Engraver
 {
   Script_column *scol_p_;
   Link_array<Item> script_l_arr_;
-  Link_array<Staff_side_item> staff_side_l_arr_;  
+
 public:
   Script_column_engraver ();
   VIRTUAL_COPY_CONS(Translator);
@@ -50,7 +50,7 @@ void
 Script_column_engraver::do_post_move_processing ()
 {
   script_l_arr_.clear ();
-  staff_side_l_arr_.clear ();
+
 }
 
 void
@@ -60,12 +60,9 @@ Script_column_engraver::acknowledge_element( Score_element_info inf)
   if (!thing)
     return;
   
-  Graphical_element *parent = thing->parent_l(Y_AXIS);
-
-
-  if (Staff_side_item * ss = dynamic_cast<Staff_side_item*>(parent))
+  if (Staff_sidify (thing).is_staff_side_b ())
     {
-      if (!ss->breakable_b () && ss->axis_ == Y_AXIS)
+      if (!thing->breakable_b () && Staff_sidify (thing).get_axis () == Y_AXIS)
        {
          script_l_arr_.push (thing);
        }
index 6fabed4d90bc0eeaec360e1a95975a17722deb96..720b7f0a11ca268ab7cf505854b81a3f9760a156 100644 (file)
 #include "staff-side.hh"
 #include "dimension-cache.hh"
 
-static Staff_side_item *
-get_Staff_side (Item *i)
-{
-  Graphical_element *e1 = i->parent_l(Y_AXIS);
-
-  return dynamic_cast<Staff_side_item*>(e1);
-}
 
 void
 Script_column::add_staff_sided (Item *i)
 {
-  SCM p = get_Staff_side (i)->get_elt_property ("script-priority");
+  SCM p = i->get_elt_property ("script-priority");
   if (p == SCM_UNDEFINED)
     return;
   
@@ -33,11 +26,8 @@ static int
 staff_side_compare (Item * const &i1,
                    Item * const &i2)
 {
-  Score_element *e1 = get_Staff_side (i1);
-  Score_element *e2 = get_Staff_side (i2);
-
-  SCM p1 = e1->get_elt_property ("script-priority");
-  SCM p2 = e2->get_elt_property ("script-priority");
+  SCM p1 = i1->get_elt_property ("script-priority");
+  SCM p2 = i2->get_elt_property ("script-priority");
 
   return gh_scm2int (p1) - gh_scm2int (p2);
 }
@@ -49,8 +39,8 @@ Script_column::do_pre_processing ()
 
   for (int i=0; i < staff_sided_item_l_arr_.size (); i++)
     {
-      Staff_side_item * ip = get_Staff_side (staff_sided_item_l_arr_[i]);
-      arrs[ip->get_direction ()].push (staff_sided_item_l_arr_[i]);
+      Staff_sidify st (staff_sided_item_l_arr_[i]);
+      arrs[st.get_direction ()].push (staff_sided_item_l_arr_[i]);
     }
 
   Direction d = DOWN;
@@ -62,14 +52,13 @@ Script_column::do_pre_processing ()
     Item * last = 0;
     for (int i=0; i < arr.size (); i++)
       {
-       Staff_side_item * gs = get_Staff_side (arr[i]);
+       Staff_sidify s (arr[i]);
        if (last)
          {
-           gs->add_support (last);
-           gs->add_support (get_Staff_side (last));
+           s.add_support (last);
          }
            
-       gs->remove_elt_property ("script-priority");
+       arr[i]->remove_elt_property ("script-priority");
        last = arr[i];
       }
     
index 34163ddc53cfbf00a2a1eabd0efbf724e0415756..b41f04fe1494456a486ffa56690c837dda1efd4b 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "script-engraver.hh"
 #include "script.hh"
-#include "stem-staff-side.hh"
+#include "staff-side.hh"
 #include "musical-request.hh"
 #include "stem.hh"
 #include "staff-symbol.hh"
@@ -50,8 +50,8 @@ Script_engraver::do_process_requests()
          continue;
        }
       Script *p =new Script;
-      Stem_staff_side_item * ss =new Stem_staff_side_item;
-
+      Staff_sidify stafy (p); 
+      
       list = gh_cdr (list);
       p->set_elt_property ("molecule",
                           SCM_CAR(list));
@@ -65,42 +65,29 @@ Script_engraver::do_process_requests()
       list = SCM_CDR(list);
       SCM priority = SCM_CAR(list);
 
+      
       if (relative_stem_dir)
-         ss->relative_dir_ = (Direction)relative_stem_dir;
+         p->set_elt_property ("side-relative-direction", gh_int2scm (relative_stem_dir));
       else
-         ss->set_direction ((Direction)force_dir);
-
-      SCM dir_prop (get_property ("articulationScriptVerticalDirection", 0));
-      if (gh_number_p(dir_prop))
-       ss->set_direction (to_dir (dir_prop));
+         stafy.set_direction ((Direction)force_dir);
 
       if (l->get_direction ())
-       ss->set_direction (l->get_direction ());
-
-      SCM paddingprop = get_property ("articulationScriptPadding", 0);
-      if (gh_number_p(paddingprop))
-       {
-         ss->set_elt_property ("padding", paddingprop);
-       }
+       stafy.set_direction (l->get_direction ());
 
       SCM axisprop = get_property ("scriptHorizontal",0);
       if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
-       ss->axis_ = X_AXIS;
-
+       stafy.set_axis (X_AXIS);
+      else
+       stafy.set_axis (Y_AXIS);
+      
       if (follow_staff && !gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
-       ss->set_elt_property ("no-staff-support", SCM_BOOL_T);
+       p->set_elt_property ("no-staff-support", SCM_BOOL_T);
 
-      p->set_staff_side (ss);
-      ss->set_elt_property ("script-priority", priority);
-      if (gh_number_p (paddingprop))
-       ss->set_elt_property ("padding", paddingprop);
-  
+      p->set_elt_property ("script-priority", priority);
   
       script_p_arr_.push (p);
-      staff_side_p_arr_.push (ss);
       
       announce_element (Score_element_info (p, l));
-      announce_element (Score_element_info (ss, l));
     }
 }
 
@@ -109,28 +96,28 @@ Script_engraver::acknowledge_element (Score_element_info inf)
 {
   if (Stem *s = dynamic_cast<Stem*>(inf.elem_l_))
     {
-      for (int i=0; i < staff_side_p_arr_.size(); i++)
-       if (Stem_staff_side_item * ss = dynamic_cast<Stem_staff_side_item*>(staff_side_p_arr_[i]))
-         {
-           ss->set_stem (s);
-           ss->add_support (s);
-         }
+      for (int i=0; i < script_p_arr_.size(); i++)
+       {
+         Staff_sidify stafy (script_p_arr_[i]);
+         stafy.elt_l_->set_elt_property ("direction-source", s->self_scm_);
+         stafy.add_support (s);
+       }
     }
   else if (Rhythmic_head * rh = dynamic_cast<Rhythmic_head*>(inf.elem_l_))
     {
-      for (int i=0; i < staff_side_p_arr_.size(); i++)
+      for (int i=0; i < script_p_arr_.size(); i++)
        {
-         Staff_side_item * ss = dynamic_cast<Staff_side_item*>(staff_side_p_arr_[i]);
+         Staff_sidify stafy(script_p_arr_[i]);
          
-         if (!ss->parent_l (X_AXIS))
+         if (!stafy.elt_l_->parent_l (X_AXIS))
            {
-             ss->set_parent (inf.elem_l_, X_AXIS);
+             stafy.elt_l_->set_parent (inf.elem_l_, X_AXIS);
            }
-         if (ss->axis_ == X_AXIS
-             && !ss->parent_l (Y_AXIS))
-           ss->set_parent (rh, Y_AXIS);
+         if (stafy.get_axis () == X_AXIS
+             && !stafy.elt_l_->parent_l (Y_AXIS))
+           stafy.elt_l_->set_parent (rh, Y_AXIS);
          
-         ss->add_support (rh);
+         stafy.add_support (rh);
        }
     }  
 }
@@ -141,10 +128,8 @@ Script_engraver::do_pre_move_processing()
   for (int i=0; i < script_p_arr_.size(); i++) 
     {
       typeset_element (script_p_arr_[i]);
-      typeset_element (staff_side_p_arr_[i]);
     }
   script_p_arr_.clear();
-  staff_side_p_arr_.clear ();
 }
 
 void
index e5c43f2051d35715af7793c741b789ccec32666c..97e60577ead396bef98858559560468cd8dd65c1 100644 (file)
 #include "paper-def.hh"
 #include "dimension-cache.hh"
 
-Script::Script ()
-{
-  staff_side_l_ =0;
-}
-
-void
-Script::do_substitute_element_pointer (Score_element*o, Score_element*n)
-{
-  if (o == staff_side_l_)
-    staff_side_l_ = dynamic_cast<Staff_side_item*>(n);
-}
-
-
 
 Molecule
 Script::get_molecule(Direction d) const
@@ -62,40 +49,36 @@ Script::do_pre_processing ()
   /*
     center my self on the note head.
    */
-  Graphical_element * e = staff_side_l_->parent_l(X_AXIS);
+  Graphical_element * e = parent_l(X_AXIS);
   translate_axis (e->extent (X_AXIS).center (), X_AXIS);
 }
 
 void
 Script::do_post_processing ()
 {
-  Direction d =  staff_side_l_->get_direction ();
+  Direction d =  Staff_sidify (this).get_direction ();
   Molecule m (get_molecule(d));
 
   /*
     UGH UGH UGH
    */
+#if 0
   if (staff_side_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED) 
     translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
+#endif
 }
 
-void
-Script::set_staff_side (Staff_side_item*g)
-{
-  staff_side_l_ = g;
-  add_dependency (g);
-  set_parent (g, Y_AXIS);
-}
 
 Molecule*
 Script::do_brew_molecule_p () const
 {
-  return new Molecule (get_molecule (staff_side_l_->get_direction ()));
+  Direction dir = DOWN;
+  SCM d = get_elt_property ("direction");
+  if (isdir_b (d))
+    dir = to_dir (d);
+  
+  return new Molecule (get_molecule (dir));
 }
 
-void
-Script::do_print () const
-{
 
-}
 
index 0d6e1e7984cbca46c4fbadb5bc6c3c1c38838228..dc67ca5cf46f567d8b352f7a96c219e3826e6df2 100644 (file)
@@ -51,7 +51,7 @@ Staff_margin_engraver::acknowledge_element (Score_element_info inf)
     {
       create_items (0);
       text_p_->text_str_ = ly_scm2string (long_name);
-      staff_side_p_->set_direction (LEFT);
+      text_p_->set_elt_property ("direction", gh_int2scm (LEFT));
       Bar_script_engraver::attach_script_to_item (i);
 
       /*
index 5e737330a0640a094f034e412f3bb0c6ca902278..669f8a5ac69ffefa08a02806afda4619d0eeeb92 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  g-staff-side.cc --  implement Staff_side_element
+  staff-side.cc --  implement Staff_side_element
   
   source file of the GNU LilyPond music typesetter
   
 #include "dimensions.hh"
 #include "dimension-cache.hh"
 
-Staff_side_element::Staff_side_element ()
+Staff_sidify::Staff_sidify (Score_element *e)
 {
-  to_position_l_ = 0;
-  set_elt_property ("transparent", SCM_BOOL_T);
-  axis_ = Y_AXIS;
+  elt_l_ = e;
 }
 
+
 void
-Staff_side_element::do_pre_processing ()
+Staff_sidify::add_support (Score_element*e)
 {
-  if (!get_direction ())
-    set_direction (get_default_direction ());
-
-  if (axis_ == X_AXIS)
-    position_self ();
+  SCM sup = elt_l_->get_elt_property ("side-support");
+  elt_l_->set_elt_property ("side-support",
+                           gh_cons (e->self_scm_,sup));
 }
 
-Direction
-Staff_side_element::get_default_direction () const
+Real
+Staff_sidify::aligned_position (Dimension_cache const *c)
 {
-  return DOWN;
+  return position_self (c);
 }
 
 
-void
-Staff_side_element::set_victim (Score_element *e)
-{
-  add_dependency (e);
-  to_position_l_ = e;
-  to_position_l_->set_parent (this, axis_);
-}
-
-void
-Staff_side_element::add_support (Score_element*e)
+Direction
+Staff_sidify::get_direction () const
 {
-  add_dependency (e);
-  support_l_arr_.push (e);
-}
+  SCM d = elt_l_->get_elt_property ("direction");
+  if (isdir_b (d))
+    return to_dir (d) ? to_dir (d) : DOWN;
 
+  Direction relative_dir = UP;
+  SCM reldir = elt_l_->get_elt_property ("side-relative-direction");   // should use a lambda.
+  if (isdir_b (d))
+    {
+      relative_dir = to_dir (reldir);
+    }
+  
+  SCM other_elt = elt_l_->get_elt_property ("direction-source");
+  if (SMOB_IS_TYPE_B (Score_element, other_elt))
+    {
+      Score_element * e = SMOB_TO_TYPE(Score_element,other_elt);
 
-void
-Staff_side_element::do_substitute_element_pointer (Score_element*o, Score_element*n)
-{
-  Staff_symbol_referencer::do_substitute_element_pointer (o,n);
-  if (o == to_position_l_)
-    to_position_l_ = n;
-  else
-    support_l_arr_.unordered_substitute (o,n);
+      return relative_dir * Staff_sidify (e).get_direction ();
+    }
+  
+  return DOWN;
 }
-
-void
-Staff_side_element::position_self ()
+  
+/**
+   Callback that does the aligning.
+ */
+Real
+Staff_sidify::position_self (Dimension_cache const * c)
 {
-  if (to_position_l_ &&
-      to_position_l_->get_elt_property ("transparent") != SCM_UNDEFINED)
-    return;
+  Score_element * me = dynamic_cast<Score_element*> (c->element_l ());
 
-  Axis other = Axis ((axis_ + 1) % NO_AXES);
-  if (parent_l (axis_)->empty_b (axis_)
-      &&parent_l (axis_)->empty_b (other)) // guh
+  Interval dim;
+  Axis  axis = c->axis ();
+  Graphical_element *common = me->parent_l (axis);
+  SCM support = me->get_elt_property ("side-support");
+  for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
     {
-      warning (_("No support; erasing script"));
-      to_position_l_->set_empty (X_AXIS,Y_AXIS);
-      to_position_l_->set_elt_property ("transparent", SCM_BOOL_T);
-      set_empty (X_AXIS, Y_AXIS);
-      return ;
+      assert (SMOB_IS_TYPE_B (Score_element, gh_car (s)));
+      Score_element * e  = SMOB_TO_TYPE(Score_element, gh_car (s));
+      common = common->common_refpoint (e, axis);
     }
   
-  Interval dim;
-  Graphical_element *common = 0;
-  if (support_l_arr_.size ())
+  for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
     {
-      common = common_refpoint (typecast_array (support_l_arr_, (Graphical_element*)0),
-                               axis_);
-
-      for (int i=0; i < support_l_arr_.size (); i++)
-       {
-         Score_element * e = support_l_arr_ [i];
-         Real coord = e->relative_coordinate (common, axis_);
+      Score_element * e  = SMOB_TO_TYPE(Score_element, gh_car (s));
+      Real coord = e->relative_coordinate (common, axis);
 
-         dim.unite (coord + e->extent (axis_));
-       }
+      dim.unite (coord + e->extent (axis));
     }
-  else
-     common = parent_l (axis_);
+
 
   if (dim.empty_b ())
     {
       dim = Interval(0,0);
     }
 
-  
-  Interval sym_dim
-    = to_position_l_
-    ? to_position_l_->extent (axis_)
-    : Interval(0,0);
+  Real off =  me->parent_l (axis)->relative_coordinate (common, axis);
 
-  Real off =  relative_coordinate (common, axis_);
 
-  SCM pad = remove_elt_property ("padding");
+  Direction dir = Staff_sidify (me).get_direction ();
+    
+  SCM pad = me->remove_elt_property ("padding");
   if (pad != SCM_UNDEFINED)
     {
-      off += gh_scm2double (pad) * get_direction ();
+      off += gh_scm2double (pad) * dir;
     }
-  Real total_off = dim[get_direction ()] + off;
+  Real total_off = dim[dir] + off;
 
-  /*
-    "no-staff-support" is ugh bugfix to get staccato dots right.
-   */
-  if (to_position_l_ && to_position_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED)
-     total_off += - sym_dim[-get_direction ()];
-  
-  dim_cache_[axis_]->set_offset (total_off);
   if (fabs (total_off) > 100 CM)
     programming_error ("Huh ? Improbable staff side dim.");
-}
-
-void
-Staff_side_element::do_post_processing ()
-{
-  if (axis_ == Y_AXIS)
-    position_self ();
-}
 
-
-void
-Staff_side_element::do_add_processing ()
-{
-  if (get_elt_property ("no-staff-support") == SCM_UNDEFINED
-      && axis_ == Y_AXIS && staff_symbol_l ())
-    {
-      add_support (staff_symbol_l ());
-    }
-}
-
-Interval
-Staff_side_element::do_height () const
-{
-  Interval i;
-  if (to_position_l_)
-    return to_position_l_->extent (Y_AXIS);
-  return i;
+  return total_off;
 }
 
 void
-Staff_side_element::do_print () const
+Staff_sidify::set_axis (Axis a)
 {
-#ifndef NPRINT
-  if (to_position_l_)
-    DEBUG_OUT << "positioning " << to_position_l_->name();
+  if (elt_l_->get_elt_property ("transparent") == SCM_UNDEFINED)
+    elt_l_->set_elt_property ("side-support" ,SCM_EOL);
 
-  DEBUG_OUT << "axis == " << axis_name_str (axis_)
-       << ", dir == " << to_str ((int)get_direction () );
-#endif
+  Axis other = Axis ((a +1)%2);
+  elt_l_->dim_cache_[a]->set_offset_callback (position_self);
+  elt_l_->dim_cache_[other]->set_offset_callback (0);  
 }
 
-
-Interval
-Staff_side_item::do_width () const
+Axis
+Staff_sidify::get_axis () const
 {
-  Interval i;
-  if (to_position_l_)
-    return to_position_l_->extent (X_AXIS);
-  return i;
+  if (elt_l_->dim_cache_[X_AXIS]->off_callback_l_ == position_self) // UGH.
+    return X_AXIS;
+  else
+    return Y_AXIS;  
 }
 
 void
-Staff_side_item::do_print () const
+Staff_sidify::set_direction (Direction d) 
 {
-  Staff_side_element::do_print ();
+  elt_l_->set_elt_property ("direction", gh_int2scm (d));
 }
 
-void
-Staff_side_spanner::do_print () const
+bool
+Staff_sidify::is_staff_side_b ()
 {
-  Staff_side_element::do_print ();
+  return elt_l_->get_elt_property ("side-support") != SCM_UNDEFINED;
 }
-
index ad2ba0b7fd6e0dab0b1dd885b9990922179100b7..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,98 +1 @@
-/*   
-  g-stem-staff-side.cc --  implement Stem_staff_side
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#include "dimension-cache.hh"
-#include "stem-staff-side.hh"
-#include "stem.hh"
-#include "staff-symbol.hh"
-#include "paper-def.hh"
-
-Stem_staff_side_item::Stem_staff_side_item ()
-{
-  stem_l_ =0;
-  relative_dir_ = CENTER;
-}
-
-void
-Stem_staff_side_item::do_substitute_element_pointer (Score_element*o,
-                                                      Score_element*n)
-{
-  if (o == stem_l_)
-    {
-      stem_l_ = dynamic_cast<Stem*> (n);
-    }
-  Staff_side_item::do_substitute_element_pointer (o,n);
-}
-
-void
-Stem_staff_side_item::set_stem (Stem*s)
-{
-  stem_l_ =s;
-  add_dependency (s);
-}
-
-
-Direction
-Stem_staff_side_item::get_default_direction () const
-{
-  return (Direction)(relative_dir_ * stem_l_->get_direction ());
-}
-
-void
-Stem_staff_side_item::do_pre_processing ()
-{
-  SCM p = remove_elt_property ("padding");
-  Real pad  = paper_l ()->get_var ("articulation_script_padding_default");
-  if (get_elt_property ("no-staff-support") != SCM_UNDEFINED)
-    pad =0.0; 
-  
-  Real il  = (stem_l_) ? stem_l_->staff_line_leading_f (): paper_l ()->get_var ("interline");
-  
-  if (p != SCM_UNDEFINED)
-    {
-      pad =  gh_scm2double (p);
-    }
-  pad *=  il ;
-  set_elt_property ("padding",
-                   gh_double2scm(pad));
-
-  Staff_side_item::do_pre_processing ();
-}
-
-void
-Stem_staff_side_item::do_post_processing ()
-{
-  Staff_side_item::do_post_processing ();
-
- /*
-   Ugh: try to get staccato dots right. 
-
-   TODO:
-    
-    
-    should use general no_staff_line_collision elt property, and use
-    the same elt prop also for positioning slurs, ties and dots.
-  */
-  if (get_elt_property ("no-staff-support") != SCM_UNDEFINED)
-    {
-      Graphical_element * c =common_refpoint (staff_symbol_l (), Y_AXIS);
-      Real staff_coord = staff_symbol_l ()->relative_coordinate (c, Y_AXIS);
-      Real self_coord = relative_coordinate (c, Y_AXIS);
-      Real now_coord = self_coord - staff_coord;
-      
-      Real desired_coord = ceil (get_direction () * 2.0 *  now_coord / staff_line_leading_f ());
-      if (! (int (desired_coord) % 2))
-       {
-         desired_coord ++;
-       }
-
-      translate_axis (desired_coord * get_direction () *  staff_line_leading_f () / 2.0  - now_coord, Y_AXIS);
-    }
-}
 
index 5cac32fd3dc983731447a07790b707feba2148bf..c0fb5ab1509756de5e3b2617640a95c580ae65e5 100644 (file)
 #include "stem.hh"
 #include "staff-symbol.hh"
 
+/**
+   typeset directions that are  plain text.
+ */
 class Text_engraver : public Engraver
 {
   Link_array<Text_script_req> reqs_;
-  Link_array<Staff_side_item> positionings_;
   Link_array<Text_item> texts_;
 public:
-  Text_engraver();
+
   VIRTUAL_COPY_CONS(Translator);
 protected:
   virtual bool do_try_music (Music* m);
@@ -32,10 +34,6 @@ protected:
   virtual void acknowledge_element (Score_element_info);
 };
 
-Text_engraver::Text_engraver ()
-{
-  
-}
 
 bool
 Text_engraver::do_try_music (Music *m)
@@ -54,19 +52,21 @@ Text_engraver::acknowledge_element (Score_element_info i)
 {
   if (Note_head *n = dynamic_cast<Note_head*> (i.elem_l_))
     {
-      for (int i=0; i < positionings_.size (); i++)
+      for (int i=0; i < texts_.size (); i++)
        {
-         positionings_[i]->add_support (n);
-         if (positionings_[i]->axis_ == X_AXIS
-             && !positionings_[i]->parent_l (Y_AXIS))
-           positionings_[i]->set_parent (n, Y_AXIS);
+         Staff_sidify st (texts_[i]);
+         st.add_support (n);
+         if (st.get_axis( ) == X_AXIS
+             && !texts_[i]->parent_l (Y_AXIS))
+           texts_[i]->set_parent (n, Y_AXIS);
        }
     }
   if (Stem *n = dynamic_cast<Stem*> (i.elem_l_))
     {
-      for (int i=0; i < positionings_.size (); i++)
+      for (int i=0; i < texts_.size (); i++)
        {
-         positionings_[i]->add_support (n);
+         Staff_sidify st(texts_[i]);
+         st.add_support (n);
        }
     }
 }
@@ -79,23 +79,23 @@ Text_engraver::do_process_requests ()
       Text_script_req * r = reqs_[i];
 
       Text_item *text = new Text_item;
-      Staff_side_item *ss = new Staff_side_item;
-
-
+      Staff_sidify stafy (text);
 
       SCM axisprop = get_property ("scriptHorizontal",0);
       if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
        {
-         ss->axis_ = X_AXIS;
-         text->set_parent (ss, Y_AXIS);
-                              
+         stafy.set_axis (X_AXIS);
+         //      text->set_parent (ss, Y_AXIS);
        }
-      ss->set_victim (text);
-      ss->set_elt_property ("script-priority",
+      else
+       stafy.set_axis (Y_AXIS);
+      
+      text->set_elt_property ("script-priority",
                            gh_int2scm (200));
 
-      ss->set_direction (r->get_direction ());
-
+      if (r->get_direction ())
+       stafy.set_direction (r->get_direction ());
+      
       text->text_str_ = r->text_str_;
       
       if (r->style_str_.length_i ())
@@ -108,10 +108,7 @@ Text_engraver::do_process_requests ()
        }
 
       announce_element (Score_element_info (text, r));
-      announce_element (Score_element_info (ss, r));
-
       texts_.push (text);
-      positionings_.push (ss);
     }
 }
 
@@ -121,10 +118,8 @@ Text_engraver::do_pre_move_processing ()
   for (int i=0; i < texts_.size (); i++)
     {
       typeset_element (texts_[i]);
-      typeset_element (positionings_[i]);
     }
   texts_.clear ();
-  positionings_.clear ();
 }
 
 void
index bba35fe2b1d9421f1f3ea7cd4ab034eb03a210e7..2eabe72fe4ed22f6335b51e2726277d0f7977935 100644 (file)
@@ -54,6 +54,11 @@ Time_signature_engraver::do_pre_move_processing()
 {
   if (time_signature_p_) 
     {
+      SCM sigstyle = get_property ("timeSignatureStyle", 0);
+      if (gh_string_p (sigstyle))
+        {
+          time_signature_p_->set_elt_property ("style", sigstyle);
+        }
       typeset_element (time_signature_p_);
       time_signature_p_ =0;
     }
index 8fec27817a39467ed5ab409776a15311af581f20..e33e182bbc2c17ba4d410c4ce48a7eb587f3cf4c 100644 (file)
@@ -187,7 +187,8 @@ GrandStaffContext=\translator{
        \name GrandStaff;
        \consists "Span_bar_engraver";
        \consists "Piano_bar_engraver";
-
+       \consists "Property_engraver";  
+       Generic_property_list = #generic-grand-staff-properties
        \accepts "Staff";
 };
 \translator{\GrandStaffContext}
index d6be3ee42688cbf8f665b3a89e52e0a9ce46e55d..03cd87789880b945bf9194e41de6511a718c40ff 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.7
-Entered-date: 18NOV99
+Version: 1.3.8
+Entered-date: 24NOV99
 Description: 
 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.3.7.tar.gz 
+       1000k lilypond-1.3.8.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.7.tar.gz 
+       1000k lilypond-1.3.8.tar.gz 
 Copying-policy: GPL
 End
index 13af3c1aed173c624d8a8addaa1ac4eac5f397c1..8ce3122e2e505db77ddf532490237d8c3960f2dc 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.7
+Version: 1.3.8
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.7.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.8.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # get Packager from (undocumented?) ~/.rpmmacros!
index 60dec520c829426722dbf763f30652b85fc900a0..2df908e8c8e815efa4d3e4c73598026c4eb4ce9c 100644 (file)
@@ -46,6 +46,10 @@ Lemoine puts fermatas on ending bar lines everywhere.
 
 \version "1.3.4";
 
+
+lowstaff = \translator "Staff" = "lower"
+upstaff = \translator "Staff" = "upper"
+
 % upper = \context Staff \notes\relative c {
 upper = \context Staff=upper \notes\relative c {
        \context Voice=i
@@ -68,27 +72,26 @@ upper = \context Staff=upper \notes\relative c {
        r c, g' b r c, fis a |
        r b, d a' r b, d g 
        r a, c g' r a, c f! |
+       
        % ugh arpeggio
-       <
-               { \stemup f4 r }
-               \context Voice=ii { \stemdown <g,4 d'> r }
-       >
+       <f4 d b4>
+       r4
+       
        \stemboth 
-       \translator Staff=lower\stemup
+       \stemup
        r16 g,, b d  
-       [ f \translator Staff=upper\stemdown g16 b d ] | 
+       [ f \upstaff \stemdown g16 b d ] | 
        \stemup b
-       \translator Staff=lower\stemdown
+       \lowstaff \stemdown
        [ g b d ] f
-       \translator Staff=upper\stemup
+       \upstaff 
        [ g16 b d ] b
-       \translator Staff=lower\stemup
-       \clef "violin"; 
        [ g b d ]
        \stemup
+
        % urg, below translator change affects previous beam too!?
        % howto separate translator command from previous beam end?
-       \translator Staff=upper f g b f |
+       \upstaff f g b f |
        \stemboth
        e c' g f  e c' g e 
        d c' f, e  d b' f d |
@@ -120,7 +123,7 @@ lower = \context Staff=lower \notes\relative c{
        c4 e g^"\\textsharp"-\mordent g,4 |
        d'4-\mordent f a-\mordent^"\\textsharp" a,4 |
        e' e'-\mordent a, b-\upprall |
-       c4 e, fis gis-\downprall |
+       c4 e, fis gis-\upprall |
        a4 c, d e-\upprall |
        f4 e d-\prall c |
        g'-\mordent^"\\textsharp" g, g'-\mordent g, |
index b10faa565dcaa997c107cd58a5752ecd2b14baf4..4495fb290d47e11a68ffe16e412308d0b200e905 100644 (file)
@@ -49,56 +49,38 @@ upper = \context Staff \notes\relative c{
        r8 c' e g  e c bes' g |
        a c, f a  f c c' a |
        b g b d  b g f' d |
-       <
-               {\stemup e2 r4 e }
-               \context Voice = ii {\stemdown <c2 g > r4 <c g > }
-       >
-       \stemboth |
-       < 
-                { \stemup d2 r4 d }
-                \context Voice = ii { \stemdown <c2 a > r4 <c a > }
-       >
-       \stemboth |
-       < 
-                { \stemup d8 }
-                \context Voice = ii { \stemdown <b 8 g > }
+       <e2 c g>
+       r4
+       <e c g >
+       <d2 c a>
+       r4
+       <d c a>
+       < { \stemup [d8 g, 8 b d] }
+         \context Voice = ii < \stemdown b g >
        >
-       \stemboth 
-       g, 8 b d 
-       <
-               { \stemup b 4 e }
-               \context Voice = ii { \stemdown g, 4 b }
-       >
-       \stemboth |
+       
+       <b4 g>
+       <e b>
+       c2
+       r4
        <
-               { \stemup c2 r4 < {c ~ c8} {a 4 ~ a 8} > }
-               \context Voice=ii { \stemdown c2 r4 e, 4 ~ e 8 }
+               { \stemup c ~ c8} 
+               \context Voice=ii { \stemdown <e,4 a> ~ <e8 a> }
        >
        \stemboth 
        d, fis a  fis d c' a |
        b g b d  b g f'! d |
        e g, c e  c g g' e |
        fis a, c fis  c a a' fis |
-       <
-               { \stemup g2 }
-               \context Voice = ii { \stemdown <d2 b > }
-       >
-       \stemboth 
-       r4 b4 |
-       c,8 e g c  g e bes' g |
+       <g2 d b>
+       r4 b,4 |
+       c8 e g c  g e bes' g |
        a16 g f e  d c b ! a 
        b g a b  c d e f |
        g4
-       <
-               { \stemup c,2 b 4 }
-               \context Voice=ii { \stemdown g 2 d 4 }
-       >
-       \stemboth 
-       <
-               { \stemup c1 }
-               \context Voice=ii { \stemdown e, 1}
-       >
-       \stemboth 
+       <g,2 c>
+       <d4 b'>
+       <e1 c'>
        \bar "|.";
 }
 
@@ -121,9 +103,9 @@ lower = \context Staff \notes\relative c{
        g'8 g, b d  b g f'! d |
        e c e g  e c c' e, |
 
-       f1 |
+       f1 |
        f8 d e c g'4 g, |
-       <c1 c,1>
+       c,1
        \bar "|.";
 }
 
index a733c64230814684e4386400146bbee9a83b273c..bf6d499d252063fef588fdc467e8a8c2954b607c 100644 (file)
@@ -95,12 +95,8 @@ upper =  \notes \transpose c'' {
        r16 [fis, c es] [c fis, c fis,] r fis, r fis, |
        r16 [g, b, d] [b, g, b, d] [es c a, fis] |
 
-       
-       \context Staff <
-               \context Voice=i {\stemup g4-\fermata}
-               \context Voice=ii {\stemdown <b,4 d>}
-       >
-       \stemboth
+
+       <g4 d b>        
        \bar "|.";
 }
 
@@ -160,7 +156,7 @@ lower =  \notes{
        g,4 r [es8 c] |
        g,4 r [es8 c] |
        g,4 r r |
-       g,2._\fermata 
+       g,4_\fermata 
        \bar "|.";
 }
 
index f99e470e2a30c54b31882c9c576fb918ebc64f0a..baf9b553fd96437eaa35b4b8e0cf9214fdb77d69 100644 (file)
@@ -41,32 +41,32 @@ one = \context Staff \notes\relative c {
 %      r16_"legato" 
        r16
        \property Voice . textStyle = "finger"
-       d'( fis d  a' b cis a 
+       d' fis d  a' b cis a 
        d cis d e  d fis e d |
        \property Voice . textStyle = "finger"
        \stemup 
-       )cis4 fis ~ fis8 fis e4 ~ | 
-       e16 \stemboth a,16( cis a  d e fis d 
+       cis4 fis ~ fis8 fis e4 ~ | 
+       e16 \stemboth a,16 cis a  d e fis d 
        g fis g a  g b a g |
        \stemup
 
-       )fis4 e8 a <fis4 d> <gis e> |
+       fis4 e8 a <fis4 d> <gis e> |
        %5
-       <a4( e> <fis d> < )g!16 d> fis g a 
+       <a4 e> <fis d> < g!16 d> fis g a 
        \stemboth
        g b a g |
        \property Voice . textStyle = "italic"
 
        fis e fis g  fis a g fis 
        \property Voice . textStyle = "finger"
-%      e4-"2\\_5" ~ e16 e,( fis g  |
-       e4 ~ e16 e,( fis g  |
+%      e4-"2\\_5" ~ e16 e, fis g  |
+       e4 ~ e16 e, fis g  |
        \property Voice . textStyle = "italic"
 
        a g a b  a c b a 
        g fis g a  g b a g |
        \stemup
-       )fis4 
+       fis4 
        \skip 4*7; |
        %10
        \property Voice . textStyle = "finger"
@@ -90,7 +90,7 @@ one = \context Staff \notes\relative c {
        b4 a ~ a8 g ~  g16 fis8 e16 |
        fis8 e~  e d~ d4 cis |
 
-       d2 ~ d16 a( b cis )d4 |
+       d2 ~ d16 a b cis d4 |
        \bar "|.";
 }
 
@@ -98,8 +98,8 @@ two = \context Staff \notes\relative c{
        \context Voice=ii
        \stemup
        \property Voice . textStyle = "finger"
-       fis4( e8 a4 a4 gis8 | 
-       ) a8
+       fis4 e8 a4 a4 gis8 | 
+        a8
        \translator Staff=upper \stemdown
 
        a'4 a8 b4. cis8 ~ | 
@@ -112,7 +112,7 @@ two = \context Staff \notes\relative c{
        %5
        r8 a4 a8
        \translator Staff=lower \stemup
-       g8( fis )e4 ~ | 
+       g8 fis e4 ~ | 
        e4 d ~ d16 d cis b cis4 ~ |
        cis8 a d4. d4^> cis8 |
        \translator Staff=upper \stemdown
@@ -153,25 +153,25 @@ three = \notes\relative c{
        \context Voice=iii
        \stemdown 
        d4 cis b e |
-       a16 a,( cis a  d e fis d 
+       a16 a, cis a  d e fis d 
        g fis g a  g b a g |
-       )fis4 fis e a |
-       d16 \stemboth d,( fis d  a' b cis a 
-       d cis d e  d fis e ) d |
+       fis4 fis e a |
+       d16 \stemboth d, fis d  a' b cis a 
+       d cis d e  d fis e  d |
        %5
        cis b cis d  c e d c 
-       \stemdown b4 cis8 b( |
-       a )fis b a  gis e a g |
+       \stemdown b4 cis8 b |
+       a fis b a  gis e a g |
        fis4. d8 e4 a4 |
        \stemboth
-       r16 d,( fis d  )g8-. g,-. 
-       r16 e'( g e  )a8-. a,-. |
-       r16 fis'( a fis  )b8-. b,-. r16 g'( b g  )d'8-. d,-. |
+       r16 d, fis d  g8 g, 
+       r16 e' g e  a8 a, |
+       r16 fis' a fis  b8 b, r16 g' b g  d'8 d, |
        %10
-       r16 d,16( fis d  a' b cis a  d b d b 
+       r16 d,16 fis d  a' b cis a  d b d b 
        fis' g a fis |
-       )fis16 g,( b g  d' e fis d  )g8-. g,-. r16 cis( e cis |
-       )fis8-. fis,-. \stemdown r16 b( d b  )e8-. e,-. 
+       fis16 g, b g  d' e fis d  g8 g, r16 cis e cis |
+       fis8 fis, \stemdown r16 b d b  e e,
        r16 a cis a |
        \stemboth
        d e fis d  g fis e d  cis! a b cis 
index cfcfda7bb910924ee7099f2960c8853609941267..fe8a8cb76f669f07013e7f3f53f703fcc11e0c24 100644 (file)
@@ -47,9 +47,9 @@ upper = \context Staff \notes\relative c
        cis bes' g e a g |
        f d f a f a |
        d a d f d f |
-       b ( f e d c b |
+       b  f e d c b |
        %10
-       a gis fis )e d' b |
+       a gis fis e d' b |
        < 
                {
                        \stemup 
@@ -61,8 +61,8 @@ upper = \context Staff \notes\relative c
                \context Voice=ii { \stemdown a4 r r | a4 r r }
        > |
        \stemboth 
-       a'8( es d c bes a |
-       g fis e! )d c' a |
+       a'8 es d c bes a |
+       g fis e! d c' a |
        %15
        bes8-\mordent d8 bes g g'4 |
        r8 d c bes a-\prall g |
index 66d30cfafa6225fdf7c468fec1f1edf178d74e69..c0ad2ad5a7a1ed93f186612bf684d7f2b1631443 100644 (file)
@@ -51,7 +51,10 @@ global = \notes {
   \property StaffGroup.timeSignatureStyle = "old"
   \time 4/4;
   \tempo 4=100;
+  \repeat "volta" 2 {
   \skip 1*31;
+  }
+  \repeat "volta" 2 {
   \property StaffGroup.timeSignatureStyle = "1"
   \time 3/2;
   \tempo 2=140;
@@ -59,6 +62,14 @@ global = \notes {
   \property StaffGroup.timeSignatureStyle = "old"
   \time 4/4;
   \tempo 4=100;
+  s1
+  }
+  \repeat "volta" 2 {
+  \skip 1*12;
+  \cadenzaOn
+  s\breve
+  \cadenzaOff 
+  }
 }
 
 vi1=\context Staff = vi1 <
@@ -67,6 +78,7 @@ vi1=\context Staff = vi1 <
 \property Staff.instrument = "Violin 1"
 \property Staff.midiInstrument = "recorder" % The default midi violin is terrible
 
+  \repeat "volta"  2 {
   d8 d d d d4 a16 b c a |
   b8 g  g g16 a b8 g  g g16 a | 
   b8 g  g a16 b c4 b |
@@ -98,8 +110,9 @@ vi1=\context Staff = vi1 <
   r8 g g g16 f e4 d |
   r8 d16 a  b8 b16 c a2 |
   b1 | 
-  
-  \repeat "semi" 2 {
+  }
+
+  \repeat "volta" 2 {
   r4 d d d d d |
   e1. |
   r4 c c c c c |
@@ -115,10 +128,10 @@ vi1=\context Staff = vi1 <
   a4 c8 b a4 b8 c f,4 g8 a |
   d,4 g g g g g |
   a d,8 c b4 c8 d a2 |
+  b1 |
   }
 
-  \repeat "semi" 2 {
-  b1 |
+  \repeat "volta" 2 {
   d8 d d d d4 a16 b c a |
   b8 g  g g16 a b8 g  g g16 a | 
   b8 g  c2 b4 |
@@ -141,6 +154,7 @@ vi2=\context Staff = vi2 <
 \property Staff.instrument = "Violin 2"
 \property Staff.midiInstrument = "recorder" % The default midi violin is terrible
 
+  \repeat "volta"  2 {  
   r1 | r | r | 
   d8 d d d d4 a16 b c a |
   b8 g  g g16 a b8 g  g g16 a | 
@@ -170,8 +184,9 @@ vi2=\context Staff = vi2 <
   e4 d r8 c16 g  b8 b16 c |
   a4 g2 fis4 |
   g1 |
+  }
 
-  \repeat "semi" 2 {
+  \repeat "volta" 2 {
   r1. |
   r4 g'8 f e4 f8 g c,4 d8 e |
   a,1. |
@@ -187,10 +202,10 @@ vi2=\context Staff = vi2 <
   c,4 a a a a a |
   b d8 c b4 c8 d d,4 e |
   fis2 g fis! |
+  g1 |
   }
 
-  \repeat "semi" 2 {
-  g1 |
+  \repeat "volta" 2 {
   r1 | r1 |
   g'8 g g g g4 d16 e f d |
   e8 c  c c16 d e8 g,  g g16 a |
@@ -215,6 +230,7 @@ bc=\context Staff = bc <
 \property Staff.midiInstrument = "bassoon" % The default midi violin is terrible
 
 
+  \repeat "volta"  2 {  
   G2 d^"4 3" | G1 |
   g2 c4 G | d1^"3 4 3" |
   G1 | g2 c4 G |
@@ -231,8 +247,9 @@ bc=\context Staff = bc <
   G1^"3 4 3" | c4 B c g |
   c B c G | d1^"3 4 3" |
   G1 |
+  }
 
-  \repeat "semi" 2 {
+  \repeat "volta" 2 {
   g1. | c |
   f | d^"\\textsharp" |
   g | c |
@@ -241,10 +258,10 @@ bc=\context Staff = bc <
   d^"\\textsharp" | e |
   f | g1 B2 |
   d1.^"3 4 3" |
+  G1 |
   }
 
-  \repeat "semi"  2 {
-  G1 |
+  \repeat "volta"  2 {
   g2 fis | g G |
   g1^"3 4 3" | c |
   G^"3 4 3" | c2 G |
index de341d58cecf191f8b5544cae8973d3903cd2f70..48b92431a6216d22b04fdb396dcfe1721d3cc794 100644 (file)
                (list 'verticalDirection dir? 'direction)
                )
        ))
-  
+
+(define generic-script-properties
+  (cons "Script" (list
+                 (list 'articulationScriptVerticalDirection dir? 'direction)
+                 (list 'articulationScriptPadding number? 'padding)
+
+                 ))
+  )
+
+
+
 (define generic-text-properties
   (cons "Text_item" (list
                     (list 'textStyle string? 'style)
                     (list 'textScriptPadding number? 'padding)
+                    (list 'textVerticalAlignment dir? 'self-alignment-Y)
+                    (list 'textHorizontalAlignment dir? 'self-alignment-X)
                     )
        ))
 
+(define generic-crescendo-properties
+  (cons "Crescendo" (list
+                    (list 'dynamicDirection dir? 'direction)
+                    (list 'verticalDirection dir? 'direction)
+                    (list 'dynamicPadding number? 'padding) 
+                    )))
+  
 (define generic-bar-properties
   (cons "Staff_bar" (list
                     (list 'barSize number? 'bar-size))
    generic-beam-properties
    generic-text-properties
    generic-note-column-properties
+   generic-crescendo-properties
    generic-All-properties
    ))
 
 (define generic-grace-properties generic-voice-properties)
 (define generic-staff-properties
   (list
+   generic-text-properties   
    generic-bar-properties
    generic-timesig-properties
    generic-clef-properties
    generic-All-properties      
    )
   )
+(define generic-grand-staff-properties
+  (list
+   generic-text-properties   
+   generic-bar-properties
+   ))
+
 
 (define generic-thread-properties
   (list generic-All-properties
index 791f27aaa70b6ff3676afe8fa543d4ca222b2cf9..93f9b5393789bb00b1897b662515477d44027791 100644 (file)
@@ -86,7 +86,6 @@ def read_texinfo_header (s):
 
        m = re.search( '@settitle (.*)\n', s)
        if m:
-               print 'title found! '
                header.title = m.group (1)
        m = re.search( '@author (.*)\n', s)
        if m: