--- /dev/null
+\header {
+ texidoc = "This file profiles property accesses; the log file shows the top properties examined."
+}
+
+
+#(ly:set-option 'profile-property-accesses #t)
+
+\version "2.10.8"
+
+\include "../../input/typography-demo.ly"
+%\book { \score { {c4 } } }
+
+#(define (prop-stats>? x y) (> (cdr x) (cdr y)))
+
+#(define (display-stats what hash)
+ (let*
+ ((count 50)
+ (rnd 10))
+ (ly:progress "\n~A properties, top ~a rounded to ~a\n~a"
+ what count rnd
+ (string-join
+ (map (lambda (x) (format "~30a: ~6@a" (car x) (* rnd (inexact->exact (round (/ (cdr x) rnd))))))
+ (take
+ (sort (hash-table->alist hash) prop-stats>?) count))
+ "\n"))))
+
+
+
+#(display-stats "Context" (ly:context-property-lookup-stats))
+
+#(display-stats "Grob" (ly:grob-property-lookup-stats))
+
+
--- /dev/null
+\header {
+ texidoc = "Relative mode for repeats uses order of entry."
+ }
+\version "2.10.8"
+
+\relative {
+ \repeat "unfold" 3
+ { f2 bes2 }
+ \alternative { a1 e b }
+}
"@ref{Stem_engraver} properties @code{stemLeftBeamCount} and "
"@code{stemRightBeamCount}. ",
/* create */ "Beam",
- /* read */ "autoBeaming autoBeamSettings beatLength subdivideBeams",
+
+ /* read */
+ "autoBeaming "
+ "autoBeamSettings "
+ "beatLength "
+ "subdivideBeams ",
+
/* write */ "");
1, 3, 3, 1
};
-Real
-binomial_coefficient (Real over, int under)
-{
- Real x = 1.0;
-
- while (under)
- {
- x *= over / Real (under);
-
- over -= 1.0;
- under--;
- }
- return x;
-}
-
void
scale (vector<Offset> *array, Real x, Real y)
{
LY_DEFINE (ly_duration2string, "ly:duration->string",
1, 0, 0, (SCM dur),
- "Convert{dur} to string.")
+ "Convert @var{dur} to string.")
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
return ly_string2scm (unsmob_duration (dur)->to_string ());
void
Figured_bass_engraver::process_music ()
{
- if (!to_boolean (get_property ("useBassFigureExtenders")))
+ if (alignment_ && !to_boolean (get_property ("useBassFigureExtenders")))
clear_spanners ();
if (rest_event_)
LY_DEFINE (ly_expand_environment, "ly:expand-environment",
1, 0, 0, (SCM str),
- "Expand $VAR and ${VAR} in @var{str}.")
+ "Expand $VAR and $@{VAR@} in @var{str}.")
{
SCM_ASSERT_TYPE(scm_is_string (str), str,
SCM_ARG1, __FUNCTION__, "string");
static Stencil repeat_slash (Real w, Real slope, Real th);
static Stencil horizontal_line (Interval w, Real th);
static Stencil triangle (Interval, Real, Real);
+ static Stencil points_to_line_stencil (Real thick, vector<Offset> const &points);
};
#endif // LOOKUP_HH
bool is_stencil_head (SCM symbol);
SCM all_stencil_heads ();
-Stencil points_to_line_stencil (vector<Offset> points);
#endif /* STENCIL_HH */
text_ = 0;
}
+/*
+ TODO: should use an event.
+ */
void
Instrument_switch_engraver::process_music ()
{
"arrow-length "
"arrow-width")
-
-
-/* todo: move this somewhere else? */
-Stencil
-points_to_line_stencil (vector<Offset> points)
-{
- Stencil ret;
- for (vsize i = 1; i < points.size (); i++)
- {
- if (points[i-1].is_sane () && points[i].is_sane ())
- {
- Stencil line
- = Line_interface::make_line (0.1, points[i-1], points[i]);
- ret.add_stencil (line);
- }
- }
- return ret;
-}
b[X_AXIS] = Interval (0, iv.length ());
b[Y_AXIS] = Interval (min (0., protude), max (0.0, protude));
- Offset z1 (iv[LEFT], 0);
- Offset z2 (iv[RIGHT], 0);
- Offset z3 ((z1 + z2)[X_AXIS] / 2, protude);
+ vector<Offset> points;
+ points.push_back (Offset (iv[LEFT], 0));
+ points.push_back (Offset (iv[RIGHT], 0));
+ points.push_back (Offset (iv.center (), protude));
- /*
- TODO: move Triangle to Line_interface ?
- */
- Stencil tri = Line_interface::make_line (thick, z1, z2);
- tri.add_stencil (Line_interface::make_line (thick, z2, z3));
- tri.add_stencil (Line_interface::make_line (thick, z3, z1));
+ return points_to_line_stencil (thick, points);
- return tri;
}
+
+
+Stencil
+Lookup::points_to_line_stencil (Real thick, vector<Offset> const &points)
+{
+ Stencil ret;
+ for (vsize i = 1; i < points.size (); i++)
+ {
+ if (points[i-1].is_sane () && points[i].is_sane ())
+ {
+ Stencil line
+ = Line_interface::make_line (thick, points[i-1], points[i]);
+ ret.add_stencil (line);
+ }
+ }
+ return ret;
+}
#include "staff-symbol-referencer.hh"
#include "tweak-registration.hh"
#include "warn.hh"
+#include "lookup.hh"
extern bool debug_skylines;
exprs));
if (debug_skylines)
{
- sys_stencil.add_stencil (points_to_line_stencil (skylines_[UP].to_points ()).in_color (255, 0, 0));
- sys_stencil.add_stencil (points_to_line_stencil (skylines_[DOWN].to_points ()).in_color (0, 255, 0));
+ sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[UP].to_points ()).in_color (255, 0, 0));
+ sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[DOWN].to_points ()).in_color (0, 255, 0));
}
Grob *left_bound = this->get_bound (LEFT);