From: Han-Wen Nienhuys Date: Mon, 12 Jul 2004 22:02:26 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.7~63 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c4905a1f5b840d2b9f625e79a340e2a3a23dba08;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index c403bcb875..658f84ecce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-12 Han-Wen Nienhuys + + * 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 * SConstruct: Updates. Add targets: tar, dist, release. diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index 6e3fcd8cba..7dba103d57 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -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 diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly index f179d79adc..02a3dafdf0 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly @@ -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 } } diff --git a/input/test/new-slur.ly b/input/test/new-slur.ly index 876698ef6c..e61cc49983 100644 --- a/input/test/new-slur.ly +++ b/input/test/new-slur.ly @@ -9,10 +9,10 @@ \override Slur #'height = ##f f'=''16( e) -% d( c) -% c'=''2(~c8 d16 c b8 a) - -%{ ( f ) + d( c) + c'=''2(~c8 d16 c b8 a) + f='4 + 4 ( f ) f ^( f ) f @@ -22,5 +22,4 @@ c,^( c'' c) c,,^( c'') c,,^( c') -%} } diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index c22408b300..ad0329c676 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -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"), diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 1241e34cff..ba971fb20a 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -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) diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 0210c86c55..016887b9df 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -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; diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 5f2314ce08..33a9cfb24b 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -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); } } diff --git a/lily/new-slur.cc b/lily/new-slur.cc index f496640f57..100dd6d92e 100644 --- a/lily/new-slur.cc +++ b/lily/new-slur.cc @@ -1,5 +1,5 @@ /* - slur.cc -- implement Slur + slur.cc -- implement score based Slur source file of the GNU LilyPond music typesetter @@ -12,17 +12,12 @@ #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" @@ -32,6 +27,15 @@ #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 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 base_atta { Link_array columns = Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns"); - Drul_array 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 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; diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 13c6ba0d5c..dd3873d3b0 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -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 diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index e3070ff53d..96d1dccebb 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -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*