]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.55
authorfred <fred>
Tue, 26 Mar 2002 23:22:22 +0000 (23:22 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:22:22 +0000 (23:22 +0000)
input/trip.ly
lily/beam.cc
lily/stem-tremolo.cc

index 1e4cbcb2b4abc2fbe41560b9c6330f8891165a68..5cccdb146de3cf4ed14fdac81d477b2f9c44a90e 100644 (file)
@@ -26,7 +26,7 @@ praeludiumRight =  \notes {
   % 13 -- how to type -- where to split -- this more neatly?
   \context Staff <
     \context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ |
-      \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
+      \shifton e4-.-^^\f [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
       fis4 ~ [fis8 e16 dis] e4 r8 e8 }
     \context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis |
       a' ~ [a16 gis a b] \shifton dis,4 cis ~ |
@@ -203,7 +203,7 @@ fugaIIPedal = \notes \relative c {
      b!-\lheel ais-\rtoe gis-\ltoe ~ ] |
       gis8  r4.
     )
-      c2 
+      c2^^^-^\f 
  \time 3/4;
 
   \fugaIIPedal }
index e19a82270b5e79b6a323d3e826d11cd0af0fc201..108f543bc6a022b2f488b5aaacebf8a5f4a62eb3 100644 (file)
 #include "staff-symbol-referencer.hh"
 #include "cross-staff.hh"
 
-Beam::Beam ()
+Beam::Beam (SCM s)
+  : Spanner (s)
 {
-  Group_interface g (this, "stems");
+  Pointer_group_interface g (this, "stems");
   g.set_interface ();
 
   set_elt_property ("height", gh_int2scm (0)); // ugh.
@@ -44,13 +45,13 @@ Beam::Beam ()
 void
 Beam::add_stem (Stem*s)
 {
-  Group_interface gi (this, "stems");
+  Pointer_group_interface gi (this, "stems");
   gi.add_element (s);
   
   s->add_dependency (this);
 
   assert (!s->beam_l ());
-  s->set_elt_property ("beam", self_scm_);
+  s->set_elt_pointer ("beam", self_scm_);
 
   if (!get_bound (LEFT))
     set_bound (LEFT,s);
@@ -62,7 +63,7 @@ int
 Beam::get_multiplicity () const
 {
   int m = 0;
-  for (SCM s = get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = get_elt_pointer ("stems"); gh_pair_p (s); s = gh_cdr (s))
     {
       Score_element * sc = unsmob_element (gh_car (s));
 
@@ -422,6 +423,8 @@ Real
 Beam::calc_stem_y_f (Stem* s, Real y, Real dy) const
 {
   Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
+  thick *= paper_l ()->get_var ("staffspace");
+  
   int beam_multiplicity = get_multiplicity ();
   int stem_multiplicity = (s->flag_i () - 2) >? 0;
 
@@ -603,12 +606,13 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
       programming_error ("Beams are not left-to-right");
 
   Real staffline_f = paper_l ()->get_var ("stafflinethickness");
-  int   multiplicity = get_multiplicity ();
+  int multiplicity = get_multiplicity ();
 
 
   Real interbeam_f = paper_l ()->interbeam_f (multiplicity);
   Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
-
+  thick *= paper_l ()->get_var ("staffspace");
+    
   Real bdy = interbeam_f;
   Real stemdx = staffline_f;
 
@@ -780,20 +784,20 @@ Beam::forced_stem_count () const
 Stem *
 Beam::stem (int i) const
 {
-  return Group_interface__extract_elements ((Beam*) this, (Stem*) 0, "stems")[i];
+  return Pointer_group_interface__extract_elements ((Beam*) this, (Stem*) 0, "stems")[i];
 }
 
 int
 Beam::stem_count () const
 {
-  Group_interface gi (this, "stems");
+  Pointer_group_interface gi (this, "stems");
   return gi.count ();
 }
 
 Stem*
 Beam::stem_top () const
 {
-  SCM s = get_elt_property ("stems");
+  SCM s = get_elt_pointer ("stems");
   
   return gh_pair_p (s) ? dynamic_cast<Stem*> (unsmob_element (gh_car (s))) : 0;
 }
index 3da86edc036b9993f1828e9579d7ffa90ae10bea..4a23d14c3595c413112ae56317a2c49efb857726 100644 (file)
     lengthen stem if necessary
  */
 
-Stem_tremolo::Stem_tremolo ()
+Stem_tremolo::Stem_tremolo (SCM s)
+  : Item (s)
 {
-  set_elt_property ("stem", SCM_EOL);
+  set_elt_pointer ("stem", SCM_EOL);
 }
 
 
 Stem *
 Stem_tremolo::stem_l ()const
 {
-  SCM s =   get_elt_property ("stem");
+  SCM s =   get_elt_pointer ("stem");
 
   return dynamic_cast<Stem*> (  unsmob_element (s));
 }
 
 Interval
-Stem_tremolo::dim_callback (Score_element * se, Axis a)
+Stem_tremolo::dim_callback (Score_element * se, Axis )
 {
   Stem_tremolo * s = dynamic_cast<Stem_tremolo*> (se);
   Real space = Staff_symbol_referencer_interface (s->stem_l ())
@@ -68,8 +69,12 @@ Stem_tremolo::do_brew_molecule () const
     // urg
     dydx = 0.25;
 
+  Real ss = Staff_symbol_referencer_interface (stem).staff_space ();
   Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
   Real width = gh_scm2double (get_elt_property ("beam-width"));
+  width *= ss;
+  thick *= ss;
+  
   Molecule a (lookup_l ()->beam (dydx, width, thick));
   a.translate (Offset (-width/2, width / 2 * dydx));
   
@@ -92,15 +97,12 @@ Stem_tremolo::do_brew_molecule () const
     }
   if (tremolo_flags)
     mol.translate_axis (-mol.extent (Y_AXIS).center (), Y_AXIS);
-
-  Real half_space = Staff_symbol_referencer_interface (stem).staff_space ()
-    / 2;
   if (beam)
     {
       // ugh, rather calc from Stem_tremolo_req
       int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
       mol.translate (Offset(stem->relative_coordinate (0, X_AXIS) - relative_coordinate (0, X_AXIS),
-                           stem->stem_end_position () * half_space - 
+                           stem->stem_end_position () * ss / 2 - 
                            directional_element (beam).get () * beams_i * interbeam_f));
     }
   else
@@ -108,7 +110,7 @@ Stem_tremolo::do_brew_molecule () const
       /*
        Beams should intersect one beamthickness below stem end
       */
-      Real dy = stem->stem_end_position () * half_space;
+      Real dy = stem->stem_end_position () * ss / 2;
       dy -= mol.extent (Y_AXIS).length () / 2 *  stem->get_direction ();
 
       /*
@@ -132,7 +134,7 @@ Stem_tremolo::do_brew_molecule () const
 void
 Stem_tremolo::set_stem (Stem *s)
 {
-  set_elt_property ("stem", s->self_scm_);
+  set_elt_pointer ("stem", s->self_scm_);
   add_dependency (s);
 }