]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Jul 2004 22:02:26 +0000 (22:02 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Jul 2004 22:02:26 +0000 (22:02 +0000)
ChangeLog
Documentation/user/introduction.itely
input/mutopia/W.A.Mozart/mozart-hrn-3.ly
input/test/new-slur.ly
lily/clef-engraver.cc
lily/include/lily-guile.hh
lily/modified-font-metric.cc
lily/multi-measure-rest-engraver.cc
lily/new-slur.cc
lily/scm-hash.cc
lily/staff-symbol-referencer.cc

index c403bcb875db0699c7b77ce5cdea670656e36de4..658f84ecceacf1b2415a0610b9d1860619cc9296 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-12  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/staff-symbol-referencer.cc (on_staffline): bugfix 
+
+       * lily/scm-hash.cc (get): SCM_MAKINUM is deprecated. Use
+       scm_from_int instead.
+
 2004-07-12  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * SConstruct: Updates.  Add targets: tar, dist, release.
index 6e3fcd8cbadf69e499b0686469bf450ad145960d..7dba103d57b24162c1c91b44d999bee0f9ff18e7 100644 (file)
@@ -32,8 +32,9 @@ ink.  An image was formed by pressing paper to the plate.  The
 stamping and cutting was completely done by hand.  Making a correction
 was cumbersome, if possible at all, so the engraving had to be perfect
 in one go.  Engraving was a highly specialized skill, a craftsman had
-to complete around ten years of practical training before he could be
-a master engraver.
+to complete around five years of training before he could
+be a master engraver, and another five years of experience were
+necessary to become truly skilled.
 
 Nowadays, all newly printed music is produced with computers.  This
 has obvious advantages; prints are cheaper to make, editorial work can
index f179d79adc713c8e418f62a0569280b8eeed0474..02a3dafdf08558de1cb951d22e55752bd73e12b2 100644 (file)
@@ -58,7 +58,16 @@ virtuoso that taught in Geneva.
 \score
 {
         { \transpose c' bes \allegro }
-       \paper{ }
+       \paper{
+           \context { \Score
+
+                      \override Slur #'after-line-breaking-callback = #New_slur::after_line_breaking
+                      \override Slur #'print-function = #New_slur::print     
+                      \override Slur #'height = ##f
+
+                      
+                      }
+       }
        \header { piece = "allegro" opus = "" } 
        \midi{ \tempo 4=90 }
 }
index 876698ef6c5bf9fccfc4e50ce3d3e8c3bb0661d0..e61cc49983ab0d86568df21da1d2c96014f28544 100644 (file)
@@ -9,10 +9,10 @@
     \override Slur #'height = ##f
 
     f'=''16( e)
-%    d( c)
-%    c'=''2(~c8 d16 c b8 a)
-    
-%{    <c g> ( f <g b>)
+    d( c)
+    c'=''2(~c8 d16 c b8 a)
+    f='4
+    <c g>4 ( f <g b>)
      f
     <c g>^( f <g b>)
     f
@@ -22,5 +22,4 @@
     c,^( c'' c) 
     c,,^( c'')
     c,,^( c') 
-%}
 }
index c22408b300f96ebaf8fa1aa20f3dacf1eb9772b4..ad0329c676de7de01f5d97e6edf6a5caaf891c3a 100644 (file)
@@ -105,7 +105,7 @@ Clef_engraver::create_clef ()
          abs_oct = abs (abs_oct)  + 1;
 
          SCM txt = scm_number_to_string (scm_int2num (abs_oct),
-                                         SCM_MAKINUM (10));
+                                         scm_from_int (10));
 
          g->set_property ("text",
                           scm_list_n (ly_scheme_function ("vcenter-markup"),
index 1241e34cff94204909fa373649e8ec447c5191b8..ba971fb20a15253e65111e439821bd345d78cdb8 100644 (file)
@@ -44,7 +44,7 @@
 #define scm_c_resolve_module(x) (SCM)0
 
 inline SCM scm_c_make_vector  (int k, SCM val) {
-  return scm_make_vector (SCM_MAKINUM (k), val);
+  return scm_make_vector (scm_from_int (k), val);
 }
 #define scm_c_define_gsubr scm_make_gsubr
 #define scm_remember_upto_here_1(s) scm_remember (&s)
index 0210c86c55200c8b0302e67c670655a527eb4836..016887b9dfa223b5397a74312066ba2859094885 100644 (file)
@@ -264,7 +264,7 @@ Modified_font_metric::text_dimension (String text)
       for (int i = 0; i < text.length (); i++) 
        {
          SCM sym = scm_vector_ref (coding_vector_,
-                                   SCM_MAKINUM((unsigned char) text[i]));
+                                   scm_from_int((unsigned char) text[i]));
 
          Box char_box;
 
index 5f2314ce088811bfbca1b8df0cb83be72b7842d8..33a9cfb24b4bc882f307fff099bb3e18b87cd64f 100644 (file)
@@ -241,7 +241,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
          else 
            {
              SCM text
-               = scm_number_to_string (scm_int2num (num), SCM_MAKINUM (10));
+               = scm_number_to_string (scm_int2num (num), scm_from_int (10));
              last->set_property ("text", text);
            }
        }
index f496640f57ec5df76eba1f11a7a5daf15b2749b8..100dd6d92e10ee606614684728714b241c170fb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  slur.cc -- implement Slur
+  slur.cc -- implement score based Slur
 
   source file of the GNU LilyPond music typesetter
 
 
 #include "font-interface.hh"
 #include "text-item.hh"
-
 #include "directional-element-interface.hh"
 #include "group-interface.hh"
-#include "group-interface.hh"
 #include "lily-guile.hh"
-#include "lily-proto.hh"
 #include "lookup.hh"
-#include "main.hh"
 #include "note-column.hh"
 #include "output-def.hh"
-#include "paper-column.hh"
 #include "rod.hh"
 #include "slur-bezier-bow.hh"
 #include "slur.hh"
 #include "stencil.hh"
 #include "warn.hh"
 
+/*
+  TODO:
+
+  - avoid collision with staff line
+  - curve around flag/stem for x coordinate
+  - better scoring.
+  
+ */
+
 struct Encompass_info {
   Real x_;
   Real stem_;
@@ -275,9 +279,14 @@ New_slur::set_end_points (Grob *me)
 
       y += dir * 0.5 * staff_space;
       int p = Staff_symbol_referencer::get_position (h) + 2*dir;
-      if (Staff_symbol_referencer::on_staffline (h, p))
-       y += 0.5 * staff_space * dir ; 
 
+      
+      if (Staff_symbol_referencer::on_staffline (h, p))
+       /*
+         start off staffline.
+        */
+       y += staff_space * dir / 10 ;
+      
       Grob * fh = Note_column::first_head (extremes[d]);
       Real x = fh->extent (common[X_AXIS],  X_AXIS).linear_combination (CENTER);
 
@@ -296,8 +305,8 @@ New_slur::set_end_points (Grob *me)
 
   do {
     staff_offsets[d] = staves[d]->relative_coordinate (common[Y_AXIS], Y_AXIS);
-    end_ys[d] =  dir * (dir * base_attachment[d][Y_AXIS] + 4.0 *dir >?
-                       dir * (dir + extremes[d]->extent(common[Y_AXIS],Y_AXIS)[dir]));
+    end_ys[d] =  dir * ((dir * (base_attachment[d][Y_AXIS] + 4.0 *dir)) >?
+                       (dir * (dir + extremes[d]->extent(common[Y_AXIS],Y_AXIS)[dir])));
   } while (flip (&d) != LEFT);
   
   Array<Slur_score> scores;
@@ -338,7 +347,7 @@ New_slur::set_end_points (Grob *me)
   score_slopes (me, common, base_attachment, &scores);
 
   Real opt = 1e6;
-  int opt_idx = -1;
+  int opt_idx = 0;
   for (int i = scores.size (); i--;)
     {
       if (scores[i].score_  < opt)
@@ -348,7 +357,7 @@ New_slur::set_end_points (Grob *me)
        }
     }
   
-  Bezier b (get_bezier (me, scores[opt_idx].attachment_));
+  Bezier b (get_bezier (me, scores.size () ? scores[opt_idx].attachment_ : base_attachment));
   
   SCM controls = SCM_EOL;
   for (int i = 4; i--;)
@@ -440,7 +449,6 @@ New_slur::score_slopes (Grob * me,  Grob *common[], Drul_array<Offset> base_atta
 {
  Link_array<Grob> columns =
     Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
-  
 
   Drul_array<Grob *> extremes (columns[0], columns.top ());
   Direction dir = get_grob_direction (me);
@@ -465,7 +473,7 @@ New_slur::score_slopes (Grob * me,  Grob *common[], Drul_array<Offset> base_atta
 
       Real demerit = 0.0;
 
-      demerit += STEEPER_SLOPE_FACTOR *  (dir * (slur_dy - dy) >? 0);
+      demerit += STEEPER_SLOPE_FACTOR *  (dir * (fabs (slur_dy) - fabs (dy)) >? 0);
       if (sign (dy) == 0 &&
          sign (slur_dy) != 0)
        demerit += NON_HORIZONTAL_PENALTY;
index 13c6ba0d5c2ca86088f28c1bfe790ad9d68cceb0..dd3873d3b073aa22f2c44fff7430eb0f6cb1dc26 100644 (file)
@@ -19,7 +19,7 @@ copy_scm_hashes (SCM dest, SCM src)
 {
   int k = 0;
   for (int i = SCM_VECTOR_LENGTH (src); i--;)
-    for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_c_pair_p (s); s = ly_cdr (s))
+    for (SCM s = scm_vector_ref (src, scm_from_int (i)); ly_c_pair_p (s); s = ly_cdr (s))
       {
        scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s));
        k++;
@@ -123,12 +123,12 @@ Scheme_hash_table::set (SCM k, SCM v)
 
 // UGH. 
 SCM
-Scheme_hash_table::get (SCM k)const
+Scheme_hash_table::get (SCM k) const
 {
   /*
     42 will stick out like a sore thumb, hopefully.
    */
-  return scm_hashq_ref (hash_tab_, k, SCM_MAKINUM (42));
+  return scm_hashq_ref (hash_tab_, k, scm_from_int (42));
 }
 
 void
index e3070ff53d7373373b5505d095e4afef2b27e6e7..96d1dccebb57f2d61fae99bb4f76a933cdbb98cc 100644 (file)
@@ -31,7 +31,7 @@ bool
 Staff_symbol_referencer::on_staffline (Grob *me, int pos)
 {
   int sz = line_count (me) - 1;
-  return ((pos + sz) % 2) == 0;
+  return ((pos + sz) % 2) == 0 && abs (pos) <= sz;
 }
 
 Grob*