+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.
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
\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 }
}
\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
c,^( c'' c)
c,,^( c'')
c,,^( c')
-%}
}
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"),
#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)
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;
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);
}
}
/*
- 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_;
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);
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;
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)
}
}
- 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--;)
{
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);
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;
{
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++;
// 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
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*