this shows the demerits of a user-defined beam position pair.
* scm/define-grobs.scm (all-grob-descriptions): set
beamed-extreme-minimum-free-lengths to a different value.
* lily/scm-option.cc: add debug-beam scm-option
2004-01-04 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/beam-quanting.cc (quanting): add inspect-quants property:
+ this shows the demerits of a user-defined beam position pair.
+
+ * scm/define-grobs.scm (all-grob-descriptions): set
+ beamed-extreme-minimum-free-lengths to a different value.
+
+ * lily/scm-option.cc: add debug-beam scm-option
+
* mf/feta-bolletjes.mf (overdone_heads): fix stem attachments.
2004-01-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Axis_group_interface::add_element (staffline_, e);
}
-////////////////////////////////////////////////////////
-// maybenot such a good idea after all., to put classes in .cc
+/****************************************************************/
+
+/*
+
+ maybenot such a good idea after all., to put class declarations in
+ .cc
+
+*/
#include "hara-kiri-group-spanner.hh"
#include "rhythmic-head.hh"
#include <math.h>
+#include "warn.hh"
#include "grob.hh"
#include "staff-symbol-referencer.hh"
#include "beam.hh"
const int MUSICAL_DIRECTION_FACTOR = 400;
const int IDEAL_SLOPE_FACTOR = 10;
-#define DEBUG_QUANTING 1
-
+// #define DEBUG_QUANTING 1
+extern bool debug_beam_quanting_flag;
static Real
shrink_extra_weight (Real x, Real fac)
int best_idx = best_quant_score_idx (qscores);
+
+#if DEBUG_QUANTING
+ SCM inspect_quants = me->get_grob_property ("inspect-quants");
+ if (debug_beam_quanting_flag
+ && gh_pair_p (inspect_quants))
+ {
+ Real il = gh_scm2double (gh_car (inspect_quants));
+ Real ir = gh_scm2double (gh_cdr (inspect_quants));
+
+ int i = 0;
+
+ Real mindist = 1e6;
+ for (; i < qscores.size(); i ++)
+ {
+ Real d =fabs (qscores[i].yl-il) + fabs (qscores[i].yr - ir);
+ if (d < mindist)
+ {
+ best_idx = i;
+ mindist= d;
+ }
+ }
+ if (mindist > 1e5)
+ programming_error ("Could not find quant.");
+ else
+ qscores[best_idx].score_card_ += to_string ("i%d", best_idx);
+ }
+#endif
me->set_grob_property ("positions",
gh_cons (gh_double2scm (qscores[best_idx].yl),
- gh_double2scm (qscores[best_idx].yr))
- );
-
+ gh_double2scm (qscores[best_idx].yr)));
#if DEBUG_QUANTING
- // debug quanting
- me->set_grob_property ("quant-score",
- scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
- me->set_grob_property ("best-idx", scm_int2num (best_idx));
+ if (debug_beam_quanting_flag)
+ {
+ // debug quanting
+ me->set_grob_property ("quant-score",
+ scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
+ }
#endif
return SCM_UNSPECIFIED;
#define DEBUG_QUANTING 1
+bool debug_beam_quanting_flag;
+
#if DEBUG_QUANTING
#include "text-item.hh" // debug output.
the_beam.translate_axis (pos[LEFT], Y_AXIS);
#if (DEBUG_QUANTING)
+ if (debug_beam_quanting_flag)
{
/*
This code prints the demerits for each beam. Perhaps this
{
lily_1_8_relative = false;
}
+ else if (var == ly_symbol2scm ("debug-beam"))
+ {
+ extern bool debug_beam_quanting_flag;
+ debug_beam_quanting_flag = true;
+ }
else
{
warning (_("Unknown internal option!"));
(auto-knee-gap . 5.5)
;; only for debugging.
- (font-name . "cmr10")
+ (font-family . roman)
(space-function . ,Beam::space_function)
(meta . ((interfaces . (staff-symbol-referencer-interface beam-interface spanner-interface))))
;; FIXME this should come from 'lengths
- (beamed-lengths . (3.26 3.26 1.5))
-; (beamed-lengths . (3.5 3.5 3.5 4.5 5.0))
+; (beamed-lengths . (3.26 3.26 1.5))
+ (beamed-lengths . (3.5 3.5 3.5 4.5 5.0))
;; We use the normal minima as minimum for the ideal lengths,
;; and the extreme minima as abolute minimum length.
(beamed-minimum-free-lengths . (1.83 1.5 1.25))
;; The 'extreme case' minima
- (beamed-extreme-minimum-free-lengths . (2.5 2.0 1.0))
+ (beamed-extreme-minimum-free-lengths . (2.0 1.25))
(X-offset-callbacks . (,Stem::off_callback))
(X-extent-callback . ,Stem::dim_callback)