]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 0.1.13.jcn2: abbrev pats
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 12 Sep 1997 11:25:41 +0000 (13:25 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 12 Sep 1997 11:25:41 +0000 (13:25 +0200)
pl 13.jcn2
- gaps on abbrev-beams
- bf: stem-info
- bf: last abbrev
- bf: stem: do_width
- bf: removed rest-column.hh

13 files changed:
NEWS
VERSION
input/abbrev.ly
input/wtk1-fugue1.ly
lily/abbreviation-beam-engraver.cc
lily/beam.cc
lily/include/beam.hh
lily/include/stem.hh
lily/my-lily-parser.cc
lily/rest-collision-grav.cc
lily/rest-collision.cc
lily/stem-info.cc
lily/stem.cc

diff --git a/NEWS b/NEWS
index 3fa6da35ec4d71fc7cf14ca3267eb00b6b447fb3..739797cd39080d4b85c1007b3142ba04d8029cb5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+pl 13.jcn2
+       - gaps on abbrev-beams 
+       - bf: stem-info
+       - bf: last abbrev
+       - bf: stem: do_width
+       - bf: removed rest-column.hh
 
 pl 13
        - big Rest/notehead rewrite:
diff --git a/VERSION b/VERSION
index ca27f3dfd2b8d4ac12e2af70903573262138b673..1ac534dd994cab283e022f1cbf9eefd5b62b43b9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,4 +3,4 @@ TOPLEVEL_MINOR_VERSION = 1
 TOPLEVEL_PATCH_LEVEL = 13
 
 # use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
+TOPLEVEL_MY_PATCH_LEVEL = .jcn2
index b25a386f0349315d351b65d5a18bb2f4254263a5..4c91009e0e9d302292d2af32f520a6a75bdec97b 100644 (file)
@@ -20,19 +20,22 @@ EndMudelaHeader
                'a1
                'a1:32
                'c4:8 c' 'c4:16 c'
-               [ 'c8:16 'c 'c 'c ] [ a a a a ]
-               [ 'c 'f 'b e ] 
-               [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
+%              [ 'c8:16 'c 'c 'c ] [ a a a a ]
+%              [ 'c 'f 'b e ] 
+%              [ 'c16:32 'c 'c 'c ] [ a16:32 a a a ]
 %%             % there's still some hairy beam bugfixing todo
 %%             [ c'8:16 g d 'a ]
 %%             [ c'16:32 g d 'a ]
 %%             [ 'c8:32 'f 'b e ]
-               [:16 c4 e]
+               [:32 c16 e]
+               [:32 c16 e]
+               [:16 c8 e]
                [:16 e4 g]
                [:16 e2 g]
                [:16 e1 g]
        }
        \paper{ 
+           gourlay_maxmeasures =5.;
        }
 % oeps
        \midi{ }
index d1c21d8aeb1b6bd35db40a52c82002dd1a9977a3..53764efbd08596cc9c169f4d5a4ba87979cec252 100644 (file)
@@ -47,12 +47,12 @@ tenor =
        \stemboth
        [c'. d'32 c'] [b8 e'] [a d'] ~ [d'16 e' d' c'] |
        [b8 g' cis' d'] [e' cis' d' e' ] |
-       \stemdown a8 r8 r e [fis g] \stemboth[a. b32 a] |
+       \stemdown a8 r8 r e [fis g] \stemboth [a. b32 a] |
 %% 20
-       [g8 c' fis b] ~ [b16 c' b a] \stemdown [g fis e d] \stemboth|
+       [g8 c' fis b] ~ [b16 c' b a] \stemdown [g fis e d] \stemboth |
        e4 \stemdown d ~ [d16 a g f!] [e g f! a] |
        g4 ~ [g16 a bes8] c'4 [d'8 g] |
-       \stembothg4. f8 ~ [f e] d4 |
+       \stemboth g4. f8 ~ [f e] d4 |
        \stemdown e8 a4 g8 ~ [g8 f g a] |
 %% 25
        [bes8. c'32 b] [a8 d'] [g c'] ~ [c'16 d' c' bes] |
index 89952d24fa4b51ea8d1ee5243fb759e09b38c67f..59c70b28b7bea6b500c4a0fde68e84549309a256 100644 (file)
@@ -79,7 +79,6 @@ Abbreviation_beam_engraver::do_removal_processing ()
     }
 }
 
-
 void
 Abbreviation_beam_engraver::acknowledge_element (Score_elem_info i)
 {
@@ -94,5 +93,9 @@ Abbreviation_beam_engraver::acknowledge_element (Score_elem_info i)
     s->beams_left_i_ = s->flag_i_;
   else
     s->beams_right_i_ = s->flag_i_;
+
+  if (s->type_i () != 1) // no abbrev gaps on half note
+    s->beam_gap_i_ = s->flag_i_ - ((s->type_i () >? 2) - 2);
+  
   abeam_p_->add (s);
 } 
index 02dde804a058cd897e2d4691d0cb54bba6849484..a696c646ce371f7dc97ff914350547210869244d 100644 (file)
@@ -18,6 +18,7 @@
 #include "proto.hh"
 #include "dimen.hh"
 #include "beam.hh"
+#include "abbreviation-beam.hh"
 #include "misc.hh"
 #include "debug.hh"
 #include "symbol.hh"
@@ -46,9 +47,9 @@ Beam::add (Stem*s)
   s->beam_l_ = this;
 
   if (!spanned_drul_[LEFT])
-    set_bounds(LEFT,s);
+    set_bounds (LEFT,s);
   else
-    set_bounds(RIGHT,s);
+    set_bounds (RIGHT,s);
 }
 
 Molecule*
@@ -302,7 +303,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
     {
       int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
       int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
-      Real w = (here->hpos_f() - prev->hpos_f ())/4;
+      Real w = (here->hpos_f () - prev->hpos_f ())/4;
       Symbol dummy;
       Atom a (dummy);
       if (lhalfs)              // generates warnings if not
@@ -323,12 +324,28 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
 
       Real w = next->hpos_f() - here->hpos_f ();
       Atom a = paper()->lookup_l ()->beam (sl, w + stemdx);
-       
+
       int j = 0;
+      Real gap_f = 0;
+      if (here->beam_gap_i_)
+       {
+         int nogap = rwholebeams - here->beam_gap_i_;
+         for (; j  < nogap; j++) 
+           {
+             Atom b (a);
+             b.translate (-dir_ * dy * j, Y_AXIS);
+             rightbeams.add (b); 
+           }
+         // TODO: notehead widths differ for different types
+         gap_f = paper()->note_width () / 2;
+         w -= 2 * gap_f;
+         a = paper()->lookup_l ()->beam (sl, w + stemdx);
+       }
+
       for (; j  < rwholebeams; j++) 
        {
          Atom b (a);
-         b.translate (-dir_ * dy * j, Y_AXIS);
+         b.translate (Offset (gap_f, -dir_ * dy * j));
          rightbeams.add (b); 
        }
 
index c1b1b971b9dcae1f58838d753343d92a1531acf0..5d605937c169113c4bf1299c0942295ccd46fc56 100644 (file)
@@ -33,7 +33,7 @@ public:
   SCORE_ELEM_CLONE(Beam);
 
 protected:
-  Interval do_width() const;    
+  virtual Interval do_width() const;    
   Offset center() const;
   void set_default_dir();
   virtual void do_pre_processing();
index a492a3d4d862c4762c1c7791b20d047aec4329c4..97873233506e9bceceada537254ce53a55639857 100644 (file)
@@ -33,7 +33,6 @@ class Stem : public Item {
     
   Real stem_bottom_f_, stem_top_f_;
     
-    
   /// needed for determining direction/length
   int staff_size_i_;
 
@@ -55,6 +54,9 @@ public:
   /// abbrev flag? + count
   int abbrev_flag_i_;
 
+  /// how many abbrev beam don't reach stem?
+  int beam_gap_i_;
+
   /// flagtype? 4 none, 8 8th flag, 0 = beam.
   int flag_i_;
 
@@ -79,7 +81,9 @@ public:
   DECLARE_MY_RUNTIME_TYPEINFO;
 
   Real hpos_f() const;
-    
+  
+  int type_i () const;
+
   void do_print() const;
   void set_stemend (Real);
   Direction get_default_dir();
index d03e29ffec6460d9193bf91b820bd380d531e682..7cbcd86bc309d0ec8fe5f21cadb2a8663c3156a1 100644 (file)
@@ -216,7 +216,7 @@ Chord *
 My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
 {
   Chord*v = new Request_chord;
-  v->set_spot (here_input());
+  v->set_spot (here_input ());
 
   v->add (rq);
   
@@ -227,8 +227,14 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
       assert (!duration_p->plet_b ());
       duration_p->set_plet (1, 2);
     }
+  if (default_abbrev_type_i_)
+    {
+      Abbreviation_req* a = new Abbreviation_req;
+      a->type_i_ = default_abbrev_type_i_;
+      v->add (a);
+    }
   rq->set_duration (*duration_p);
-  rq->set_spot (here_input());
+  rq->set_spot (here_input ());
   delete duration_p ;
   return v;
 }
index 7a41c7ab45c4b8152562cadd265466475c79286a..4aa0607aca38811ad2f24ab4935904fd1c117325 100644 (file)
@@ -10,7 +10,6 @@
 #include "rest-collision.hh"
 #include "rest-collision-grav.hh"
 #include "collision.hh"
-#include "rest-column.hh"
 #include "note-column.hh"
 
 
index 54392d55858bd8858326d2f1a36276d8c027681f..cf4a898831266aab08c218155c6f8b1f3b0d281d 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "debug.hh"
 #include "rest-collision.hh"
-#include "rest-column.hh"
 #include "note-column.hh"
 #include "stem.hh"
 #include "note-head.hh"
index 5e446b665e627809dc424b4aa7341c1b5008952b..a3287ce55cbeb8891d2066fc347b8d432ee4c0d2 100644 (file)
@@ -25,7 +25,7 @@ Stem_info::Stem_info (Stem const *s)
 {
   x = s->hpos_f();
   dir_ = s->dir_;
-  beams_i_ = intlog2(s->flag_i_) - 2;
+  beams_i_ =  0 >? (abs (s->flag_i_) - 2);
 
   /*
     [todo] 
index 0cd5486d0fe23d4390f074d87f312984f6826e36..875db2140533f4186f950f3b97faa85dbe4420cb 100644 (file)
@@ -38,6 +38,7 @@ Stem::Stem ()
   staff_size_i_ = 8;
 
   stem_xoffset_f_ =0;
+  beam_gap_i_ = 0;
 }
 
 int
@@ -98,6 +99,12 @@ Stem::set_stemend (Real se)
   stem_bottom_f_  = (dir_ < 0) ? se  : min_head_i ();
 }
 
+int
+Stem::type_i () const
+{
+  return head_l_arr_[0]->balltype_i_;
+}
+
 void
 Stem::add (Note_head *n)
 {
@@ -196,10 +203,12 @@ Stem::set_default_extents ()
     set_default_stemlen ();
 
   set_stemend ((dir_< 0) ? 
-              max_head_i ()-stem_length_f (): min_head_i () +stem_length_f ());
-  if (dir_ > 0){       
-    stem_xoffset_f_ = paper ()->note_width ()-paper ()->rule_thickness ();
-  }
+              max_head_i ()-stem_length_f (): min_head_i () + stem_length_f ());
+  // ugh, a whole ball is wider
+  if (head_l_arr_[0]->balltype_i_ <= 0)
+    stem_xoffset_f_ = paper ()->note_width () / 2;
+  else if (dir_ > 0)   
+    stem_xoffset_f_ = paper ()->note_width () - paper ()->rule_thickness ();
   else
     stem_xoffset_f_ = 0;
 }
@@ -248,58 +257,67 @@ Stem::do_pre_processing ()
   flag_i_ = dir_ * abs (flag_i_);
   transparent_b_ = invisible_b ();
   empty_b_ = invisible_b ();
+
 }
 
 
 Interval
 Stem::do_width () const
 {
-  if (beam_l_ || abs (flag_i_) <= 4)
-    return Interval (0,0);     // TODO!
-  Paper_def*p= paper ();
-  Interval r (p->lookup_l ()->flag (flag_i_).dim.x ());
-  r+= stem_xoffset_f_;
+  Interval r (0, 0);
+  if (abbrev_flag_i_)
+    {
+      r = abbrev_mol ().extent ().x ();
+    }
+  else if (beam_l_ || abs (flag_i_) <= 4)
+    ;  // TODO!
+  else
+    {
+      Paper_def*p= paper ();
+      r = p->lookup_l ()->flag (flag_i_).dim.x ();
+      r+= stem_xoffset_f_;
+    }
   return r;
 }
 
 
-  
- Molecule
- Stem::abbrev_mol () const
- {
-   Real dy = paper ()->interbeam_f ();
-   Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
-   Real beamdy = paper ()->interline_f () / 2;
-   int beams_i = 0;
-   Real slope = paper ()->internote_f () / 4;
-   if (beam_l_) {
-     // huh?
-     slope = 2 * beam_l_->slope;
-     // ugh, rather calc from Abbreviation_req
-     beams_i = beams_right_i_ >? beams_left_i_; 
-   }
-   paper ()->lookup_l ()->beam (slope, 20 PT);
  
-   Molecule beams;
-   Atom a (paper ()->lookup_l ()->beam (slope, w));
-   a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
-   // ugh
-   if (!beams_i)
-     a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
-   else
-     a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
-       
-   for (int i = 0; i < abbrev_flag_i_; i++) 
-     {
-       Atom b (a);
-       b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
-       beams.add (b);
-     }
-   return beams;
- }
+Molecule
+Stem::abbrev_mol () const
+{
+  Real dy = paper ()->interbeam_f ();
+  Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
+  Real beamdy = paper ()->interline_f () / 2;
+
+  int beams_i = 0;
+  Real slope = paper ()->internote_f () / 4;
+
+  if (beam_l_) {
+    // huh?
+    slope = 2 * beam_l_->slope;
+    // ugh, rather calc from Abbreviation_req
+    beams_i = beams_right_i_ >? beams_left_i_; 
+  }
+  paper ()->lookup_l ()->beam (slope, 20 PT);
+
+  Molecule beams;
+  Atom a (paper ()->lookup_l ()->beam (slope, w));
+  a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
+  // ugh
+  if (!beams_i)
+    a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
+  else
+    a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
+       
+  for (int i = 0; i < abbrev_flag_i_; i++) 
+    {
+      Atom b (a);
+      b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
+      beams.add (b);
+    }
+
+  return beams;
+}
 
 Molecule*
 Stem::brew_molecule_p () const