+* Robustness fix for minimise_least_squares ()
+
+* cleanups of Slur_bezier_bow, removed Bezier_bow.
+
+* cleanup of Tie. Changed Tie into interface. Made ties flatter by default.
+
+* changed SCM_UNDEFINED to SCM_UNSPECIFIED for return values that go
+back into Scheme.
+
+* changed SCM_UNSPECIFIED to SCM_EOL for undefined element
+properties. This makes initializing list properties redundant.
+
+* removed idiotic code for including tfm.[1-5] into search path.
+
+* fixed problem with tuplet placement for cross staff tuplets.
+
+1.3.71
+======
* Small cleanups to bring down compile time and binary ensmallment.
* Made Lookup into a smob, and use guile alist iso. an STL map.
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=71
+PATCH_LEVEL=72
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
+++ /dev/null
-#!/bin/sh
-cwd=`pwd`
-
-{ cd $LILYPOND_SOURCEDIR; cd ..;
-export LILYPOND_ROOTDIR=`pwd` }
-
-if [ "$1" = "" ]; then
- VERSION=`show-current`
- TARBALL=$LILYPOND_ROOTDIR/releases/lilypond-$VERSION.tar.gz
- cwd=`pwd`
-else
- TARBALL=$1
-fi
-
-
-tar-docxx $TARBALL
program_prefix = @program_prefix@
program_suffix = @program_suffix@
EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@
-TFM_PATH = @TFM_PATH@
-TFM_SUFFIXES = @TFM_SUFFIXES@
RANLIB = @RANLIB@
DEFS = @DEFS@
#SET_MAKE = @SET_MAKE@
*/
class String_handle {
- String_data* data;
+ String_data* data;
- /// decrease ref count. Named kind of like a Tanenbaum semafore
- void down();
+ /// decrease ref count. Named kind of like a Tanenbaum semafore
+ void down();
- /// increase ref count
- void up (String_data *d);
+ /// increase ref count
+ void up (String_data *d);
- /** make sure data has only one reference.
- POST: data->references == 1
- */
- void copy();
+ /** make sure data has only one reference.
+ POST: data->references == 1
+ */
+ void copy();
public:
- String_handle();
- ~String_handle();
- String_handle (String_handle const & src);
+ String_handle();
+ ~String_handle();
+ String_handle (String_handle const & src);
- Byte const* byte_C() const;
- char const* ch_C() const;
- Byte* byte_l();
- char* ch_l();
- bool is_binary_bo() const;
- void operator =(String_handle const &src);
- void operator += (char const *s);
- Byte operator[](int j) const;
+ Byte const* byte_C() const;
+ char const* ch_C() const;
+ Byte* byte_l();
+ char* ch_l();
+ bool is_binary_bo() const;
+ void operator =(String_handle const &src);
+ void operator += (char const *s);
+ Byte operator[](int j) const;
- /** Access elements. WARNING: NOT SAFE
- don't use this for loops. Use byte_C()
- */
- Byte &operator[](int j);
- void append (Byte const* byte_C, int length_i);
- void set (Byte const* byte_C, int length_i);
- void operator = (char const *p);
- void trunc (int j);
- int length_i() const;
+ /** Access elements. WARNING: NOT SAFE
+ don't use this for loops. Use byte_C()
+ */
+ Byte &operator[](int j);
+ void append (Byte const* byte_C, int length_i);
+ void set (Byte const* byte_C, int length_i);
+ void operator = (char const *p);
+ void trunc (int j);
+ int length_i() const;
};
#ifdef STRING_UTILS_INLINED
#ifndef VIRTUAL_METHODS_HH
#define VIRTUAL_METHODS_HH
- #include <typeinfo>
-#include "stdlib.h" // size_t
+#include <typeinfo>
#define classname(class_ptr) demangle_classname(typeid(*(class_ptr)))
We only do relative comparisons. Absolute comparisons break down in
degenerate cases. */
while (degree () > 0 &&
- (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1)))
- || !coefs_.top ())
+ (fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1))
+ || !coefs_.top ()))
coefs_.pop ();
}
case 3:
return solve_cubic ();
}
- assert (false);
Array<Real> s;
return s;
}
composer = "D. Scarlatti and J. D. S. Sankey";
}
-\version "1.3.70";
-
\include "scarlatti-properties.ly"
\include "scarlatti-paper.ly"
+forceStaffDown = \translator "Staff" = "down"
+forceStaffUp = \translator "Staff" = "up"
+
+
\score{
\notes \context PianoStaff <
\context Staff=up <
%a6
a''32 s fis'' s d'' s a' s d' s a s|
%a7
- r16 a' fis'8. d'16~
+ \forceStaffUp r16 a' fis'8. d'16~
%a8
d'16 g' e'8. cis'16|
%a9
\context Voice=vb< \zs
\sd
\context Thread=td{ \n
- \lh \sm[\times 2/3{d32 fis a}\n d'16]a8 a|
+ \lh \sm
+ %
+ % WARNING: interface still subject to change!
+ %
+ \property Voice. beamHeight = 5
+ [\times 2/3{d32 fis a}\n d'16]a8 a|
+ \property Voice.beamHeight = ##f
%b2
d4 s8|
%b3
%b4
r32[d fis a][d' fis' a' d'']r \rh[d fis a]
%b5
- [d'32 fis' a' d'']r32 \lh[d fis a][d' fis' a' d'']
+ [d'32 fis' a' d''] \forceStaffDown r32 \lh[d fis a][d' fis' a' d'']
%b6
s a''32 s fis'' s d'' s a' s d' s a|
%b7
+
+\version "1.3.70";
+
rh=\property Thread.noteHeadStyle=##f
lh=\property Thread.noteHeadStyle = #'diamond
n=\property Thread.fontSize=#0
\notes\relative c''{
%b2~b4~b8~b16~b32~b64 r64\break
%a2~a4~a8~a16~a32~a64 r64
- d2~d4~d8~d16~d32~d64 r64\break
- a2~a4~a8~a16~a32~a64 r64
+ \time 8/4;
+ d1 ~ d2~d4~d8~d16~d32~d64 r64\break
+ a1~ a2~a4~a8~a16~a32~a64 r64
%c2~c4~c8~c16~c32~c64 r64
}
\paper{
+++ /dev/null
-\score {
- \context Voice \notes\relative c {
-
- \times 2/3 { c''8 c c }
- \times 2/3 { c8 c'' c,, }
-
- }
- \paper { }
- \midi { }
-}
\ No newline at end of file
-\version "1.3.59"
+\version "1.3.70"
\score {
\context Voice \notes\relative c'' {
+ \times 2/3 { c'8 c,, c }
+ \times 2/3 { c'8 c'' c,, }
+
+
\times 2/3 { [c8 c c] }
\times 2/3 { c8 [c c] }
+ \times 2/3 { [c8 c c] }
+ \times 2/4 { r8 [c, c'] r8 }
+
+
+
\property Voice .tupletBracketVisibility = #'if-no-beam
\times 2/3 { [c8 c c] }
\property Voice .tupletDirection = #1
\property Voice .tupletNumberVisibility = ##f
\times 2/3 { c8 [c c] }
+
+
}
}
Align_interface::alignment_callback (Score_element *sc, Axis ax)
{
Score_element * par = sc->parent_l (ax);
- if (par && par->get_elt_property ("alignment-done") == SCM_UNDEFINED)
+ if (par && !to_boolean (par->get_elt_property ("alignment-done")))
{
Align_interface::do_side_processing (par, ax);
}
SCM prop = me->get_elt_property ("axes");
- if (prop == SCM_UNDEFINED
+ if (!gh_pair_p (prop)
|| scm_memq (sa1, prop) == SCM_BOOL_F
|| scm_memq (sa2, prop) == SCM_BOOL_F)
{
}
else
{
- g = SCM_UNDEFINED;
+ g = SCM_EOL;
}
if (!gh_string_p (g))
me->set_elt_property ("glyph", g);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
* less hairy code
* move paper vars to scm
- remove *-hs variables.
+ remove *-hs variables, and do all y-position stuff in staff-space.
*/
/* first, calculate y, dy */
Real y, dy;
-calc_default_position_and_height (me, &y, &dy);
+ calc_default_position_and_height (me, &y, &dy);
if (visible_stem_count (me))
{
if (suspect_slope_b (me, y, dy))
Real half_space = Staff_symbol_referencer::staff_space (me) / 2;
+ /* weird: why do we do calc_position_and_height () ? regardless of
+ this setting?
+
+ */
/* check for user-override of dy */
SCM s = me->remove_elt_property ("height-hs");
if (gh_number_p (s))
set_stem_length (me, y, dy);
me->set_elt_property ("y-position", gh_double2scm (y));
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
/*
}
Array<Offset> ideals;
+
+ // ugh -> use commonx
Real x0 = first_visible_stem (me)->relative_coordinate (0, X_AXIS);
Link_array<Item> stems=
Pointer_group_interface__extract_elements (me, (Item*)0, "stems");
Real lengthened = me->paper_l ()->get_var ("beam_lengthened");
Real steep = me->paper_l ()->get_var ("beam_steep_slope");
+ // ugh -> use commonx
Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS);
Real dydx = dy && dx ? dy/dx : 0;
if (damping)
{
+ // ugh -> use commonx
Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS)
- first_visible_stem (me)->relative_coordinate (0, X_AXIS);
Real dydx = dy && dx ? dy/dx : 0;
int stem_multiplicity = (Stem::flag_i (s) - 2) >? 0;
Real interbeam_f = me->paper_l ()->interbeam_f (beam_multiplicity);
+ // ugh -> use commonx
Real x0 = first_visible_stem (me)->relative_coordinate (0, X_AXIS);
Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - x0;
Real stem_y = (dy && dx ? (s->relative_coordinate (0, X_AXIS) - x0) / dx * dy : 0) + y;
Molecule
Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev)
{
+ // ugh -> use commonx
if ((next && !(next->relative_coordinate (0, X_AXIS) > here->relative_coordinate (0, X_AXIS))) ||
(prev && !(prev->relative_coordinate (0, X_AXIS) < here->relative_coordinate (0, X_AXIS))))
programming_error ("Beams are not left-to-right");
Real bdy = interbeam_f;
Real stemdx = staffline_f;
+ // ugh -> use commonx
Real dx = visible_stem_count (me) ?
last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS)
: 0.0;
Pointer_group_interface__extract_elements (me, (Item*) 0, "stems");
if (visible_stem_count (me))
{
+ // ugh -> use commonx
x0 = first_visible_stem (me)->relative_coordinate (0, X_AXIS);
dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - x0;
}
if (gh_number_p (s))
beam_y = gh_scm2double (s);
+ // ugh -> use commonx
Real x0 = first_visible_stem(beam)->relative_coordinate (0, X_AXIS);
Real dx = last_visible_stem(beam)->relative_coordinate (0, X_AXIS) - x0;
Real dydx = beam_dy && dx ? beam_dy/dx : 0;
Pointer_group_interface g (me, "stems");
g.set_interface ();
+ /*
+ why the init? No way to tell difference between default and user
+ override. */
me->set_elt_property ("height", gh_int2scm (0)); // ugh.
me->set_elt_property ("y-position" ,gh_int2scm (0));
me->set_interface (ly_symbol2scm("beam-interface"));
*/
#include <math.h>
+
#include "bezier-bow.hh"
#include "misc.hh"
#include "bezier.hh"
-#include "dimensions.hh"
-#include "direction.hh"
-#include "debug.hh"
-#include "main.hh"
-#include "lily-guile.hh"
-#include "paper-def.hh"
-
-Bezier_bow::Bezier_bow (Array<Offset> encompass, Direction dir)
+static Real F0_1 (Real x)
{
- alpha_ = 0;
- dir_ = dir;
- encompass_ = encompass;
- to_canonical_form ();
+ return M_PI /2 * atan(2 * x / M_PI);
}
-Bezier
-Bezier_bow::get_bezier () const
+Real
+slur_height (Real width, Real h_inf, Real r_0)
{
- Bezier rv = curve_;
- if (dir_ == DOWN)
- {
- rv.flip (Y_AXIS);
- }
-
- rv.rotate (alpha_);
- rv.translate (origin_);
-
- return rv;
+ return F0_1 (width * r_0 / h_inf) * h_inf;
}
-void
-Bezier_bow::to_canonical_form ()
-{
- origin_ = encompass_[0];
- translate (&encompass_, -origin_);
-
- Offset delta = encompass_.top () - encompass_[0];
- alpha_ = delta.arg ();
-
- rotate (&encompass_, -alpha_);
- if (dir_ == DOWN)
- {
- flip (&encompass_, Y_AXIS);
- }
-
- while (encompass_.size () > 1 && encompass_[1][X_AXIS] <= 0.0)
- {
- programming_error ("Degenerate bow: infinite steepness reqd");
- encompass_.del (1);
- }
-
- Real l = encompass_.top ()[X_AXIS];
- while (encompass_.size () > 1 && encompass_.top (1)[X_AXIS] >= l)
- {
- programming_error ("Degenerate bow: infinite steepness reqd");
- encompass_.del (encompass_.size ()-2);
- }
-}
+ /*
+ For small w, the height should be proportional to w, for w ->
+ infinity, the height should rise to a limit asymptotically.
-void
-Bezier_bow::set_default_bezier (Real h_inf, Real r_0)
-{
- curve_ = get_default_bezier (h_inf, r_0);
-}
+ Hence we take F(x) such that
+ F(0) = 0 , F'(0) = 1, and F(infty) = 1
+
+ and use
+
+ h = h_infinity * F(x * r_0 / h_infinity)
+
+
+ Examples:
+
+ * F(x) = pi/2 * atan (2x/pi)
+
+ * F(x) 1/alpha * x^alpha / (1 + x^alpha)
+
+ * (etc.)
+
+ [with the 2nd recipe you can determine how quickly the conversion from
+ `small' slurs to `big' slurs occurs.]
+
+ Although this might seem cand_idates to SCM-ify, it is not all clear
+ which parameters (ie. h_inf, r_0, F(.)) should be candidates for
+ this. At present h_inf and r_0 come from paper settings, but we did
+ no experiments for determining the best combinations of F, h_inf and
+ r_0.
+
+ */
-/*
- See Documentation/programmer/fonts.doc
- */
Bezier
-Bezier_bow::get_default_bezier (Real h_inf, Real r_0) const
+slur_shape (Real width, Real h_inf, Real r_0)
{
- Offset delta (encompass_.top ()[X_AXIS] - encompass_[0][X_AXIS], 0);
- Real b = delta.length ();
- Real height = get_default_height (h_inf, r_0, b);
- // urg: scmify this?
+ Bezier curve;
+ Real height = slur_height (width, h_inf, r_0);
Real indent = height;
- Bezier curve;
curve.control_[0] = Offset (0, 0);
curve.control_[1] = Offset (indent, height);
- curve.control_[2] = Offset (b - indent, height);
- curve.control_[3] = Offset (b, 0);
+ curve.control_[2] = Offset (width - indent, height);
+ curve.control_[3] = Offset (width, 0);
return curve;
}
-/*
- See Documentation/programmer/fonts.doc
- */
-Real
-Bezier_bow::get_default_height (Real h_inf, Real r_0, Real b) const
-{
-
- SCM h = scm_eval (scm_listify (ly_symbol2scm ("slur-default-height"),
- gh_double2scm (h_inf),
- gh_double2scm (r_0),
- gh_double2scm (b),
- SCM_UNDEFINED));
- return gh_scm2double (h);
-}
-
}
void
-flip (Array<Offset>* arr_p, Axis a)
+scale (Array<Offset>* arr_p, Real x , Real y)
{
for (int i = 0; i < arr_p->size (); i++)
- (*arr_p)[i][a] = - (*arr_p)[i][a];
+ {
+ (*arr_p)[i][X_AXIS] = x* (*arr_p)[i][X_AXIS];
+ (*arr_p)[i][Y_AXIS] = y* (*arr_p)[i][Y_AXIS];
+ }
}
void
*/
void
-Bezier::flip (Axis a)
+Bezier::scale (Real x, Real y)
{
for (int i = CONTROL_COUNT; i--;)
- control_[i][a] = - control_[i][a];
+ {
+ control_[i][X_AXIS] = x * control_[i][X_AXIS];
+ control_[i][Y_AXIS] = y * control_[i][Y_AXIS];
+ }
}
void
{
Score_element* me = unsmob_element (smob);
do_alignment (me);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Real
{
next_origin = next_elt->get_elt_property ("break-align-symbol");
next_origin =
- (next_origin == SCM_UNDEFINED)
- ? ly_symbol2scm ("none")
- : next_origin;
+ gh_symbol_p (next_origin)?
+ next_origin : ly_symbol2scm ("none")
+;
}
else
next_origin = ly_symbol2scm ("begin-of-note");
{
Score_element *sc = unsmob_element (smob);
SCM style = sc->get_elt_property ("style");
- if (style == SCM_UNDEFINED)
+
+ if (!gh_string_p (style))
style = ly_str02scm ("banter");
SCM inversion = sc-> get_elt_property ("inversion");
- if (inversion == SCM_UNDEFINED)
+ if (inversion != SCM_BOOL_T)
inversion = SCM_BOOL_F;
SCM bass = sc->get_elt_property ("bass");
- if (bass == SCM_UNDEFINED)
+ if (bass != SCM_BOOL_T)
bass = SCM_BOOL_F;
SCM pitches = sc->get_elt_property ("pitches");
-
SCM text = scm_eval (gh_list (ly_symbol2scm ("chord::user-name"),
style,
ly_quote_scm (pitches),
/*
+
clef-engraver.cc -- implement Clef_engraver
source file of the GNU LilyPond music typesetter
else
{
s->suicide ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
bool
void
Crescendo::set_interface (Score_element*s)
{
- s->set_elt_property ("dynamic-drul", gh_cons (SCM_UNDEFINED, SCM_UNDEFINED));
+ s->set_elt_property ("dynamic-drul", gh_cons (SCM_EOL, SCM_EOL));
}
JUNKME
*/
Real
-calc_interstaff_dist (Item const *item, Spanner const *span)
+calc_interstaff_dist (Item *item, Spanner *span)
{
Real interstaff = 0.0;
Score_element *common = item->common_refpoint (span, Y_AXIS);
if (gh_pair_p (threshold))
interstaff = gh_scm2double (gh_car (threshold));
- Score_element const * span_refpoint = span;
+ Score_element * span_refpoint = span;
while (span_refpoint->parent_l (Y_AXIS) != common)
span_refpoint = span_refpoint->parent_l (Y_AXIS);
- Score_element const * note_refpoint = item;
+ Score_element * note_refpoint = item;
while (note_refpoint->parent_l (Y_AXIS) != common)
note_refpoint = note_refpoint->parent_l (Y_AXIS);
int span_prio =
- Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element const*> (span_refpoint));
+ Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element *> (span_refpoint));
int item_prio =
- Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element const *> (note_refpoint));
+ Align_interface::get_count (common,(Score_element*) dynamic_cast<Score_element *> (note_refpoint));
/*
our staff is lower -> interstaff *= -1
dots.sort (compare_position);
if (dots.size () < 2)
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
Slice s;
s.set_empty ();
}
if (!conflicts)
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
int middle = s.center ();
/*
Staff_symbol_referencer::set_position (d,pos);
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
bool
gh_double2scm (infinity_f)));
dynamic_cast<Item*>(me)->column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
#include "lily-proto.hh"
#include "lily-guile.hh"
-/**
- Implement bow specific bezier curve. Calculate bezier curve for bow
- from bow paratime_signatures. */
-class Bezier_bow
-{
-public:
- Bezier_bow (Array<Offset> encompass, Direction dir);
-
- Bezier get_bezier () const;
- Bezier get_default_bezier (Real h_inf, Real r_0) const;
- Real get_default_height (Real h_inf, Real r_0, Real length) const;
- void set_default_bezier (Real h_inf, Real r_0);
-
- /**
- The canonical bezier.
- */
- Bezier curve_;
-
-protected:
- Array<Offset> encompass_;
-
-private:
- void to_canonical_form ();
- Direction dir_;
- Real alpha_;
- Offset origin_;
-};
+
+
+Bezier slur_shape (Real width, Real height_limit,
+ Real height_proportion);
+Real slur_height (Real width, Real height_limit, Real height_proportion);
#endif /* BEZIER_BOW_HH */
{
public:
void assert_sanity () const;
- void flip (Axis);
+ void scale (Real x,Real y);
void reverse ();
void rotate (Real);
void translate (Offset);
Offset control_[4];
};
-void flip (Array<Offset>* arr_p, Axis a);
+void scale (Array<Offset>* arr_p, Real xscale, Real yscale);
void rotate (Array<Offset>* arr_p, Real phi);
void translate (Array<Offset>* arr_p, Offset o);
#define CROSS_STAFF_HH
#include "lily-proto.hh"
Real
-calc_interstaff_dist (Item const *item, Spanner const *span);
+calc_interstaff_dist (Item *item, Spanner *span);
#endif /* CROSS_STAFF_HH */
*/
Lookup * lookup_l_;
- /**
- properties specific for this element. Destructor will not call
- scm_unprotect, so as to allow more flexible GC arrangements. The
- real alist is in (cdr element_property_alist_), to reduce the
- need for more scm_protect calls.
-
- */
-public: // ugh.
+public:
SCM immutable_property_alist_;
SCM mutable_property_alist_;
-
-public:
Score_element *original_l_;
/**
#include "bezier-bow.hh"
-class Slur_bezier_bow : public Bezier_bow
+class Slur_bezier_bow
{
+
+protected:
+ Array<Offset> encompass_;
+
+private:
+ void to_canonical_form ();
+ Direction dir_;
+ Real alpha_;
+ Offset origin_;
+ Real h_inf_, r_0_;
public:
- Slur_bezier_bow (Array<Offset> encompass, Direction dir);
- Array<Real> area_x_gradients_array (Real area);
+ /**
+ The canonical bezier.
+ */
+ Bezier curve_;
+
+
+ Slur_bezier_bow (Array<Offset> encompass, Direction dir,
+ Real hinf, Real r0);
+ Bezier get_bezier () const;
+
+ void minimise_enclosed_area (Paper_def* paper_l);
+ Real fit_factor () const;
void blow_fit ();
Real enclosed_area_f () const;
- Real fit_factor () const;
- void minimise_enclosed_area (Paper_def* paper_l, Real default_height);
+private:
+ Array<Real> area_x_gradients_array (Real area);
};
#endif /* SLUR_BEZIER_BOW_HH */
static Score_element * staff_symbol_l (Score_element*);
static int line_count (Score_element*);
static Real position_f (Score_element*);
+ static Real staff_radius (Score_element*);
};
int compare_position (Score_element *const&,Score_element *const&);
public:
static void set_interface (Score_element*me);
static bool has_interface (Score_element*);
- static void add_tie (Score_element*me,Tie*);
+ static void add_tie (Score_element*me,Score_element*);
static SCM after_line_breaking (SCM);
static void set_directions (Score_element*me);
};
#ifndef TIE_HH
#define TIE_HH
-#include "spanner.hh"
-#include "rod.hh"
+#include "lily-guile.hh"
+#include "lily-proto.hh"
-/**
- Connect two noteheads.
- */
-class Tie : public Spanner
+class Tie
{
public:
- Tie (SCM);
static void set_head (Score_element*,Direction, Item*head_l);
static void set_interface (Score_element*);
static bool has_interface (Score_element*);
- VIRTUAL_COPY_CONS(Score_element);
static Score_element * head (Score_element*,Direction) ;
static Real position_f (Score_element*) ;
static SCM brew_molecule (SCM);
static Direction get_default_dir(Score_element*) ;
- static SCM after_line_breaking (SCM);
-
-
- /*
- JUNKME
- */
- Array<Offset> get_encompass_offset_arr () const;
- Bezier get_curve () const;
- Drul_array<Real> dy_f_drul_;
- Drul_array<Real> dx_f_drul_;
+ static SCM get_control_points (SCM);
static SCM set_spacing_rods (SCM);
- Array<Offset> get_controls () const;
};
#endif // TIE_HH
Real den = (N*sqx - sqr (sx));
if (!N || !den)
- programming_error ("minimise_least_squares(): Nothing to minimise");
-
- *coef = (N * sxy - sx*sy)/den;
- *offset = (sy - (*coef) * sx)/N;
+ {
+ programming_error ("minimise_least_squares(): Nothing to minimise");
+ *coef = 0.0;
+ *offset = N ? sy/N : 0.0;
+ }
+ else
+ {
+ *coef = (N * sxy - sx*sy)/den;
+ *offset = (sy - (*coef) * sx)/N;
+ }
}
+
}
#endif
+SCM
+undefd ()
+{
+ return SCM_UNDEFINED;
+}
+
static void
init_functions ()
{
scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file);
scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p);
+ scm_make_gsubr ("undefd", 0,0, 0, (SCM(*)(...))undefd);
scm_make_gsubr ("ly-number->string", 1, 0,0, (SCM(*)(...)) ly_number2string);
return l;
}
+
Local_key_item::before_line_breaking (SCM smob)
{
Local_key_item* me = dynamic_cast<Local_key_item*>(unsmob_element (smob));
-
-
me->accidental_arr_.sort (Local_key_cautionary_tuple::compare);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Molecule
bool oct_b = false;
int lastoct = -100;
- for (int i = 0; i < lki->accidental_arr_.size(); i++)
+ for (int i = 0; i < lki->accidental_arr_.size(); i++)
{
Musical_pitch p (lki->accidental_arr_[i].pitch_);
// do one octave
gh_int2scm (cm->code),
SCM_UNDEFINED));
+
at= fontify_atom (afm_l_,at);
return Molecule ( afm_bbox_to_box (cm->charBBox), at);
}
String p = prefix + to_str ('/') + String (*s);
global_path.add (p);
- /* Urg: GNU make's $(word) index starts at 1 */
- int i = 1;
- while (global_path.try_add (p + to_str (".") + to_str (i)))
- i++;
}
}
if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
{
programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Item * l = sp->get_bound (LEFT)->column_l ();
rod.add_to_cols ();
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
for (int i = scope_l_arr_.size (); i--; )
if (scope_l_arr_[i]->elem_b (sym))
return scope_l_arr_[i]->scm_elem(sym);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
: (abs((int)p) - sz) /2;
SCM style = me->get_elt_property ("style");
- if (style == SCM_UNDEFINED)
+ if (!gh_symbol_p (style))
{
style = ly_symbol2scm("default");
}
+
+ // ugh: use gh_call ()
Molecule out = me->lookup_l()->afm_find (String ("noteheads-") +
ly_scm2string (scm_eval (gh_list (ly_symbol2scm("find-notehead-symbol"),
me->get_elt_property ("duration-log"),
SCM elt_prop_sym = gh_caddr (entry);
SCM preset = e->get_elt_property (elt_prop_sym); // scm_assq(elt_prop_sym, e->property_alist_);
- if (preset != SCM_UNDEFINED)
+ if (preset != SCM_EOL)
continue;
SCM val = get_property (prop_sym);
// no rests to collide
if (!rests.size())
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
// no partners to collide with
if (rests.size() + notes.size () < 2)
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
// meisjes met meisjes
if (!notes.size())
Interval restdim = Note_column::rest_dim (rcol);
if (restdim.empty_b ())
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
// staff ref'd?
Real staff_space = me->paper_l()->get_var ("interline");
Note_column::translate_rests (rcol,dir * discrete_dist);
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
gh_int2scm ((bt == 7) ? 4 : 3));
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
return gh_cdr (s);
s = scm_sloppy_assq (sym, immutable_property_alist_);
- return (s == SCM_BOOL_F) ? SCM_UNDEFINED : gh_cdr (s);
+ return (s == SCM_BOOL_F) ? SCM_EOL : gh_cdr (s);
}
/*
Score_element::remove_elt_property (const char* key)
{
SCM val = get_elt_property (key);
- if (val != SCM_UNDEFINED)
- set_elt_property (key, SCM_UNDEFINED);
+ if (val != SCM_EOL)
+ set_elt_property (key, SCM_EOL);
return val;
}
{
error ("Not a symbol");
ly_display_scm (sym);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
if (sc)
ly_display_scm (elt);
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
error ("Not a score element");
ly_display_scm (elt);
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
Script_column_engraver::acknowledge_element( Score_element_info inf)
{
- if (Side_position::has_interface (inf.elem_l_))
+ if (Side_position::has_interface (inf.elem_l_)) // ugh FIXME
{
Item *thing = dynamic_cast<Item*> (inf.elem_l_);
if (thing
} while (flip (&d) != DOWN);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Direction d = Side_position::get_direction (me);
Side_position::set_direction (me,d);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
MAKE_SCHEME_CALLBACK(Script,brew_molecule);
it->suicide ();
}
me->suicide ();
- return SCM_UNDEFINED ;
+ return SCM_UNSPECIFIED ;
}
void
void
Side_position::set_axis (Score_element*me, Axis a)
{
+ /*
// prop transparent ?
if (me->get_elt_property ("side-support-elements") == SCM_UNDEFINED)
me->set_elt_property ("side-support-elements" ,SCM_EOL);
-
+ */
if (!me->has_offset_callback_b (aligned_side, a))
me->add_offset_callback (aligned_side, a);
}
bool
Side_position::has_interface (Score_element*me)
{
- return me->get_elt_property ("side-support-elements") != SCM_UNDEFINED;
+ return me->get_elt_property ("side-support-elements") != SCM_EOL;
}
bool
Side_position::supported_b (Score_element*me)
{
- SCM s =me->get_elt_property ("side-support-elements");
+ SCM s = me->get_elt_property ("side-support-elements");
return s != SCM_UNDEFINED && s != SCM_EOL;
}
#include "slur-bezier-bow.hh"
#include "main.hh"
-Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir)
- : Bezier_bow (encompass, dir)
+Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir,
+ Real h_inf, Real r_0)
{
+ h_inf_ = h_inf;
+ r_0_ = r_0;
+ alpha_ = 0;
+ dir_ = dir;
+ encompass_ = encompass;
+ to_canonical_form ();
+
+ Real w = encompass_.top ()[X_AXIS] - encompass_[0][X_AXIS];
+ curve_ = slur_shape (w, h_inf, r_0);
}
+Bezier
+Slur_bezier_bow::get_bezier () const
+{
+ Bezier rv = curve_;
+ if (dir_ == DOWN)
+ {
+ rv.scale (1, -1);
+ }
+
+ rv.rotate (alpha_);
+ rv.translate (origin_);
+
+ return rv;
+}
+
+void
+Slur_bezier_bow::to_canonical_form ()
+{
+ origin_ = encompass_[0];
+ translate (&encompass_, -origin_);
+
+ Offset delta = encompass_.top () - encompass_[0];
+ alpha_ = delta.arg ();
+
+ rotate (&encompass_, -alpha_);
+ if (dir_ == DOWN)
+ {
+ scale (&encompass_, 1, -1);
+ }
+
+ while (encompass_.size () > 1 && encompass_[1][X_AXIS] <= 0.0)
+ {
+ programming_error ("Degenerate bow: infinite steepness reqd");
+ encompass_.del (1);
+ }
+
+ Real l = encompass_.top ()[X_AXIS];
+ while (encompass_.size () > 1 && encompass_.top (1)[X_AXIS] >= l)
+ {
+ programming_error ("Degenerate bow: infinite steepness reqd");
+ encompass_.del (encompass_.size ()-2);
+ }
+}
+
+
+
void
Slur_bezier_bow::blow_fit ()
{
return da;
}
+/*
+ ugh, should have another look, and use a regular optimization
+ algorithm, instead of this homebrew.
+*/
void
-Slur_bezier_bow::minimise_enclosed_area (Paper_def* paper_l,
- Real default_height)
+Slur_bezier_bow::minimise_enclosed_area (Paper_def* paper_l)
{
Real length = curve_.control_[3][X_AXIS];
+
Real sb = paper_l->get_var ("slur_beautiful");
- Real beautiful = length * default_height * sb;
+ Real beautiful = sb * length * slur_height (length, h_inf_, r_0_);
DEBUG_OUT << to_str ("Beautiful: %f\n", beautiful);
DEBUG_OUT << to_str ("Length: %f\n", length);
- DEBUG_OUT << to_str ("D-height: %f\n", default_height);
+ // DEBUG_OUT << to_str ("D-height: %f\n", default_height);
DEBUG_OUT << to_str ("FitFac: %f\n", fit_factor ());
if (fit_factor () > 1.0)
void
Slur::set_interface (Score_element*me)
{
- me-> set_elt_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
- me->set_elt_property ("note-columns", SCM_EOL);
- me->set_elt_property ("control-points", SCM_EOL);
+ me->set_elt_property ("attachment", gh_cons (SCM_BOOL_F, SCM_BOOL_F));
me->set_interface (ly_symbol2scm ("slur-interface"));
}
Score_element *me = unsmob_element (smob);
set_extremities (me);
set_control_points (me);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
Spanner*sp = dynamic_cast<Spanner*>(me);
r.item_l_drul_[LEFT] = sp->get_bound (LEFT);
r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT);
- r.distance_f_ = me->paper_l ()->get_var ("slur_x_minimum");
+ r.distance_f_ =
+ gh_scm2double (me->get_elt_property ("minimum-length"))
+ * me->paper_l ()->get_var ("staffspace");
r.add_to_cols ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Slur::brew_molecule (SCM smob)
{
Score_element * me = unsmob_element (smob);
- Real thick = me->paper_l ()->get_var ("slur_thickness");
+ Real thick = me->paper_l ()->get_var ("stafflinethickness") *
+ gh_scm2double (me->get_elt_property ("thickness"));
Bezier one = get_curve (me);
Molecule a;
void
Slur::set_control_points (Score_element*me)
{
- Slur_bezier_bow bb (get_encompass_offset_arr (me),
- Directional_element_interface (me).get ());
-
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real h_inf = me->paper_l ()->get_var ("slur_height_limit_factor") * staff_space;
+ Real staff_space = Staff_symbol_referencer::staff_space ((Score_element*)me);
+ Real h_inf = me->paper_l ()->get_var ("slur_height_limit_factor") *
+ staff_space;
Real r_0 = me->paper_l ()->get_var ("slur_ratio");
-
- bb.set_default_bezier (h_inf, r_0);
+
+ Slur_bezier_bow bb (get_encompass_offset_arr (me),
+ Directional_element_interface (me).get (),
+ h_inf, r_0);
if (bb.fit_factor () > 1.0)
{
Real length = bb.curve_.control_[3][X_AXIS];
- Real default_height = bb.get_default_height (h_inf, r_0, length);
- bb.minimise_enclosed_area (me->paper_l(), default_height);
+ Real default_height = slur_height (length, h_inf, r_0);
+ bb.minimise_enclosed_area (me->paper_l());
Real bff = me->paper_l ()->get_var ("slur_force_blowfit");
bb.curve_.control_[1][Y_AXIS] *= bff;
farewell, cruel world
*/
me->suicide ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
evaluate_empty (unsmob_element (smob));
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Real
me->add_offset_callback (callback, Y_AXIS);
}
+/*
+ half of the height, in staff space.
+ */
+Real
+Staff_symbol_referencer::staff_radius (Score_element*me)
+{
+ return (line_count (me) -1) / 2;
+}
+
int
compare_position (Score_element *const &a, Score_element * const &b)
}
set_spacing_hints (me);
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
System_start_delimiter::after_line_breaking (SCM smob)
{
try_collapse (unsmob_element (smob));
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
void
*/
+#include "spanner.hh"
#include "tie-column.hh"
#include "group-interface.hh"
#include "tie.hh"
void
Tie_column::set_interface (Score_element*me)
{
- me-> set_elt_property ("ties", SCM_EOL);
me->set_interface (ly_symbol2scm ("tie-column"));
me->set_extent_callback (0, X_AXIS);
me->set_extent_callback (0, Y_AXIS);
}
void
-Tie_column::add_tie (Score_element*me,Tie *s)
+Tie_column::add_tie (Score_element*me,Score_element *s)
{
Pointer_group_interface g (me, "ties");
if (!g.count ())
int
-tie_compare (Tie* const & s1,
- Tie* const & s2)
+tie_compare (Score_element* const & s1,
+ Score_element* const & s2)
{
return sign (Tie::position_f (s1) - Tie::position_f(s2));
}
void
Tie_column::set_directions (Score_element*me)
{
- Link_array<Tie> ties =
- Pointer_group_interface__extract_elements (me, (Tie*)0, "ties");
+ Link_array<Score_element> ties =
+ Pointer_group_interface__extract_elements (me, (Score_element*)0, "ties");
Direction d = Directional_element_interface (me).get ();
{
for (int i = ties.size (); i--;)
{
- Tie * t = ties[i];
+ Score_element * t = ties[i];
Directional_element_interface (t).set (d);
}
return;
if (ties.size () == 1)
{
- Tie * t = ties[0];
+ Score_element * t = ties[0];
Directional_element_interface (t).set (Tie::get_default_dir (t));
return;
}
for (int i=ties.size(); i--; )
{
- Tie * t = ties[i];
+ Score_element * t = ties[i];
Real p = Tie::position_f (t);
Direction d = (Direction) sign (p);
if (!d)
Tie_column::after_line_breaking (SCM smob)
{
set_directions (unsmob_element (smob));
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
#include "musical-request.hh"
#include "tie.hh"
#include "translator-group.hh"
+#include "spanner.hh"
#include "tie-column.hh"
#include "pqueue.hh"
#include "engraver.hh"
Tie_req *req_l_;
Array<CHead_melodic_tuple> now_heads_;
Array<CHead_melodic_tuple> stopped_heads_;
- Link_array<Tie> tie_p_arr_;
+ Link_array<Score_element> tie_p_arr_;
Spanner * tie_column_p_;
SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
- Tie * p = new Tie (basic);
+ Spanner * p = new Spanner (basic);
Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
}
else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
{
- Tie * p = new Tie (basic);
+ Score_element * p = new Spanner (basic);
Tie::set_interface (p);
Tie::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
*/
#include <math.h>
+#include "spanner.hh"
#include "lookup.hh"
#include "paper-def.hh"
#include "tie.hh"
#include "bezier-bow.hh"
#include "stem.hh"
+/*
+ tie: Connect two noteheads.
+
+ What if we have
+
+ c4 ~ \clef bass ; c4 or
+
+ c4 \staffchange c4
+
+ do we have non-horizontal ties then?
+ */
+
+
void
Tie::set_head (Score_element*me,Direction d, Item * head_l)
{
me->add_dependency (head_l);
}
-Tie::Tie(SCM s)
- : Spanner (s)
-{
- dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
- dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
-}
void
Tie::set_interface (Score_element*me)
{
me->set_elt_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
me->set_interface (ly_symbol2scm ("tie-interface"));
}
+
bool
Tie::has_interface (Score_element*me)
{
/*
- ugh: direction of the Tie is more complicated. See [Ross] p136 and further
- */
+ The direction of the Tie is more complicated (See [Ross] p136 and
+ further), the case of multiple ties is handled by Tie_column.
+*/
Direction
Tie::get_default_dir (Score_element*me)
{
}
-
-MAKE_SCHEME_CALLBACK(Tie,after_line_breaking);
SCM
-Tie::after_line_breaking (SCM smob)
-{
- Tie*me = dynamic_cast<Tie*> (unsmob_element (smob));
-
- if (!head (me,LEFT) && !head (me,RIGHT))
+Tie::get_control_points (SCM smob)
+{
+ Spanner*me = dynamic_cast<Spanner*> (unsmob_element (smob));
+ Direction headdir = CENTER;
+ if (head (me,LEFT))
+ headdir = LEFT;
+ else if (head(me,RIGHT))
+ headdir = RIGHT;
+ else
{
programming_error ("Tie without heads.");
me->suicide ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
-
+
if (!Directional_element_interface (me).get ())
Directional_element_interface (me).set (Tie::get_default_dir (me));
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real half_space = staff_space / 2;
- Real x_gap_f = me->paper_l ()->get_var ("tie_x_gap");
- Real y_gap_f = me->paper_l ()->get_var ("tie_y_gap");
- /*
- Slur and tie placement [OSU]
+ Real x_gap_f = me->paper_l ()->get_var ("tie_x_gap");
- Ties:
+ Score_element* commonx = me->common_refpoint (me->get_bound (LEFT), X_AXIS);
+ commonx = me->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+
+ Score_element* l = me->get_bound (LEFT);
+ Score_element* r = me->get_bound (RIGHT);
+ Real width = r->relative_coordinate (commonx, X_AXIS)
+ + r->extent (X_AXIS)[LEFT]
+ - l->relative_coordinate (commonx, X_AXIS)
+ - l->extent (X_AXIS)[RIGHT]
+ -2* x_gap_f;
+
+ Real left_x = l->extent (X_AXIS)[RIGHT] + x_gap_f;
+
+ Direction dir = Directional_element_interface (me).get();
+
+ Real h_inf = me->paper_l ()->get_var ("tie_height_limit_factor") * staff_space;
+ Real r_0 = me->paper_l ()->get_var ("tie_ratio");
- * x = inner vertical tangent - d * gap
- */
+ Bezier b = slur_shape (width, h_inf, r_0);
+
+ Offset leave_dir = b.control_[1] - b.control_[0];
+ Real dx = (head (me, headdir)->extent (X_AXIS).length () + x_gap_f)/2.0;
+ Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
/*
- OSU: not different for outer notes, so why all me code?
- ie, can we drop me, or should it be made switchable.
- */
- if (head (me,LEFT))
- me->dx_f_drul_[LEFT] = Tie::head (me,LEFT)->extent (X_AXIS).length ();
- else
- me->dx_f_drul_[LEFT] = dynamic_cast<Spanner*>(me)->get_broken_left_end_align ();
- me->dx_f_drul_[LEFT] += x_gap_f;
- me->dx_f_drul_[RIGHT] -= x_gap_f;
+ for small ties (t small) we want to start in the Y-center (so dy = 0), for
+ large ties, the tie should appear to come from the center of the
+ head, so dy = max_gap
- /*
- Slur and tie placement [OSU] -- check me
+ maybe use a different formula?
- Ties:
+ TODO: what if 2 heads have different size.
- * y = dx < 5ss: horizontal tangent
- y = dx >= 5ss: y next interline - d * 0.25 ss
+ TODO: for small ties, it is better to start over the heads
+ iso. next to the heads.
+ */
+ Real t = (width / staff_space - 5.0); // ugh.
+ Real dy = t > 0 ? max_gap * sqr (t / (1 + t)) : 0.0;
- which probably means that OSU assumes that
+ Real ypos = Tie::position_f (me) * staff_space/2 + dir * dy;
- dy <= 5 dx
+ /*
+ todo: prevent ending / staffline collision.
- for smal slurs
+ todo: tie / stem collision
*/
+ b = slur_shape(width,h_inf, r_0);
+ b.scale (1, dir);
+ b.translate (Offset (left_x, ypos));
+
- Real ypos = Tie::position_f (me);
+ /*
+ Avoid colliding of the horizontal part with stafflines.
+
+ should do me for slurs as well.
- Real y_f = half_space * ypos;
- int ypos_i = int (ypos);
-
- Real dx_f = me->extent (X_AXIS).length () + me->dx_f_drul_[RIGHT] - me->dx_f_drul_[LEFT];
- Direction dir = Directional_element_interface (me).get();
- if (dx_f < me->paper_l ()->get_var ("tie_staffspace_length"))
+ */
+ Array<Real> horizontal (b.solve_derivative (Offset (1,0)));
+ if (horizontal.size ())
{
- if (abs (ypos_i) % 2)
- y_f += dir * half_space;
- y_f += dir * y_gap_f;
+ /*
+ ugh. Doesnt work for non-horizontal curves.
+ */
+ Real y = b.curve_point (horizontal[0])[Y_AXIS];
+
+ Real ry = rint (y/staff_space) * staff_space;
+ Real diff = ry - y;
+ Real newy = y;
+ if (fabs (y) <= Staff_symbol_referencer::staff_radius (me)
+ && fabs (diff) < me->paper_l ()->get_var ("tie_staffline_clearance"))
+ {
+ newy = ry - 0.5 * staff_space * sign (diff) ;
+ }
+
+ Real y0 = b.control_ [0][Y_AXIS];
+ b.control_[2][Y_AXIS] =
+ b.control_[1][Y_AXIS] =
+ (b.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0;
}
else
- {
- if (! (abs (ypos_i) % 2))
- y_f += dir * half_space;
- y_f += dir * half_space;
- y_f -= dir * y_gap_f;
- }
-
- me->dy_f_drul_[LEFT] = me->dy_f_drul_[RIGHT] = y_f;
+ programming_error ("Tie is nowhere horizontal");
- return SCM_UNDEFINED;
-}
+ SCM controls = SCM_EOL;
+ for (int i= 4; i--;)
+ controls = gh_cons ( ly_offset2scm (b.control_[i]), controls);
+ return controls;
+}
+
MAKE_SCHEME_CALLBACK(Tie,set_spacing_rods);
+
+/*
+ TODO: set minimum distances for begin/end of line
+ */
SCM
Tie::set_spacing_rods (SCM smob)
{
r.item_l_drul_ [LEFT]=sp->get_bound (LEFT);
r.item_l_drul_ [RIGHT]=sp->get_bound (RIGHT);
- r.distance_f_ = me->paper_l ()->get_var ("tie_x_minimum");
+ r.distance_f_
+ = gh_scm2double (me->get_elt_property ("minimum-length"))
+ * me->paper_l ()->get_var ("staffspace");
r.add_to_cols ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
-
-
-
-
-
MAKE_SCHEME_CALLBACK(Tie,brew_molecule);
SCM
Tie::brew_molecule (SCM smob)
{
Score_element*me = unsmob_element (smob);
- Real thick = me->paper_l ()->get_var ("tie_thickness");
- Bezier one = dynamic_cast<Tie*> (me)->get_curve ();
- Molecule a;
- SCM d = me->get_elt_property ("dashed");
- if (gh_number_p (d))
- a = me->lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
- else
- a = me->lookup_l ()->slur (one, Directional_element_interface (me).get () * thick, thick);
+ SCM cp = me->get_elt_property ("control-points");
+ if (cp == SCM_EOL)
+ {
+ cp = get_control_points (smob);
+ me->set_elt_property ("control-points", cp);
+ }
- return a.create_scheme();
-}
-
-
+ Real thick =
+ gh_scm2double (me->get_elt_property ("thickness"))
+ * me->paper_l ()->get_var ("stafflinethickness");
-Bezier
-Tie::get_curve () const
-{
- Score_element*me = (Score_element*)this;
- Direction d (Directional_element_interface (me).get ());
- Bezier_bow b (get_encompass_offset_arr (), d);
-
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real h_inf = paper_l ()->get_var ("tie_height_limit_factor") * staff_space;
- Real r_0 = paper_l ()->get_var ("tie_ratio");
-
- b.set_default_bezier (h_inf, r_0);
- Bezier c = b.get_bezier ();
-
- /*
- Avoid colliding of the horizontal part with stafflines.
-
- should do me for slurs as well.
-
- */
- Array<Real> horizontal (c.solve_derivative (Offset (1,0)));
-
-
- if (horizontal.size ())
+ Bezier b;
+ int i = 0;
+ for (SCM s= cp; s != SCM_EOL; s = gh_cdr (s))
{
- /*
- ugh. Doesnt work for non-horizontal curves.
- */
- Real y = c.curve_point (horizontal[0])[Y_AXIS];
-
- Real ry = rint (y/staff_space) * staff_space;
- Real diff = ry - y;
- Real newy = y;
- if (fabs (y) <= 2.0
- && fabs (diff) < paper_l ()->get_var ("tie_staffline_clearance"))
- {
- newy = ry - 0.5 * staff_space * sign (diff) ;
- }
-
- Real y0 = c.control_ [0][Y_AXIS];
- c.control_[2][Y_AXIS] =
- c.control_[1][Y_AXIS] =
- (c.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0;
+ b.control_[i] = ly_scm2offset (gh_car (s));
+ i++;
}
- else
- programming_error ("Tie is nowhere horizontal");
- return c;
-}
-
-Array<Offset>
-Tie::get_encompass_offset_arr () const
-{
- Array<Offset> offset_arr;
- offset_arr.push (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
- offset_arr.push (Offset (spanner_length () + dx_f_drul_[RIGHT],
- dy_f_drul_[RIGHT]));
-
- return offset_arr;
+
+ Molecule a = me->lookup_l ()->slur (b, Directional_element_interface (me).get () * thick, thick);
+
+ return a.create_scheme ();
}
if (daddy_trans_l_)
return daddy_trans_l_->get_property (sym);
-
return SCM_UNDEFINED;
}
Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
- Score_element * common = me->common_refpoint (me->get_elt_property ("columns"), Y_AXIS);
+ Score_element * commony = me->common_refpoint (me->get_elt_property ("columns"), Y_AXIS);
+ Score_element * commonx = me->common_refpoint (me->get_elt_property ("columns"), X_AXIS);
Direction d = Directional_element_interface (me).get ();
if (l < r)
{
- *dy = column_arr[r]->extent (Y_AXIS) [d] + column_arr[r]->relative_coordinate (common, Y_AXIS)
- - column_arr[l]->extent (Y_AXIS) [d] - column_arr[l]->relative_coordinate (common, Y_AXIS);
+ *dy = column_arr[r]->extent (Y_AXIS) [d] + column_arr[r]->relative_coordinate (commony, Y_AXIS)
+ - column_arr[l]->extent (Y_AXIS) [d] - column_arr[l]->relative_coordinate (commony, Y_AXIS);
}
else
* dy = 0;
if (!column_arr.size ())
return;
- Real x0 = column_arr[0]->relative_coordinate (0, X_AXIS);
- Real x1 = column_arr.top ()->relative_coordinate (0, X_AXIS);
+ Real x0 = column_arr[0]->relative_coordinate (commonx, X_AXIS);
+ Real x1 = column_arr.top ()->relative_coordinate (commonx, X_AXIS);
Real factor = column_arr.size () > 1 ? 1/(x1 - x0) : 1.0;
for (int i = 0; i < column_arr.size (); i++)
{
- Real notey = column_arr[i]->extent (Y_AXIS)[d] +
- column_arr[i]->relative_coordinate (common, Y_AXIS)
- ;
- Real x = column_arr[i]->relative_coordinate (0, X_AXIS) - x0;
+ Real notey = column_arr[i]->extent (Y_AXIS)[d]
+ + column_arr[i]->relative_coordinate (commony, Y_AXIS)
+ - me->relative_coordinate (commony, Y_AXIS);
+
+ Real x = column_arr[i]->relative_coordinate (commonx, X_AXIS) - x0;
Real tuplety = *dy * x * factor;
if (notey * d > (*offset + tuplety) * d)
if (!column_arr.size ())
{
me->suicide ();
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
Direction d = Directional_element_interface (me).get ();
&& sp->get_bound (RIGHT)->column_l () == beam_l->get_bound (RIGHT)->column_l ())
me->set_elt_property ("parallel-beam", SCM_BOOL_T);
}
- return SCM_UNDEFINED;
+ return SCM_UNSPECIFIED;
}
/*
- me is too complicated. Yet another version of side-positioning,
+ this is too complicated. Yet another version of side-positioning,
badly implemented.
--
Real h = me->paper_l()->get_var ("volta_spanner_height");
Real t = me->paper_l ()->get_var ("volta_thick");
+ /*
+ ugh: should build from line segments.
+ */
SCM at = (gh_list (ly_symbol2scm ("volta"),
gh_double2scm (h),
gh_double2scm (w),
)
basicSlurProperties = #`(
(molecule-callback . ,Slur::brew_molecule)
- (spacing-procedure . ,Slur::set_spacing_rods)
+ (thickness . 1.2)
+ (spacing-procedure . ,Slur::set_spacing_rods) e
+ (minimum-length . 1.5)
(after-line-breaking-callback . ,Slur::after_line_breaking)
)
basicSpacingSpannerProperties =#`(
)
basicTieProperties = #`(
(molecule-callback . ,Tie::brew_molecule)
- (after-line-breaking-callback . ,Tie::after_line_breaking)
- (spacing-procedure . ,Tie::set_spacing_rods)
+ (spacing-procedure . ,Tie::set_spacing_rods)
+ (thickness . 1.2)
+ (minimum-length . 2.5)
(interfaces . (tie-interface))
)
basicTieColumnProperties = #`(
Tie parameters
%}
-tie_height_limit_factor = \slur_height_limit_factor;
+tie_height_limit_factor = 1.0 ;
tie_ratio = \slur_ratio;
-tie_thickness = \slur_thickness;
-tie_x_minimum = \staffspace + \slur_x_minimum;
% OSU: tie gap == slur gap
tie_x_gap = \slur_x_gap;
-tie_y_gap = 0.25 * \staffspace;
-% length of a tie that's a staffspace high
-tie_staffspace_length = 4.0 * \staffspace;
-
-tie_staffline_clearance = 2.0 *\tie_thickness;
-
+tie_staffline_clearance = 2.0 *\slur_thickness;
% ugh
Begin3
Title: LilyPond
-Version: 1.3.71
-Entered-date: 06JUL00
+Version: 1.3.72
+Entered-date: 09JUL00
Description:
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.3.71.tar.gz
+ 1000k lilypond-1.3.72.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.71.tar.gz
+ 1000k lilypond-1.3.72.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.71
+Version: 1.3.72
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.71.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.72.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
include $(depth)/make/stepmake.make
#
-website: fonts htmldoc examples doc++ footify
+website: fonts htmldoc examples footify
footify:
$(footify) --index=./ `$(FIND) . -maxdepth 1 -name '*.html' -print`
examples:
$(MAKE) out='www' -C input WWW
$(MAKE) out='www' -C mutopia WWW
- # arg, should not break concept of recursive make;
- # this breaks links (and dependencies, see above)
+# arg, should not break concept of recursive make;
+# this breaks links (and dependencies, see above)
+
+# don't understand this comment --hwn
+
$(PYTHON) $(buildscripts)/mutopia-index.py -o short-examples.html input/
$(PYTHON) $(buildscripts)/mutopia-index.py -o long-examples.html mutopia/
- #$(footify-all-command)
+#$(footify-all-command)
$(footify) --index=./ `$(FIND) . -name '*.html' -print`
tar --exclude='*.dvi' --exclude='*.tex' --exclude='*.ps' --exclude='*.ppm' -czf $(outdir)/examples.tar.gz *-examples.html `find input mutopia -type d -name 'out-www' -print`
-my_tfm_path=$(TFM_PATH) /tmp /tmp /tmp /tmp /tmp /tmp
localinstall:
mkdir -p $(datadir)
- $(foreach i, 1 2 3 4 5, rm -f $(datadir)/tfm.$(i); $(LN_S) $(word $(i), $(my_tfm_path)) $(datadir)/tfm.$(i) ; )
local-WWW-clean:
$(SHELL) $(depth)/buildscripts/clean-fonts.sh
TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm))
PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa))
-foo:
- @echo fof: $(FONT_FILES)
- @echo fef: $(FET_FILES)
- @echo tfm: $(TFM_FILES)
-
# Make tfm files first, log files last,
# so that normally log files aren't made twice
ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(AFM_FILES) $(TFM_FILES) $(PFA_FILES) $(LOG_FILES)
(define stem-shorten '(0.5))
(define grace-stem-shorten '(0.0))
-;; urg
-(define pi (* 2 (acos 0)))
-
-(define (slur-default-height h-inf r-0 b)
- (let ((alpha (/ (* 2.0 h-inf) pi))
- (beta (/ (* pi r-0) (* 2.0 h-inf))))
- (* alpha (atan (* beta b)))))
-
# title generic make targets
# file make/Targets.make
-.PHONY : all clean config default dist doc doc++ exe help html lib TAGS\
+.PHONY : all clean config default dist doc exe help html lib TAGS\
po
all: default
dist roll tarball: $(depth)/$(outdir)/$(distname).tar.gz\n\
distclean cleaner than clean (duh)\n\
doc update all documentation\n\
- doc++ make doc++ documentation\n\
exe update all executables\n\
help this help\n\
install install programs and data (prefix=$(prefix))\n\
local-doc:
-# Ugh. C++ specific.
-# If you're not the maintainer, there's no tarball in $(outdir)!
-# Maybe, there is one in ../releases
-doc++:
- (cd $(outdir); \
- $(SHELL) ../$(step-bindir)/tar-docxx.sh $(package)-$(TOPLEVEL_VERSION).tar.gz || \
- $(SHELL) ../$(step-bindir)/tar-docxx.sh $(release-dir)/$(package)-$(TOPLEVEL_VERSION).tar.gz)
-
-
local-dist: $(DIST_FILES) $(OUT_DIST_FILES) $(NON_ESSENTIAL_DIST_FILES)
mkdir -p $(distdir)/$(localdir)
$(LN) $(DIST_FILES) $(distdir)/$(localdir)