This can be turned off by setting avoid-scripts to ##f.
Scripts are placed in a "scripts" grob array in the tuplet-engraver
and are then accessed in tuplet-bracket.cc and treated as items to
encompass when calculating a bracket's vertical position.
--- /dev/null
+\version "2.15.24"
+
+\header {
+ texidoc = "Tuplet brackets avoid scripts by default.
+"
+}
+
+\relative c'' {
+ \times 2/3 { a8^\espressivo r a^\espressivo }
+}
-\version "2.15.6"
+\version "2.15.24"
\header {
texidoc = "Tuplet brackets' outside staff priority can be
}
\relative c'' {
+ \override TupletBracket #'avoid-scripts = ##f
% Plain old tuplet
\times 2/3 { a8 r a }
% With nothing set, collisions abound both horizontally and
-\version "2.15.1"
+\version "2.15.24"
\header {
texidoc = "Tuplet numbers' outside staff priority can be
}
\relative c'' {
+ \override TupletBracket #'avoid-scripts = ##f
\times 2/3 { a8\trill a\trill a\trill }
\override TupletNumber #'outside-staff-priority = #1
\times 2/3 { a8\trill a\trill a\trill }
static void add_tuplet_bracket (Grob *me, Grob *smaller_bracket);
static void get_bounds (Grob *, Grob **, Grob **);
static void add_column (Grob *me, Item *);
+ static void add_script (Grob *me, Item *);
static void add_beam (Grob *me, Grob *);
static Grob *parallel_beam (Grob *me, vector<Grob *> const &cols,
bool *equally_long);
number->extent (commony, Y_AXIS)[dir]));
}
+ if (to_boolean (me->get_property ("avoid-scripts")))
+ {
+ extract_grob_set (me, "scripts", scripts);
+ for (vsize i = 0; i < scripts.size (); i++)
+ {
+ if (!scripts[i]->is_live ())
+ continue;
+
+ Interval script_x (scripts[i]->extent (commonx, X_AXIS));
+ Interval script_y (scripts[i]->extent (commony, Y_AXIS));
+
+ points.push_back (Offset (script_x.center () - x0,
+ script_y[dir]));
+ }
+ }
+
*offset = -dir * infinity_f;
Real factor = (columns.size () > 1) ? 1 / (x1 - x0) : 1.0;
for (vsize i = 0; i < points.size (); i++)
add_bound_item (dynamic_cast<Spanner *> (me), n);
}
+void
+Tuplet_bracket::add_script (Grob *me, Item *s)
+{
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), s);
+}
+
void
Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
{
" @code{edge-text} are printed at the edges.",
/* properties */
+ "avoid-scripts "
"bracket-flare "
"bracket-visibility "
"break-overshoot "
vector<Spanner *> last_tuplets_;
DECLARE_ACKNOWLEDGER (note_column);
+ DECLARE_ACKNOWLEDGER (script);
DECLARE_TRANSLATOR_LISTENER (tuplet_span);
virtual void finalize ();
void start_translation_timestep ();
}
}
+void
+Tuplet_engraver::acknowledge_script (Grob_info inf)
+{
+ for (vsize j = 0; j < tuplets_.size (); j++)
+ if (tuplets_[j].bracket_)
+ {
+ Item *i = dynamic_cast<Item *> (inf.grob ());
+ Tuplet_bracket::add_script (tuplets_[j].bracket_, i);
+ }
+}
+
void
Tuplet_engraver::start_translation_timestep ()
{
}
ADD_ACKNOWLEDGER (Tuplet_engraver, note_column);
+ADD_ACKNOWLEDGER (Tuplet_engraver, script);
ADD_TRANSLATOR (Tuplet_engraver,
/* doc */
"Catch tuplet events and generate appropriate bracket.",
averaged over staves.")
(avoid-note-head ,boolean? "If set, the stem of a chord does not
pass through all note heads, but starts at the last note head.")
+ (avoid-scripts ,boolean? "If set, a tuplet bracket avoids the
+scripts associated with the note heads it encompasses.")
(avoid-slur ,symbol? "Method of handling slur collisions.
Choices are @code{inside}, @code{outside}, @code{around}, and
@code{ignore}. @code{inside} adjusts the slur if needed to keep the
(TupletBracket
. (
+ (avoid-scripts . #t)
(connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
(cross-staff . ,ly:tuplet-bracket::calc-cross-staff)
(direction . ,ly:tuplet-bracket::calc-direction)