#include <math.h> // tanh.
-
+#include "molecule.hh"
#include "directional-element-interface.hh"
#include "beaming.hh"
#include "beam.hh"
void
Beam::add_stem (Score_element*me, Score_element*s)
{
- Pointer_group_interface gi (me, "stems");
- gi.add_element (s);
+ Pointer_group_interface:: add_element(me, "stems", s);
s->add_dependency (me);
/*
steep slope running against lengthened stem is suspect
*/
- Real ss = me->paper_l ()->get_var ("staffspace");
Real first_ideal = Stem::calc_stem_info (first_visible_stem (me)).idealy_f_;
Real last_ideal = Stem::calc_stem_info (last_visible_stem (me)).idealy_f_;
- Real lengthened = gh_scm2double (me->get_elt_property ("outer-stem-length-limit")) * ss;
+ Real lengthened = gh_scm2double (me->get_elt_property ("outer-stem-length-limit"));
Real steep = gh_scm2double (me->get_elt_property ("slope-limit"));
// ugh -> use commonx
int beam_multiplicity = get_multiplicity (me);
int stem_multiplicity = (Stem::flag_i (s) - 2) >? 0;
- Real staffspace = me->paper_l ()->get_var ("staffspace");
-
SCM space_proc = me->get_elt_property ("space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (beam_multiplicity));
- Real thick = gh_scm2double (me->get_elt_property ("thickness")) *staffspace;
- Real interbeam_f = gh_scm2double (space) * staffspace;
+ Real thick = gh_scm2double (me->get_elt_property ("thickness")) ;
+ Real interbeam_f = gh_scm2double (space) ;
// ugh -> use commonx
Real x0 = first_visible_stem (me)->relative_coordinate (0, X_AXIS);
SCM proc = me->get_elt_property ("height-quants");
SCM quants = gh_call2 (proc, me->self_scm (),
gh_double2scm (me->paper_l ()->get_var ("stafflinethickness")
- / me->paper_l ()->get_var ("staffspace")));
+ / 1.0));
for (SCM s = quants; gh_pair_p (s); s = gh_cdr (s))
Real staffline_f = me->paper_l ()->get_var ("stafflinethickness");
int multiplicity = get_multiplicity (me);
- Real staffspace =me->paper_l ()->get_var ("staffspace");
SCM space_proc = me->get_elt_property ("space-function");
SCM space = gh_call1 (space_proc, gh_int2scm (multiplicity));
- Real thick = gh_scm2double (me->get_elt_property ("thickness")) *staffspace;
- Real interbeam_f = gh_scm2double (space) * staffspace;
+ Real thick = gh_scm2double (me->get_elt_property ("thickness")) ;
+ Real interbeam_f = gh_scm2double (space) ;
Real bdy = interbeam_f;
Real stemdx = staffline_f;
SCM proc = me->get_elt_property ("flag-width-function");
SCM result = gh_call1 (proc, gh_int2scm (t));
- nw_f = gh_scm2double (result) * staffspace;
+ nw_f = gh_scm2double (result);
}
w = w/2 <? nw_f;
Molecule a;
if (lhalfs) // generates warnings if not
- a = me->lookup_l ()->beam (dydx, w, thick);
+ a = Lookup::beam (dydx, w, thick);
a.translate (Offset (-w, -w * dydx));
for (int j = 0; j < lhalfs; j++)
{
int rwholebeams= Stem::beam_count (here,RIGHT) <? Stem::beam_count (next,LEFT) ;
Real w = next->relative_coordinate (0, X_AXIS) - here->relative_coordinate (0, X_AXIS);
- Molecule a = me->lookup_l ()->beam (dydx, w + stemdx, thick);
+ Molecule a = Lookup::beam (dydx, w + stemdx, thick);
a.translate_axis( - stemdx/2, X_AXIS);
int j = 0;
Real gap_f = 0;
// TODO: notehead widths differ for different types
gap_f = nw_f / 2;
w -= 2 * gap_f;
- a = me->lookup_l ()->beam (dydx, w + stemdx, thick);
+ a = Lookup::beam (dydx, w + stemdx, thick);
}
for (; j < rwholebeams; j++)
w = w/2 <? nw_f;
if (rhalfs)
- a = me->lookup_l ()->beam (dydx, w, thick);
+ a = Lookup::beam (dydx, w, thick);
for (; j < rwholebeams + rhalfs; j++)
{
mol.translate_axis (x0
- dynamic_cast<Spanner*> (me)->get_bound (LEFT)->relative_coordinate (0, X_AXIS), X_AXIS);
- return mol.create_scheme ();
+ return mol.smobbed_copy ();
}
int
Real beamy = (stem->relative_coordinate (0, X_AXIS) - x0) * dydx + beam_y;
Real staff_space = Staff_symbol_referencer::staff_space (rest);
- Real rest_dim = rest->extent (Y_AXIS)[d]*2.0 / staff_space ;
+
+
+ Real rest_dim = rest->extent (rest, Y_AXIS)[d]*2.0 / staff_space ; // refp??
Real minimum_dist
= gh_scm2double (rest->get_elt_property ("minimum-beam-collision-distance"));