]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.66 release/1.3.66
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 29 Jun 2000 19:49:13 +0000 (21:49 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 29 Jun 2000 19:49:13 +0000 (21:49 +0200)
==========

* Corrected text sizes in paper*.ly

1.3.65.

60 files changed:
CHANGES
Documentation/header.html.in
Documentation/regression-test.tely
NEWS
VERSION
input/test/accidental.ly [new file with mode: 0644]
input/test/dots.ly
input/test/font-body.ly
input/trip.ly
lily/afm.cc
lily/beam-engraver.cc
lily/beam.cc
lily/collision-engraver.cc
lily/collision.cc
lily/dot-column.cc
lily/dots.cc
lily/engraver.cc
lily/hara-kiri-group-spanner.cc
lily/hara-kiri-vertical-group-spanner.cc [deleted file]
lily/include/beam-engraver.hh [deleted file]
lily/include/beam.hh
lily/include/collision.hh
lily/include/dot-column.hh
lily/include/dots.hh
lily/include/dynamic-line-interface.hh [deleted file]
lily/include/engraver.hh
lily/include/key-def.hh [deleted file]
lily/include/newkey-def.hh [deleted file]
lily/include/note-column.hh
lily/include/note-heads-engraver.hh
lily/include/performer.hh
lily/include/rest-collision-engraver.hh [deleted file]
lily/include/rest-collision.hh
lily/include/rest-engraver.hh
lily/include/rhythmic-column-engraver.hh [deleted file]
lily/include/rhythmic-head.hh
lily/include/staff-info.hh [deleted file]
lily/local-key-engraver.cc
lily/newkey-def.cc [deleted file]
lily/note-column.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rest.cc
lily/rhythmic-column-engraver.cc
lily/rhythmic-head.cc
lily/spacing-engraver.cc
lily/spanner.cc
lily/staff-info.cc [deleted file]
lily/staff-margin-engraver.cc [deleted file]
lily/stem-engraver.cc
lily/stem.cc
ly/engraver.ly
ly/params.ly
make/out/lilypond.lsm
make/out/lilypond.spec
scm/generic-property.scm

diff --git a/CHANGES b/CHANGES
index f03c7398eeb3dec3a1651a93dcd40d5a78512292..8fa5208be214475d53fc96b0f8205415d058f8a3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,15 +1,23 @@
---- ../lilypond-1.3.65/CHANGES Mon Jun 26 23:22:49 2000
-++ b/CHANGES   Wed Jun 28 23:25:56 2000
-@@ -1,3 +1,9 @@
 1.3.65.mb1
 ==========
 
 * Corrected text sizes in paper*.ly
 
 
- 1.3.64.uu1
- ==========
- 1.3.65.jcn2
+1.3.65.uu1
+==========
+
+* Dots, Collision, Rest_collision removed as separate Score_element type.
+
+* Stem and Note_column accept only one rest.
+
+* Use offset callback in Stem to resolve rest/beam collisions.
+
+* Put the value of new  local key signature (accidentals) back into a property.
+
+* Set molecule-callback for notename item.
+
+1.3.65.jcn2
 ===========
 
 * Added some comments to new slur code.
 * Removed some ugly interstaff slur code, interstaff slurs at line-break
   are still broken.
 
-1.3.65.jcn1
-===========
-
-* Bugfix: 16th beams are also beams.
+* Slur bugfix: 16th beams are also beams.
 
-* Patches from hw
 
-1.3.64.uu1
-==========
+1.3.65
+======
 
 * Bugfix: translate volta spanner at start of line.
 
@@ -845,7 +849,7 @@ Side_position_interface, Score_element, Item and Spanner
   generic-property.scm.  Similar fixes for Stem, Tie, etc.
 
 * Added a Text_engraver to GraceContext.  Maybe it was removed on
-  purpose: scripst on grace notes seem broken, they appear on the
+  purpose: scripts on grace notes seem broken, they appear on the
   main note.
 
 * Bugfix: volume effect of (de)crescendi was sometimes wrong way round.
@@ -880,7 +884,7 @@ backend
 * Fixed dimensions (more x-y interchanges) of brace, bracket and
   volta-spanner.
 
-* Bit half-baken fix in to get similar vertical placement of orphaned vs.
+* Half-assed fix to get similar vertical placement of orphaned vs.
   line-spanned dynamic elements.
 
 * Added property bracketCollapseHeight: the minimal size of a staff bracket
@@ -1058,7 +1062,7 @@ into do_process_music.
 ===========
 
 * Lily now also performs crescendi and decrescendi in MIDI output:
-  Span_dynamic_performer (bit scrappy).
+  Span_dynamic_performer in a slightly crappy way.
 
 * Added preliminary support for crescendi/decrescendi other than `hairpins',
   eg: `cresc. poco `a poco -- -- --'
index 31c6699b8f1905bd4889162cdf2b4b37e8cea7f4..20bb08ced6531f4bb99c6ed97037b19a1955a935 100644 (file)
@@ -48,7 +48,8 @@ which substitutes some @AT_VARIABLES@ as well.
        <a href="@TOP@Documentation/out-www/index.html"><b>Documentation</b></a>
       </td></tr>
       <tr><td><font size=-1>
-       <a href="@TOP@Documentation/out-www/CHANGES.html">NEWS</a><br>
+       <a href="@TOP@Documentation/out-www/NEWS.html">NEWS</a><br>
+       <a href="@TOP@Documentation/out-www/CHANGES.html">Change Log</a><br>
        <a href="@TOP@Documentation/out-www/faq.html">FAQ</a><br>
        <a href="@TOP@Documentation/user/out-www/lilypond.html">User manual</a><br>
        <a href="@TOP@Documentation/out-www/regression-test.html">Features</a><br>
index 51cc4d1460f073d1d0fc635e655af67188bdf33c..60e4ba57a85c60fd49dfdbc960bc83479fd63294 100644 (file)
@@ -43,11 +43,17 @@ a column.  The dots go along as rests are shifted to avoid collisions.
 
 @mudelafile{dots.ly}
 
+Accidentals worki: the second note does not get a sharp. The third and
+fourth show forced and courtesy accidentals
+
+@mudelafile{accidental.ly}
+
 Multiple measure rests do not collide with barlines and clefs.  They
 are not expanded when you set @code{Score.skipBars}.  Although the
 multi-measure-rest is a Spanner, minimum distances are set to keep it
 colliding from barlines. 
 
+
 @mudelafile{multi-measure-rest.ly}
 
 If @code{Score.skipBars} is set,
@@ -130,7 +136,6 @@ not set.  Main note scripts don't end up on the grace note.
 
 @mudelafile{grace.ly}
 
-
 @section Beams, slurs and other spanners
 
 Beaming is generated automatically. Beams may cross bar lines. In that
diff --git a/NEWS b/NEWS
index b2027c3cb11282fc69f0eb30194f5180629d1139..27aaa061945cc91e595fe77d4858b0833fa689b8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,25 @@
 
-[todo]
+* Improved design and implementation: Complete rewrite of the
+internals: LilyPond is smaller, cleaner, more flexible, etc.
 
+ - More pervasive GUILE integration resulting in 
+
+ - Improved speed, with comparable memory footprint
+
+ - Improved robustness: Lily almost never crashes.
+
+* Piano pedal support
+
+* MIDI: dynamics, tempo changes
+
+* Typography: More elegant slurs, aligned dynamics, text crescendos,
+
+* Chordnames are now configurable in every respect
+
+* Included extensive glossary
+
+* Many bugfixes.
+
+* Finished ouverture Coriolan as full orchestral score example.
+
+* AsciiScript [check if broken, decide wether to keep]
diff --git a/VERSION b/VERSION
index fe075e83c21db6dc736f3a59baba8e4991401c76..4e0c3d5167a16ede8460e00acd6c82b744c9df3c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=65
-MY_PATCH_LEVEL=mb1
+PATCH_LEVEL=66
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/accidental.ly b/input/test/accidental.ly
new file mode 100644 (file)
index 0000000..89aafb1
--- /dev/null
@@ -0,0 +1,8 @@
+
+foo = \notes\relative c''   { cis4 cis cis! cis? }
+\score {
+
+  <\foo 
+       \context NoteNames \foo
+>
+}
index fca6280b39c57f815fa114107def6d64602d4394..b21d25ae5cbbae834ac18577883309eb519b020f 100644 (file)
@@ -1,7 +1,8 @@
 \score { 
-  \context Voice \notes\relative c {
+  \context Voice \notes\relative c'' {
     \time 6/8;
-       d''4. b  <b4. c d e>  <f g a b>
+       d4. g,,
+       <b''4. c d e>  <f g a b>
        <g b d> <c, g' d' a'>
        
        
@@ -14,4 +15,4 @@
   }
   \paper { }  
   \midi { }
-}
\ No newline at end of file
+}
index 9349d53ab4b24b6f0e57880baf6dbbdd5bc84bd5..6b5258632498613bf421fd3596b8724f013bfd54 100644 (file)
@@ -43,7 +43,7 @@ c\longa*1/4 c\breve*1/2 c1 c2 c4 c8
                        \property Voice . noteHeadStyle = #'cross
                                                 f4^"4"
                                                  g4^"5"
-                       \property Voice . noteHeadStyle = ""
+                       \property Voice . noteHeadStyle = ##f
                        % Music to the Martians!
                        < bes4^"6" e_"7" c_"8" >
                        a^"0"_"9"
index 70ff8a02976048788f845d2498cc09f6a5d08c86..5ca69f53eba20631e04957f9ddac3522f9b7d12b 100644 (file)
@@ -7,12 +7,10 @@
 %{
 
 This file tests as much features of lily as possible. If there are any
-basic faults in , this file will not run correctly.
+basic faults in lily, this file will not run correctly.
 
 TODO:
 
-* add tuplets
-
 * repeats.
 
 * tremolo
index 1f1d22f1dbfde2f059603aeaffbc7c3e463f36f5..9f1f8045f5d4e7bb6567d38e59b89efa464d14b3 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  afm2.cc --  implement Adobe_font_metric
+  afm.cc --  implement Adobe_font_metric
   
   source file of the Flower Library
   
index 4800564c77b664dfd3f1a82eea9485e7d87530f4..c037c00923be70e8c641466f7b2595db769b69de 100644 (file)
@@ -7,13 +7,46 @@
   
  */
 #include "engraver-group-engraver.hh"
-#include "beam-engraver.hh"
+#include "engraver.hh"
 #include "musical-request.hh"
 #include "beam.hh"
 #include "stem.hh"
 #include "warn.hh"
 #include "beaming.hh"
 #include "score-engraver.hh"
+#include "rest.hh"
+#include "drul-array.hh"
+
+class Beam_engraver : public Engraver
+{
+  Drul_array<Span_req*> reqs_drul_;
+
+  Beam *finished_beam_p_;
+  Beam *beam_p_;
+  Span_req * prev_start_req_;
+
+  Beaming_info_list * beam_info_p_;
+  Beaming_info_list * finished_beam_info_p_;  
+
+  /// location  within measure where beam started.
+  Moment beam_start_location_;
+
+  /// moment (global time) where beam started.
+  Moment beam_start_mom_;
+  
+  void typeset_beam ();
+protected:
+  virtual void do_pre_move_processing ();
+  virtual void do_post_move_processing ();
+  virtual void do_removal_processing ();
+  virtual void acknowledge_element (Score_element_info);
+  virtual bool do_try_music (Music*);
+  virtual void do_process_music ();
+public:
+  Beam_engraver ();
+  VIRTUAL_COPY_CONS (Translator);
+};
+
 
 Beam_engraver::Beam_engraver ()
 {
@@ -150,48 +183,54 @@ Beam_engraver::acknowledge_element (Score_element_info info)
 {
   if (beam_p_)
     {
-      Stem* stem_l = dynamic_cast<Stem *> (info.elem_l_);
-      if (!stem_l || stem_l->beam_l ())
-       return;
+      if (Rest* r = dynamic_cast<Rest* > (info.elem_l_))
+       {
+         r->add_offset_callback (Beam::rest_collision_callback, Y_AXIS);
+       }
+      else if (Stem* stem_l = dynamic_cast<Stem *> (info.elem_l_))
+       {
+         if (stem_l->beam_l ())
+           return;
 
 
-      bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
+         bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
 
-      SCM wg =get_property ("weAreGraceContext");
-      bool wgb= to_boolean (wg);
+         SCM wg =get_property ("weAreGraceContext");
+         bool wgb= to_boolean (wg);
 
-      if (wgb!= stem_grace)
-       return;
+         if (wgb!= stem_grace)
+           return;
 
-      Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
-      if (!rhythmic_req)
-       {
-         String s = _ ("stem must have Rhythmic structure");
-         if (info.req_l_)
-           info.req_l_->warning (s);
-         else
-           ::warning (s);
+         Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
+         if (!rhythmic_req)
+           {
+             String s = _ ("stem must have Rhythmic structure");
+             if (info.req_l_)
+               info.req_l_->warning (s);
+             else
+               ::warning (s);
          
-         return;
+             return;
+           }
+
+         if (rhythmic_req->duration_.durlog_i_<= 2)
+           {
+             rhythmic_req->warning (_ ("stem doesn't fit in beam"));
+             prev_start_req_->warning (_ ("beam was started here"));
+             /*
+               don't return, since
+
+               [r4 c8] can just as well be modern notation.
+             */
+           }
+
+         stem_l->set_elt_property ("duration-log",
+                                   gh_int2scm (rhythmic_req->duration_.durlog_i_));
+         Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
+         beam_info_p_->add_stem (stem_location,
+                                 (rhythmic_req->duration_.durlog_i_ - 2) >? 1);
+         beam_p_->add_stem (stem_l);
        }
-      
-      if (rhythmic_req->duration_.durlog_i_<= 2)
-       {
-         rhythmic_req->warning (_ ("stem doesn't fit in beam"));
-         prev_start_req_->warning (_ ("beam was started here"));
-         /*
-           don't return, since
-
-           [r4 c8] can just as well be modern notation.
-          */
-       }
-
-      stem_l->set_elt_property ("duration-log",
-                               gh_int2scm (rhythmic_req->duration_.durlog_i_));
-      Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
-      beam_info_p_->add_stem (stem_location,
-                             (rhythmic_req->duration_.durlog_i_ - 2) >? 1);
-      beam_p_->add_stem (stem_l);
     }
 }
 
index 322655fe7417e077554200041baf7808fa436d27..5b50831fca15d6a80e39da9839420cd8e0edc6be 100644 (file)
@@ -845,3 +845,69 @@ Beam::last_visible_stem () const
     }
   return 0;
 }
+
+
+/*
+  [TODO]
+  handle rest under beam (do_post: beams are calculated now)
+  what about combination of collisions and rest under beam.
+
+  Should lookup
+    
+    rest -> stem -> beam -> interpolate_y_position ()
+*/
+Real
+Beam::rest_collision_callback (Score_element const *rest, Axis a )
+{
+  assert (a == Y_AXIS);
+
+  Score_element * st = unsmob_element (rest->get_elt_pointer ("stem"));
+  Stem * stem  = dynamic_cast<Stem*> (st);
+  if (!stem)
+    return 0.0;
+  Beam * beam = dynamic_cast<Beam*> (unsmob_element (stem->get_elt_pointer ("beam"))); 
+  if (!beam || !beam->visible_stem_count ())
+    return 0.0;
+
+  // make callback for rest from this.
+  Real beam_dy = 0;
+  Real beam_y = 0;
+
+
+  // todo: make sure this calced already.
+  SCM s = beam->get_elt_property ("height");
+  if (gh_number_p (s))
+    beam_dy = gh_scm2double (s);
+  
+  s = beam->get_elt_property ("y-position");
+  if (gh_number_p (s))
+    beam_y = gh_scm2double (s);
+  
+  Real x0 = beam->first_visible_stem ()->relative_coordinate (0, X_AXIS);
+  Real dx = beam->last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
+  Real dydx = beam_dy && dx ? beam_dy/dx : 0;
+
+  Direction d = stem->get_direction ();
+  Real beamy = (stem->relative_coordinate (0, X_AXIS) - x0) * dydx + beam_y;
+
+  Staff_symbol_referencer_interface si (rest);
+
+  Real staff_space = si.staff_space ();      
+  Real rest_dim = rest->extent (Y_AXIS)[d]*2.0 / staff_space ;
+
+  Real minimum_dist
+    = gh_scm2double (rest->get_elt_property ("minimum-beam-collision-distance"));
+  Real dist =
+    minimum_dist +  -d  * (beamy - rest_dim) >? 0;
+
+  int stafflines = si.line_count ();
+
+  // move discretely by half spaces.
+  int discrete_dist = int (ceil (dist));
+
+  // move by whole spaces inside the staff.
+  if (discrete_dist < stafflines+1)
+    discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0);
+
+  return  (-d *  discrete_dist);
+}
index db736c8bb4bcd30db307306c8d211049a4dcc64c..f6980894139a931b963d065ad532ba84ca9acef9 100644 (file)
 #include "collision.hh"
 #include "dimension-cache.hh"
 #include "engraver.hh"
+#include "axis-group-interface.hh"
 
 /*
   collect Note_column, and as soon as there are 2 or more, put them in
   a collision object.  */
 class Collision_engraver : public Engraver {
-  Collision* col_p_;
+  Item * col_p_;
   Link_array<Note_column> note_column_l_arr_;
 
 protected:
@@ -35,11 +36,15 @@ Collision_engraver::process_acknowledged ()
     return ;
   if (!col_p_) 
     {
-      col_p_ = new Collision (get_property ("basicCollisionProperties"));
+      col_p_ = new Item (get_property ("basicCollisionProperties"));
+      Axis_group_interface (col_p_).set_interface ();
+      Axis_group_interface (col_p_).set_axes (X_AXIS, Y_AXIS);
+
       announce_element (Score_element_info (col_p_,0));
     }
+  
   for (int i=0; i< note_column_l_arr_.size (); i++)
-    col_p_->add_column (note_column_l_arr_[i]);
+    Collision (col_p_).add_column (note_column_l_arr_[i]);
 }
 
 void
index 4807e47b7adae1a4989262ea8cdfe7d30ad0d36c..01cb443dd5f98346cff51a25300d94e213b33e53 100644 (file)
 #include "note-head.hh"
 #include "paper-def.hh"
 #include "axis-group-interface.hh"
-
-
-Collision::Collision(SCM s )
-  : Item (s)
-{
-  Axis_group_interface (this).set_interface ();
-  Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
-}
+#include "item.hh"
 
 void
 Collision::add_column (Note_column* ncol_l)
 {
-  Axis_group_interface (this).add_element (ncol_l);
-  add_dependency (ncol_l);
+  ncol_l->add_offset_callback (force_shift_callback, X_AXIS);
+  Axis_group_interface (elt_l_).add_element (ncol_l);
+  elt_l_->add_dependency (ncol_l);
 }
 
-GLUE_SCORE_ELEMENT(Collision,before_line_breaking);
-SCM
-Collision::member_before_line_breaking ()
+Real
+Collision::force_shift_callback (Score_element const * c, Axis a)
 {
-  do_shifts();
-      return SCM_UNDEFINED;
+  assert (a == X_AXIS);
+  
+  Score_element * me = c->parent_l (a);
+  /*
+    ugh. the way DONE is done is not clean
+   */
+  if (!unsmob_element (me->get_elt_pointer ("done")))
+    {
+      me->set_elt_pointer ("done", me->self_scm_);
+      do_shifts (me);
+    }
+  
+  return 0.0;
 }
 
 /*
   TODO: make callback of this.
  */
 void
-Collision::do_shifts()
+Collision::do_shifts(Score_element* me)
 {
-  SCM autos (automatic_shift ());
-  SCM hand (forced_shift ());
+  SCM autos (automatic_shift (me));
+  SCM hand (forced_shift (me));
+  
   Link_array<Score_element> done;
   
-  Real wid = paper_l ()->get_var ("collision_note_width");
+  Real wid = me->paper_l ()->get_var ("collision_note_width"); // elt prop
   for (; gh_pair_p (hand); hand =gh_cdr (hand))
     {
       Score_element * s = unsmob_element (gh_caar (hand));
@@ -70,13 +75,13 @@ Collision::do_shifts()
   This should be put into Scheme.  
   */
 SCM
-Collision::automatic_shift ()
+Collision::automatic_shift (Score_element *me)
 {
   Drul_array<Link_array<Note_column> > clash_groups;
   Drul_array<Array<int> > shifts;
   SCM  tups = SCM_EOL;
 
-  SCM s = get_elt_pointer ("elements");
+  SCM s = me->get_elt_pointer ("elements");
   for (; gh_pair_p (s); s = gh_cdr (s))
     {
       SCM car = gh_car (s);
@@ -124,7 +129,7 @@ Collision::automatic_shift ()
     {
       for (int i=0; i < clash_groups[d].size (); i++)
        {
-         Slice s(clash_groups[d][i]->head_positions_interval ());
+         Slice s(Note_column::head_positions_interval (clash_groups[d][i]));
          s[LEFT] --;
          s[RIGHT]++;
          extents[d].push (s);
@@ -162,15 +167,15 @@ Collision::automatic_shift ()
       Note_head * nu_l= cu_l->first_head();
       Note_head * nd_l = cd_l->first_head();
       
-      int downpos = cd_l->head_positions_interval ()[BIGGER];
-      int uppos = cu_l->head_positions_interval ()[SMALLER];      
+      int downpos = Note_column::head_positions_interval (cd_l)[BIGGER];
+      int uppos = Note_column::head_positions_interval (cu_l)[SMALLER];      
       
       bool merge  =
        downpos == uppos
        && nu_l->balltype_i () == nd_l->balltype_i ();
 
 
-      if (!to_boolean (get_elt_property ("merge-differently-dotted")))
+      if (!to_boolean (me->get_elt_property ("merge-differently-dotted")))
        merge = merge && nu_l->dot_count () == nd_l->dot_count ();
 
       /*
@@ -199,11 +204,11 @@ Collision::automatic_shift ()
 
 
 SCM
-Collision::forced_shift ()
+Collision::forced_shift (Score_element *me)
 {
   SCM tups = SCM_EOL;
   
-  SCM s = get_elt_pointer ("elements");
+  SCM s = me->get_elt_pointer ("elements");
   for (; gh_pair_p (s); s = gh_cdr (s))
     {
       Score_element * se = unsmob_element (gh_car (s));
@@ -220,3 +225,7 @@ Collision::forced_shift ()
 
 
 
+Collision::Collision (Score_element* c)
+{
+  elt_l_ = c;
+}
index f3d3fccf3fe255ed018c18359f6ea5487e7aaf37..ce660a24a287549ae3550f090d78dd96468d3b8c 100644 (file)
@@ -18,7 +18,7 @@
 
 // todo: dots and elements duplicate each other.
 void
-Dot_column::add_dots (Dots *d)
+Dot_column::add_dots (Item *d)
 {
   Pointer_group_interface gi (this, "dots");
   gi.add_element (d);
@@ -39,7 +39,7 @@ Dot_column::add_head (Rhythmic_head *r)
 
 
 int
-Dot_column::compare (Dots * const &d1, Dots * const &d2)
+Dot_column::compare (Item * const &d1, Item * const &d2)
 {
   Staff_symbol_referencer_interface s1(d1);
   Staff_symbol_referencer_interface s2(d2);  
@@ -79,7 +79,7 @@ GLUE_SCORE_ELEMENT(Dot_column,after_line_breaking);
 SCM
 Dot_column::member_after_line_breaking ()
 {
-  Link_array<Dots> dots = Pointer_group_interface__extract_elements (this, (Dots*)0 , "dots"); 
+  Link_array<Item> dots = Pointer_group_interface__extract_elements (this, (Item*)0 , "dots"); 
   dots.sort (Dot_column::compare);
   
   if (dots.size () < 2)
index edd64f01445d4d92eb1af5ec4821a530d7b1b68d..ccd29ae3b61a04843be48771f2eb31a665dac3d3 100644 (file)
@@ -7,35 +7,33 @@
 */
 
 #include "dots.hh"
+#include "item.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 
-Dots::Dots (SCM s)
-  : Item (s)
-{
-}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Dots,after_line_breaking);
 
-GLUE_SCORE_ELEMENT(Dots,after_line_breaking);
 SCM
-Dots::member_after_line_breaking ()
+Dots::after_line_breaking (SCM smob)
 {
-  SCM d= get_elt_property ("dot-count");
+  Item * p = dynamic_cast<Item*> (unsmob_element (smob));
+  
+  SCM d= p->get_elt_property ("dot-count");
   if (gh_number_p (d) && gh_scm2int (d))
     {
-      if (!Directional_element_interface (this).get ())
-       Directional_element_interface (this).set (UP);
+      if (!Directional_element_interface (p).get ())
+       Directional_element_interface (p).set (UP);
 
-      Staff_symbol_referencer_interface si (this);
-      int p = int (si.position_f ());
-      if (!(p % 2))
-       si.set_position (p  + Directional_element_interface (this).get ());
+      Staff_symbol_referencer_interface si (p);
+      int pos = int (si.position_f ());
+      if (!(pos % 2))
+       si.set_position (pos  + Directional_element_interface (p).get ());
     }
 
-    return SCM_UNDEFINED;
-
+  return SCM_UNDEFINED;
 }
 
 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Dots,brew_molecule);
index 49e8dd82597d414f6228d3eedb3958e087a0dc93..7ef5dda44f2edc40560e39078272707ab2b5fb34 100644 (file)
@@ -28,7 +28,7 @@ Engraver::announce_element (Score_element_info i)
     i.origin_trans_l_ = this;
   daddy_grav_l()->announce_element (i);
 }
-
 void
 Engraver::typeset_element (Score_element*p)
 {
index 0094a018ed9083f2c223d96921d04ccd03bb39c4..3161032716697aba99f4b6980d71030a37b47919 100644 (file)
@@ -33,9 +33,6 @@ SCM
 Hara_kiri_group_spanner::member_after_line_breaking ()
 {
   SCM worth = get_elt_pointer ("items-worth-living");
-  /*
-    worth == self_scm  is a stupid way to signal that we're done.
-   */
   if (gh_pair_p (worth))
     return SCM_UNDEFINED;
 
diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lily/include/beam-engraver.hh b/lily/include/beam-engraver.hh
deleted file mode 100644 (file)
index 9393529..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*   
-  beam-engraver.hh -- declare Beam_engraver
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef BEAM_ENGRAVER_HH
-#define BEAM_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "drul-array.hh"
-
-class Beam_engraver : public Engraver {
-  Drul_array<Span_req*> reqs_drul_;
-
-  Beam *finished_beam_p_;
-  Beam *beam_p_;
-  Span_req * prev_start_req_;
-
-  Beaming_info_list * beam_info_p_;
-  Beaming_info_list * finished_beam_info_p_;  
-
-  /// location  within measure where beam started.
-  Moment beam_start_location_;
-
-  /// moment (global time) where beam started.
-  Moment beam_start_mom_;
-  
-  void typeset_beam ();
-protected:
-  virtual void do_pre_move_processing ();
-  virtual void do_post_move_processing ();
-  virtual void do_removal_processing ();
-  virtual void acknowledge_element (Score_element_info);
-  virtual bool do_try_music (Music*);
-  virtual void do_process_music ();
-public:
-  Beam_engraver ();
-  VIRTUAL_COPY_CONS (Translator);
-};
-
-#endif /* BEAM_ENGRAVER_HH */
-
index d14801e370a24fc9c0fdcc6266761e40c74ea014..9a85134d641b1f1795c17888365f0536f5ca24f2 100644 (file)
@@ -35,7 +35,7 @@ public:
   int visible_stem_count () const;
   Stem* first_visible_stem () const;
   Stem* last_visible_stem () const;
-
+  static Real rest_collision_callback (Score_element const*,Axis);
   Beam (SCM);
   void add_stem (Stem*);
   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
index e1297545da24326e47ed29099e664ed146522557..6f7ffbb4711be42f89158d5d09d9dcc988f3061a 100644 (file)
@@ -9,8 +9,9 @@
 
 #ifndef COLLISION_HH
 #define COLLISION_HH
+
 #include "lily-proto.hh"
-#include "item.hh"
+#include "lily-guile.hh"
 
 
 /**
   Read and removed from elements.
   
 */
-class Collision : public Item
+class Collision                        // interface
 {
 public:
-  SCM automatic_shift ();
-  SCM forced_shift ();
-  void do_shifts ();  
-  SCM member_before_line_breaking ();
-  static SCM before_line_breaking (SCM);
+  Score_element*  elt_l_;
+  static SCM automatic_shift (Score_element*);
+  static SCM forced_shift (Score_element*);
+  static Real force_shift_callback (Score_element const*, Axis);
+  static void do_shifts (Score_element*);
 
-    
   void add_column (Note_column*ncol_l);
-  Collision(SCM);
+  Collision(Score_element*);
 };
 #endif // COLLISION_HH
index c91d05d3d45089830abd5d1e88f7607b0af425cd..0a71a1466d580c83e0141b9e16faeef55ca14e8e 100644 (file)
@@ -18,8 +18,8 @@
  */
 class Dot_column : public Item
 {
-  static int compare (Dots * const&,Dots * const&);
-  void add_dots (Dots*);
+  static int compare (Item * const&,Item * const&);
+  void add_dots (Item*);
 public:
   VIRTUAL_COPY_CONS (Score_element);
   void add_head (Rhythmic_head*);
index f816cc2a247d49f649c950623f9ddb39a30cdabf..3333cd26b78d4e26fa36f9e14661391bd0ed55dd 100644 (file)
@@ -10,7 +10,8 @@
 #ifndef DOTS_HH
 #define DOTS_HH
 
-#include "item.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
 
 
 /**
 
   
   */
-class Dots :  public Item
+class Dots                     // interface
 {
 public:
-  SCM member_brew_molecule () const;
-  SCM member_after_line_breaking ();
   static SCM after_line_breaking (SCM);
   static SCM brew_molecule (SCM);
-
-  Dots (SCM);
 };
 
 #endif // DOTS_HH
diff --git a/lily/include/dynamic-line-interface.hh b/lily/include/dynamic-line-interface.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 2fb91ecbfb01d005e20435ce57924ea7c6d24e2e..2c3ef7afd6e344de5c50d2c800c2361bb6811f2d 100644 (file)
 #include "array.hh"
 #include "request.hh"
 #include "score-element-info.hh"
-#include "staff-info.hh"
 #include "translator.hh"
 
 
 /**
   a struct which processes requests, and creates the #Score_element#s.
-  It may use derived classes. Hungarian postfix: grav
-  
+  It may use derived classes. 
   */
 class Engraver : public virtual Translator {
     
diff --git a/lily/include/key-def.hh b/lily/include/key-def.hh
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lily/include/newkey-def.hh b/lily/include/newkey-def.hh
deleted file mode 100644 (file)
index e69de29..0000000
index c8cf7959e9f2bdd5158a9dfc104e51f1cdaae944..dc6d665f774ce275bd0fdc0d3957c72d2b042000 100644 (file)
 
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts) as a single entity.
+
+  UGR. Junkme.  refpoint should be the notehead, dir should come from stem.
+
 */
 class Note_column : public Item
 {
 public:
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
   static int shift_compare (Note_column *const &, Note_column*const&);
   
   /** The relative position of the "voice" containing this
@@ -30,15 +31,15 @@ public:
   Direction dir () const;
 
 
-  Interval_t<int> head_positions_interval() const;
-
+  static Slice head_positions_interval(Score_element* me) ;
+  static Direction static_dir (Score_element*);
   void translate_rests(int dy);
   Note_head * first_head ()const;
   Interval rest_dim ()const ;
   Note_column (SCM);
-  void set_stem (Stem*);
-  void set_dotcol (Dot_column*);
-  void add_head (Rhythmic_head*);
+  void set_stem (Score_element*);
+  void set_dotcol (Score_element*);
+  void add_head (Score_element*);
   bool rest_b () const;
 
   Stem *stem_l()const;
index 39eb3868fe1fbf927e0698dd3c41db1dfbc2618b..bbe8e0254f88ea8693d7b79a76f6e3e8c28f207c 100644 (file)
@@ -15,7 +15,7 @@
  */
 class Note_heads_engraver : public Engraver {
   Link_array<Note_head> note_p_arr_;
-  Link_array<Dots> dot_p_arr_;
+  Link_array<Item> dot_p_arr_;
   Link_array<Note_req> note_req_l_arr_;
   Moment note_end_mom_;
 public:
index 1b46084bb024c79b1beeb70421bf808afe6cb1d7..8cba9f6cba649ce14fa890f31490702fce1fb2f9 100644 (file)
@@ -12,7 +12,6 @@
 #include "array.hh"
 #include "request.hh"
 #include "score-element-info.hh"
-#include "staff-info.hh"
 #include "translator.hh"
 
 /**
diff --git a/lily/include/rest-collision-engraver.hh b/lily/include/rest-collision-engraver.hh
deleted file mode 100644 (file)
index c0de52b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  rest-collision-engraver.hh -- declare Rest_collision_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef REST_COLLISION_GRAV_HH
-#define REST_COLLISION_GRAV_HH
-
-#include "array.hh"
-#include "engraver.hh"
-
-class Rest_collision_engraver : public Engraver {
-  Rest_collision* rest_collision_p_;
-
-  Link_array<Note_column> note_column_l_arr_;
-protected:
-  virtual void acknowledge_element (Score_element_info);
-  virtual void process_acknowledged ();
-  virtual void do_pre_move_processing();
-public:
-  VIRTUAL_COPY_CONS(Translator);
-  Rest_collision_engraver();
-  
-};
-#endif // REST_COLLISION_GRAV_HH
index 10b8ac01c17aef4f625e4cfd733e602539550b5e..4eaddd45d73e1a52b23a112f79983b63c5b9b535 100644 (file)
 #define REST_COLLISION_HH
 
 #include "lily-proto.hh"
-#include "item.hh"
+#include "lily-guile.hh"
 
-class Rest_collision : public Item {
+class Rest_collision           // interface
+{
 public:
+  Score_element *elt_l_;
+  
   void add_column (Note_column*);
-  Interval rest_dim () const;
-    
-  Rest_collision(SCM);
+  Rest_collision(Score_element*);
+  void set_interface ();
 
-  SCM member_after_line_breaking ();
-  static SCM after_line_breaking (SCM);
+  static Real force_shift_callback (Score_element const*, Axis);
+  static SCM do_shift (Score_element*,SCM);
 };
 #endif // REST_COLLISION_HH
index 54d5967480f15343ab974d603c8a0c425fc58dde..af5715269d34d376704cad0f7644eba1155c4574 100644 (file)
@@ -15,7 +15,7 @@
 class Rest_engraver : public Engraver
 {
   Rest_req *rest_req_l_;
-  Dots * dot_p_;
+  Item * dot_p_;
   Rest * rest_p_;
 protected:
   virtual bool do_try_music (Music *);
diff --git a/lily/include/rhythmic-column-engraver.hh b/lily/include/rhythmic-column-engraver.hh
deleted file mode 100644 (file)
index f67c6bf..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  rhythmic-column-engraver.hh -- declare Rhythmic_column_engraver
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef RHYTHMIC_COLUMN_GRAV_HH
-#define RHYTHMIC_COLUMN_GRAV_HH
-
-#include "engraver.hh"
-#include "parray.hh"
-
-class Rhythmic_column_engraver :public Engraver {
-  Link_array<Rhythmic_head> rhead_l_arr_;
-  Link_array<Slur> grace_slur_endings_;
-  Stem * stem_l_;
-  Note_column *ncol_p_;
-  Dot_column *dotcol_l_;
-
-protected:
-  VIRTUAL_COPY_CONS(Translator);
-  virtual void acknowledge_element (Score_element_info);
-  virtual void process_acknowledged ();
-  virtual void do_pre_move_processing();
-  virtual void do_post_move_processing();
-public:
-  Rhythmic_column_engraver();
-  
-};
-#endif // RHYTHMIC_COLUMN_GRAV_HH
-
-
-
index 8145bd911827b9611d598fb4d520ecc73007145f..33e7bb279b6baa5e8c688b168201eb32c79f6868 100644 (file)
@@ -30,9 +30,9 @@ public:
   VIRTUAL_COPY_CONS(Rhythmic_head);
   int balltype_i () const;
 
-  void add_dots (Dots *);
+  void add_dots (Item *);
   Stem * stem_l () const;
-  Dots * dots_l () const;
+  Item * dots_l () const;
   int dot_count () const;
 
   SCM member_after_line_breaking ();
diff --git a/lily/include/staff-info.hh b/lily/include/staff-info.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 58ebc975d9211c08286a625f4e1db167d3c547e3..55dd16c0b4fbf0f9d99fa27b161be53e377dee0d 100644 (file)
@@ -139,6 +139,9 @@ Local_key_engraver::process_acknowledged ()
         }
     }
 
+  
+  
+  daddy_trans_l_->set_property ("localKeySignature",  localsig);
   /*
     UGH ! 
    */
diff --git a/lily/newkey-def.cc b/lily/newkey-def.cc
deleted file mode 100644 (file)
index e69de29..0000000
index db93c4370bd36a02172fef096482da15745cee8a..613a9bae8254dde8bf1387cb0d11ba65b9092ead 100644 (file)
@@ -8,12 +8,8 @@
 #include <math.h>              // ceil
 
 #include "axis-group-interface.hh"
-#include "dot-column.hh"
 #include "note-column.hh"
-#include "beam.hh"
-#include "note-head.hh"
 #include "stem.hh"
-#include "rest.hh"
 #include "debug.hh"
 #include "paper-def.hh"
 #include "group-interface.hh"
@@ -22,9 +18,7 @@
 bool
 Note_column::rest_b () const
 {
-  SCM r = get_elt_pointer ("rests");
-
-  return gh_pair_p (r);
+  return unsmob_element (get_elt_pointer ("rest"));
 }
 
 int
@@ -41,7 +35,6 @@ Note_column::shift_compare (Note_column *const &p1, Note_column*const&p2)
 Note_column::Note_column( SCM s)
   : Item (s)
 {
-  set_elt_pointer ("rests", SCM_EOL);
   set_elt_pointer ("note-heads", SCM_EOL);  
   Axis_group_interface (this).set_interface ();
   Axis_group_interface (this).set_axes (X_AXIS, Y_AXIS);
@@ -53,18 +46,17 @@ Note_column::stem_l () const
 {
   SCM s = get_elt_pointer ("stem");
   return dynamic_cast<Stem*> (unsmob_element (s));
-
 }
 
   
 Slice
-Note_column::head_positions_interval() const
+Note_column::head_positions_interval(Score_element *me)
 {
   Slice  iv;
 
   iv.set_empty ();
 
-  SCM h = get_elt_pointer ("note-heads");
+  SCM h = me->get_elt_pointer ("note-heads");
   for (; gh_pair_p (h); h = gh_cdr (h))
     {
       Score_element *se = unsmob_element (gh_car (h));
@@ -77,20 +69,27 @@ Note_column::head_positions_interval() const
 }
 
 Direction
-Note_column::dir () const
+Note_column::static_dir (Score_element*  me)
 {
-  if (stem_l ())
-    return stem_l ()->get_direction ();
-  else if (gh_pair_p (get_elt_pointer ("note-heads")))
-    return (Direction)sign (head_positions_interval().center ());
+  Score_element *stem = unsmob_element (me->get_elt_pointer ("stem"));
+  if (dynamic_cast<Stem*> (stem))
+    return dynamic_cast<Stem*> (stem)->get_direction ();
+  else if (gh_pair_p (me->get_elt_pointer ("note-heads")))
+    return (Direction)sign (head_positions_interval (me).center ());
 
   programming_error ("Note column without heads and stem!");
   return CENTER;
 }
 
 
+Direction
+Note_column::dir () const
+{
+  return static_dir ((Score_element*) this);
+}
+
 void
-Note_column::set_stem (Stem * stem_l)
+Note_column::set_stem (Score_element * stem_l)
 {
   set_elt_pointer ("stem", stem_l->self_scm_);
 
@@ -98,20 +97,17 @@ Note_column::set_stem (Stem * stem_l)
   Axis_group_interface (this).add_element (stem_l);
 }
 
-
-
 void
-Note_column::add_head (Rhythmic_head *h)
+Note_column::add_head (Score_element *h)
 {
-  if (Rest*r=dynamic_cast<Rest *> (h))
+  if (to_boolean (h->get_elt_property ("rest-interface")))
     {
-      Pointer_group_interface gi (this, "rests");
-      gi.add_element (h);
+      this->set_elt_pointer ("rest", h->self_scm_);
     }
-  if (Note_head *nh=dynamic_cast<Note_head *> (h))
+  else if (to_boolean (h->get_elt_property ("note-head-interface")))
     {
       Pointer_group_interface gi (this, "note-heads");
-      gi.add_element (nh);
+      gi.add_element (h);
     }
   Axis_group_interface (this).add_element (h);
 }
@@ -122,106 +118,28 @@ Note_column::add_head (Rhythmic_head *h)
 void
 Note_column::translate_rests (int dy_i)
 {
-  SCM s = get_elt_pointer ("rests");
-  for (; gh_pair_p (s); s = gh_cdr (s))
+  Score_element * r = unsmob_element (get_elt_pointer ("rest"));
+  if (r)
     {
-      Score_element * se = unsmob_element (gh_car (s));
-      Staff_symbol_referencer_interface si (se);
-
-      se->translate_axis (dy_i * si.staff_space ()/2.0, Y_AXIS);
+      Staff_symbol_referencer_interface si (r);
+      r->translate_axis (dy_i * si.staff_space ()/2.0, Y_AXIS);
     }
 }
 
 
 void
-Note_column::set_dotcol (Dot_column *d)
+Note_column::set_dotcol (Score_element *d)
 {
   Axis_group_interface (this).add_element (d);
 }
 
-/*
-  [TODO]
-  handle rest under beam (do_post: beams are calculated now)
-  what about combination of collisions and rest under beam.
-
-  Should lookup
-    
-    rest -> stem -> beam -> interpolate_y_position ()
-*/
-
-GLUE_SCORE_ELEMENT(Note_column,after_line_breaking);
-SCM
-Note_column::member_after_line_breaking ()
-{
-  if (!stem_l () || !rest_b ())
-    return SCM_UNDEFINED;
-
-  Beam * b = stem_l ()->beam_l ();
-  if (!b || !b->visible_stem_count ())
-    return SCM_UNDEFINED;
-  
-  /* ugh. Should be done by beam.
-     (what? should be done --jcn)
-    scary too?: height is calculated during post_processing
-   */
-  Real beam_dy = 0;
-  Real beam_y = 0;
-
-  SCM s = b->get_elt_property ("height");
-  if (gh_number_p (s))
-    beam_dy = gh_scm2double (s);
-  
-  s = b->get_elt_property ("y-position");
-  if (gh_number_p (s))
-    beam_y = gh_scm2double (s);
-
-  
-  Real x0 = b->first_visible_stem ()->relative_coordinate (0, X_AXIS);
-  Real dx = b->last_visible_stem ()->relative_coordinate (0, X_AXIS) - x0;
-  Real dydx = beam_dy && dx ? beam_dy/dx : 0;
-
-  Direction d = stem_l ()->get_direction ();
-  Real beamy = (stem_l ()->relative_coordinate (0, X_AXIS) - x0) * dydx + beam_y;
-
-  s = get_elt_pointer ("rests");
-  Score_element * se = unsmob_element (gh_car (s));
-  Staff_symbol_referencer_interface si (se);
-
-  Real staff_space = si.staff_space ();      
-  Real rest_dim = extent (Y_AXIS)[d]*2.0  /staff_space ;
-
-  Real minimum_dist
-    = paper_l ()->get_var ("restcollision_minimum_beamdist") ;
-  Real dist =
-    minimum_dist +  -d  * (beamy - rest_dim) >? 0;
-
-  int stafflines = si.line_count ();
-
-  // move discretely by half spaces.
-  int discrete_dist = int (ceil (dist ));
-
-  // move by whole spaces inside the staff.
-  if (discrete_dist < stafflines+1)
-    discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0);
-
-  translate_rests (-d *  discrete_dist);
-
-  return SCM_UNDEFINED;
-}
 
 
 Interval
 Note_column::rest_dim () const
 {
-  Interval restdim;
-  SCM s = get_elt_pointer ("rests");
-  for (; gh_pair_p (s); s = gh_cdr (s))
-    {
-      Score_element * sc = unsmob_element ( gh_car (s));
-      restdim.unite (sc->extent (Y_AXIS));
-    }
-  
-  return restdim;
+  Score_element * r = unsmob_element (get_elt_pointer ("rest"));
+  return r->extent (Y_AXIS);
 }
 
 Note_head*
index 4452ce905a9e5fad0e42da131457154410f86bb3..5c4e1b690578a8c0e3c8c62e529915da425ebd9e 100644 (file)
@@ -61,7 +61,7 @@ Note_head::member_before_line_breaking ()
   if (balltype_i () > 2)
     set_elt_property ("duration-log", gh_int2scm (2));
 
-  if (Dots *d = dots_l ())
+  if (Item *d = dots_l ())
     { // move into Rhythmic_head?
       Staff_symbol_referencer_interface si (d);
       Staff_symbol_referencer_interface me (this);      
index 067a3d3933d0c4f9c4ea959023648eabfda15fb5..c12f28df1144a663b816d967720882e2d140461a 100644 (file)
@@ -73,7 +73,7 @@ Note_heads_engraver::do_process_music()
 
       if (note_req_l->duration_.dots_i_)
        {
-         Dots * d = new Dots (get_property ("basicDotsProperties"));
+          Item * d = new Item (get_property ("basicDotsProperties"));
 
          Staff_symbol_referencer_interface sd (d);
          sd.set_interface ();
index d6e10628def18deb07a309dca2d4a24c1f372563..c46007a16f364dbc7f4c220efd0e28b6f3c15da0 100644 (file)
@@ -46,7 +46,7 @@ Note_name_engraver::do_process_music ()
     }
   if (s.length_i())
     {
-      Item * t = new Item (SCM_EOL);
+      Item * t = new Item (get_property ("basicNoteNameProperties"));
       t->set_elt_property ("text", ly_str02scm ( s.ch_C()));
       announce_element (Score_element_info (t, req_l_arr_[0]));
       texts_.push (t);
index 606dfe30d6e81bf136e0c716e66783b1cb3221c8..bea1a8cc1c7d879dafcd26e9359cd2828799a3e5 100644 (file)
@@ -8,11 +8,25 @@
 
 #include "debug.hh"
 #include "rest-collision.hh"
-#include "rest-collision-engraver.hh"
+#include "engraver.hh"
 #include "collision.hh"
 #include "note-column.hh"
 
 
+class Rest_collision_engraver : public Engraver
+{
+  Item* rest_collision_p_;
+
+  Link_array<Note_column> note_column_l_arr_;
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual void do_pre_move_processing();
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Rest_collision_engraver();
+  
+};
 
 ADD_THIS_TRANSLATOR(Rest_collision_engraver);
 
@@ -27,11 +41,11 @@ Rest_collision_engraver::process_acknowledged ()
   if (rest_collision_p_ || note_column_l_arr_.size () < 2)
     return;
 
-  rest_collision_p_ = new Rest_collision (get_property ("basicRestCollisionProperties"));
-  
+  rest_collision_p_ = new Item (get_property ("basicRestCollisionProperties"));
+  Rest_collision (rest_collision_p_).set_interface();
   announce_element (Score_element_info (rest_collision_p_, 0));
   for (int i=0; i< note_column_l_arr_.size (); i++)
-    rest_collision_p_->add_column (note_column_l_arr_[i]);
+    Rest_collision (rest_collision_p_).add_column (note_column_l_arr_[i]);
 }
 
 void
index a72e0504e30807a98188f432a72c7c813cde513c..69f1ff0eed4e832dfb3455b3e5d9e7c88bdac5f1 100644 (file)
@@ -7,32 +7,52 @@
 */
 #include <math.h>              // ceil.
 
-#include "beam.hh"
 #include "debug.hh"
 #include "rest-collision.hh"
 #include "note-column.hh"
 #include "stem.hh"
 #include "note-head.hh"
-#include "collision.hh"
 #include "paper-def.hh"
 #include "rest.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "duration.hh"
 
-void
-Rest_collision::add_column (Note_column *nc_l)
+Real
+Rest_collision::force_shift_callback (Score_element const*them, Axis a)
 {
-  add_dependency (nc_l);
-  Pointer_group_interface gi (this);  
-  if (nc_l->rest_b ())
-    gi.name_ = "rests";
-  else
-    gi.name_ = "notes";
+  assert (a == Y_AXIS);
+
+  Score_element * rc = unsmob_element (them->get_elt_pointer ("rest-collision"));
+
+  if (rc)
+    {
+      /*
+       Done: destruct pointers, so we do the shift only once.
+      */
+      SCM elts = rc->get_elt_pointer ("elements");
+      rc->set_elt_pointer ("elements", SCM_EOL);
+
+      do_shift (rc, elts);
+    }
   
-  gi.add_element (nc_l);
+  return 0.0;
 }
 
+void
+Rest_collision::add_column (Note_column *p)
+{
+  elt_l_->add_dependency (p);
+  Pointer_group_interface gi (elt_l_);  
+  gi.add_element (p);
+
+  p->add_offset_callback (&Rest_collision::force_shift_callback, Y_AXIS);
+  p->set_elt_pointer ("rest-collision", elt_l_->self_scm_);
+}
+
+/*
+  these 3 have to go, because they're unnecessary complications.
+ */
 static Duration
 to_duration (int type, int dots)
 {
@@ -42,6 +62,11 @@ to_duration (int type, int dots)
   return d;
 }
 
+/*
+  UGH
+
+  elt_l_ should be "duration" independent
+ */
 static Moment
 rhythmic_head2mom (Rhythmic_head* r)
 {
@@ -52,23 +77,32 @@ rhythmic_head2mom (Rhythmic_head* r)
   ugh
  */
 static Rhythmic_head*
-col2rhythmic_head (Note_column* c)
+col2rhythmic_head (Score_element* c)
 {
-  SCM s = c->get_elt_pointer ("rests");
-  assert (gh_pair_p (s));
-  Score_element* e = unsmob_element (gh_car (s));
-  return dynamic_cast<Rhythmic_head*> (e);
+  return dynamic_cast<Rhythmic_head*> (unsmob_element (c->get_elt_pointer ("rest")));
 }
 
-GLUE_SCORE_ELEMENT(Rest_collision,after_line_breaking);
 
+/*
+  TODO: fixme, fucks up if called twice on the same set of rests.
+ */
 SCM
-Rest_collision::member_after_line_breaking ()
+Rest_collision::do_shift (Score_element *me, SCM elts)
 {
-  Link_array<Note_column> rest_l_arr =
-    Pointer_group_interface__extract_elements (this, (Note_column*) 0, "rests");
-  Link_array<Note_column> ncol_l_arr =
-    Pointer_group_interface__extract_elements (this, (Note_column*) 0, "notes");
+  /*
+    ugh. -> score  elt type
+   */
+  Link_array<Note_column> rests;
+  Link_array<Note_column> notes;
+
+  for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element * e = unsmob_element (gh_car (s));
+      if (e && unsmob_element (e->get_elt_pointer ("rest")))
+       rests.push (dynamic_cast<Note_column*> (e));
+      else
+       notes.push (dynamic_cast<Note_column*> (e));
+    }
 
   
   /* 
@@ -81,21 +115,21 @@ Rest_collision::member_after_line_breaking ()
    */
 
   // no rests to collide
-  if (!rest_l_arr.size())
+  if (!rests.size())
     return SCM_UNDEFINED;
 
   // no partners to collide with
-  if (rest_l_arr.size() + ncol_l_arr.size () < 2)
+  if (rests.size() + notes.size () < 2)
     return SCM_UNDEFINED;
 
   // meisjes met meisjes
-  if (!ncol_l_arr.size()) 
+  if (!notes.size()) 
     {
-      Moment m = rhythmic_head2mom (col2rhythmic_head (rest_l_arr[0]));
+      Moment m = rhythmic_head2mom (col2rhythmic_head (rests[0]));
       int i = 1;
-      for (; i < rest_l_arr.size (); i++)
+      for (; i < rests.size (); i++)
        {
-         Moment me = rhythmic_head2mom (col2rhythmic_head (rest_l_arr[i]));
+         Moment me = rhythmic_head2mom (col2rhythmic_head (rests[i]));
          if (me != m)
            break;
        }
@@ -107,17 +141,17 @@ Rest_collision::member_after_line_breaking ()
        (urg: all 3 of them, currently).
        */
       int display_count;
-      SCM s = get_elt_property ("maximum-rest-count");
-      if (i == rest_l_arr.size ()
-         && gh_number_p (s) && gh_scm2int (s) < rest_l_arr.size ())
+      SCM s = me->get_elt_property ("maximum-rest-count");
+      if (i == rests.size ()
+         && gh_number_p (s) && gh_scm2int (s) < rests.size ())
        {
          display_count = gh_scm2int (s);
          for (; i > display_count; i--)
-           col2rhythmic_head (rest_l_arr[i-1])
+           col2rhythmic_head (rests[i-1])
              ->set_elt_property ("molecule-callback", SCM_BOOL_T);
        }
       else
-       display_count = rest_l_arr.size ();
+       display_count = rests.size ();
       
       /*
        UGH.  Should get dims from table.  Should have minimum dist.
@@ -125,47 +159,45 @@ Rest_collision::member_after_line_breaking ()
       int dy = display_count > 2 ? 6 : 4;
       if (display_count > 1)
        {
-         rest_l_arr[0]->translate_rests (dy);  
-         rest_l_arr[1]->translate_rests (-dy);
+         rests[0]->translate_rests (dy);       
+         rests[1]->translate_rests (-dy);
        }
     }
   // meisjes met jongetjes
   else 
     {
-      if (rest_l_arr.size () > 1)
+      if (rests.size () > 1)
        {
          warning (_("too many colliding rests"));
        }
-      if (ncol_l_arr.size () > 1)
+      if (notes.size () > 1)
        {
          warning (_("too many notes for rest collision"));
        }
-      Note_column * rcol = rest_l_arr[0];
+      Note_column * rcol = rests[0];
 
       // try to be opposite of noteheads. 
-      Direction dir = - ncol_l_arr[0]->dir();
+      Direction dir = - notes[0]->dir();
 
       Interval restdim = rcol->rest_dim ();
       if (restdim.empty_b ())
        return SCM_UNDEFINED;
       
       // staff ref'd?
-      Real staff_space = paper_l()->get_var ("interline");
+      Real staff_space = me->paper_l()->get_var ("interline");
 
        /* FIXME
-         staff_space =  rcol->rest_l_arr[0]->staff_space ();
+         staff_space =  rcol->rests[0]->staff_space ();
        */
-      Real half_staff_space_f = staff_space/2;
-      Real minimum_dist = paper_l ()->get_var ("restcollision_minimum_dist")
-       * half_staff_space_f;
+      Real minimum_dist = gh_scm2double (me->get_elt_property ("minimum-distance")) * staff_space;
       
       /*
        assumption: ref points are the same. 
        */
       Interval notedim;
-      for (int i = 0; i < ncol_l_arr.size(); i++) 
+      for (int i = 0; i < notes.size(); i++) 
        {
-         notedim.unite (ncol_l_arr[i]->extent (Y_AXIS));
+         notedim.unite (notes[i]->extent (Y_AXIS));
        }
 
       Interval inter (notedim);
@@ -176,8 +208,8 @@ Rest_collision::member_after_line_breaking ()
 
 
       // FIXME
-      //int stafflines = 5; // rcol->rest_l_arr[0]->line_count;
-      int stafflines = Staff_symbol_referencer_interface (this).line_count ();
+      //int stafflines = 5; // rcol->rests[0]->line_count;
+      int stafflines = Staff_symbol_referencer_interface (me).line_count ();
       // hurg?
       stafflines = stafflines != 0 ? stafflines : 5;
       
@@ -193,13 +225,15 @@ Rest_collision::member_after_line_breaking ()
   return SCM_UNDEFINED;
 }
 
-
-Rest_collision::Rest_collision(SCM s)
-  : Item (s)
+void
+Rest_collision::set_interface ()
 {
-  set_elt_pointer ("rests", SCM_EOL);
-  set_elt_pointer ("notes", SCM_EOL);
-  set_extent_callback (0, X_AXIS);
-  set_extent_callback (0, Y_AXIS);
+  elt_l_->set_extent_callback (0, X_AXIS);
+  elt_l_->set_extent_callback (0, Y_AXIS);
+  elt_l_->set_elt_pointer ("elements", SCM_EOL);
 }
 
+Rest_collision::Rest_collision (Score_element* c)
+{
+  elt_l_ = c;
+}
index aefefc453ad74eb089bf4244ed2e8577f4ce3d92..96f34bfe961eab776a46db7a0f52970f130870f4 100644 (file)
@@ -56,7 +56,7 @@ Rest_engraver::do_process_music ()
       
       if (rest_req_l_->duration_.dots_i_)
        {
-         dot_p_ = new Dots (get_property ("basicDotsProperties"));
+         dot_p_ = new Item (get_property ("basicDotsProperties"));
 
          Staff_symbol_referencer_interface si (dot_p_);
          si.set_interface ();
index 9d9385f567e878fcc70980d604e9cda897886f09..f76968aaa01d7f42a67efac6a0b34709c351c1fc 100644 (file)
@@ -24,8 +24,7 @@ Rest::member_after_line_breaking ()
       Staff_symbol_referencer_interface si (this);
       si.set_position (si.position_f () + 2);
     }
-  
-  Dots * d = dots_l ();
+  Item * d = dots_l ();
   if (d && balltype_i () > 4) // UGH.
     {
       /*
index ad0c6acbdd92790e7d79b34d8f06684b022d03ca..06a67569ccd2950c3ccee833e4d72e218aeafd2d 100644 (file)
@@ -8,13 +8,34 @@
 
 #include "dimension-cache.hh"
 #include "slur.hh"
-#include "rhythmic-column-engraver.hh"
+#include "engraver.hh"
 #include "note-head.hh"
 #include "stem.hh"
 #include "note-column.hh"
 #include "dot-column.hh"
 #include "musical-request.hh"
 
+class Rhythmic_column_engraver :public Engraver
+{
+  Link_array<Rhythmic_head> rhead_l_arr_;
+  Link_array<Slur> grace_slur_endings_;
+  Stem * stem_l_;
+  Note_column *ncol_p_;
+  Dot_column *dotcol_l_;
+
+protected:
+  VIRTUAL_COPY_CONS(Translator);
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual void do_pre_move_processing();
+  virtual void do_post_move_processing();
+public:
+  Rhythmic_column_engraver();
+  
+};
+
+
+
 Rhythmic_column_engraver::Rhythmic_column_engraver()
 {
   stem_l_ =0;
index b6a83b6d438ca5a33b91d0ebaebff7874ba391f5..76a2d698a0c3c9147cea9ff09f5208d4858909b2 100644 (file)
 #include "staff-symbol-referencer.hh"
 
 
-Dots*
+Item*
 Rhythmic_head::dots_l () const
 {
   SCM s = get_elt_pointer ("dot");
-  return dynamic_cast<Dots*> (unsmob_element (s));
+  return dynamic_cast<Item*> (unsmob_element (s));
 }
 
 int
@@ -51,7 +51,7 @@ GLUE_SCORE_ELEMENT(Rhythmic_head,after_line_breaking);
 SCM
 Rhythmic_head::member_after_line_breaking ()
 {
-  if (Dots *d = dots_l ())
+  if (Item *d = dots_l ())
     {
       Staff_symbol_referencer_interface si (d);
       Staff_symbol_referencer_interface me (d);      
@@ -63,7 +63,7 @@ Rhythmic_head::member_after_line_breaking ()
 
 
 void
-Rhythmic_head::add_dots (Dots *dot_l)
+Rhythmic_head::add_dots (Item *dot_l)
 {
   set_elt_pointer ("dot", dot_l->self_scm_);
   dot_l->add_dependency (this);  
index 0f26e7ca16c17c2949835f847d1afb113f2e4a2f..a61b79a2235a2f94d2388551659b8508655db6c9 100644 (file)
@@ -22,7 +22,6 @@ int
 Rhythmic_tuple::time_compare (Rhythmic_tuple const &h1,
                              Rhythmic_tuple const &h2)
 {
-  
   return (h1.end_ - h2.end_ ).sign ();
 }
 
index 806365bc8edf7cd77102ac618e9948f9018e13fa..db4b05d1180f5a37171bd0f3a72a32b22ccc974a 100644 (file)
@@ -52,9 +52,6 @@ Spanner::do_break_processing ()
 
   if  (left == right)
     {
-      /*
-       FIXME: this is broken.
-       */
       /*
        If we have a spanner spanning one column, we must break it
        anyway because it might provide a parent for another item.  */
@@ -62,7 +59,9 @@ Spanner::do_break_processing ()
       do
        {
          Item* bound = left->find_prebroken_piece (d);
-         if (bound->line_l ())
+         if (!bound)
+           programming_error ("no broken bound");
+         else if (bound->line_l ())
            {
              Spanner * span_p = dynamic_cast<Spanner*>( clone ());
              span_p->set_bound (LEFT, bound);
diff --git a/lily/staff-info.cc b/lily/staff-info.cc
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc
deleted file mode 100644 (file)
index e69de29..0000000
index 207fda4489dd34b07222296199403229efa11fc2..18c6669187ceb3255a62da854e1f2c19dd8be49c 100644 (file)
@@ -12,7 +12,7 @@
 #include "musical-request.hh"
 #include "misc.hh"
 #include "stem-tremolo.hh"
-#include "staff-info.hh"
+
 #include "translator-group.hh"
 #include "engraver.hh"
 
index ab18bcd9b1167eeab7b9e7156628bac05c466893..e8fe8b4647e08653252add2ce91dceb65a097141 100644 (file)
@@ -205,20 +205,23 @@ Stem::add_head (Rhythmic_head *n)
   n->set_elt_pointer ("stem", this->self_scm_);
   n->add_dependency (this);
 
-  Pointer_group_interface gi (this);
   if (Note_head *nh = dynamic_cast<Note_head *> (n))
-    gi.name_ = "heads";
-  else
-    gi.name_ = "rests";
+    {
+      Pointer_group_interface gi (this);
+      gi.name_ = "heads";
 
-  gi.add_element (n);
+      gi.add_element (n);
+    }
+  else
+    {
+      n->set_elt_pointer ("rest", n->self_scm_);
+    }
 }
 
 Stem::Stem (SCM s)
   : Item (s)
 {
   set_elt_pointer ("heads", SCM_EOL);
-  set_elt_pointer ("rests", SCM_EOL);
 
   add_offset_callback ( &Stem::off_callback, X_AXIS);
 }
index 079ebe69e9a8da60c843fa636a64e89105de16c5..2fff02a9f84715b1ef63dfad99e47f69986fc198 100644 (file)
@@ -456,7 +456,6 @@ ScoreContext = \translator {
        )
        basicCollisionProperties = #`(
                (axes 0 1)
-               (before-line-breaking-callback . ,Collision::before_line_breaking)
        )
        basicCrescendoProperties = #`(
                (molecule-callback . ,Crescendo::brew_molecule)
@@ -467,7 +466,8 @@ ScoreContext = \translator {
        basicDotsProperties = #`(
                (molecule-callback . ,Dots::brew_molecule)
                (after-line-breaking-callback . ,Dots::after_line_breaking)
-               (dot-count . 1) 
+               (dot-count . 1)
+               (dots-interface . #t)
        )
        basicDynamicLineSpannerProperties = #`(
                (dynamic-interface . #t)
@@ -531,10 +531,14 @@ ScoreContext = \translator {
                (axes 0 1)
        )
        basicNoteHeadProperties = #`(
+               (note-head-interface . #t)
                (molecule-callback . ,Note_head::brew_molecule)
                (before-line-breaking-callback . ,Note_head::before_line_breaking)
                (after-line-breaking-callback . ,Rhythmic_head::after_line_breaking)
        )
+       basicNoteNameProperties = #`(
+               (molecule-callback . ,Text_item::brew_molecule)
+       )
        basicOctavateEightProperties  = #`(
                (self-alignment-X . 0)
                (text . "8")
@@ -550,13 +554,15 @@ ScoreContext = \translator {
                                
        )
        basicTextProperties = #`( )
-       basicRestProperties = #`( 
+       basicRestProperties = #`(
+               (rest-interface . #t)   
                (molecule-callback . ,Rest::brew_molecule)
                (after-line-breaking-callback . ,Rhythmic_head::after_line_breaking)
+               (minimum-beam-collision-distance . 1.5)
        )
        
        basicRestCollisionProperties = #`(
-               (after-line-breaking-callback . ,Rest_collision::after_line_breaking)
+               (minimum-distance . 0.75)
        )
        basicScriptProperties    = #`(
                (molecule-callback . ,Script::brew_molecule)
index 46e240e9865f0aa9f2b0be60a90a3ed527220db8..0fb31179fd59be3cfc93408006e37fc6a340f880 100644 (file)
@@ -185,8 +185,6 @@ crescendo_dash_thickness = 1.2*\stafflinethickness;
 crescendo_dash = 4.0*\staffspace;
 
 % in internote.
-restcollision_minimum_dist = 3.0;
-restcollision_minimum_beamdist = 1.5;
 
 
 % unit for note collision resolving
index 87363e72cd36672c56df39cb9279d8f6eb132d8a..4bb845b7e0557235081b7063ac035b5f0196a9e9 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.65
-Entered-date: 26JUN00
+Version: 1.3.66
+Entered-date: 29JUN00
 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.65.tar.gz 
+       1000k lilypond-1.3.66.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.65.tar.gz 
+       1000k lilypond-1.3.66.tar.gz 
 Copying-policy: GPL
 End
index ecfa2003dfe739fb433266a0eaded6a55adf2b4b..107f9ff03113bc851be04259ad671abc8ff10634 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.65
+Version: 1.3.66
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.65.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.66.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 # Icon: lilypond-icon.gif
index 506be8a760c5be68ea8a5f113308a44e19308287..3b3d46665fcf3985eb8dab281d789765de6ce171 100644 (file)
@@ -1,4 +1,8 @@
 
+; BROKEN as of 1.3.55, FIXME
+;
+
+
 ;
 ; Format: 
 ; (cons 'Type name