--- /dev/null
+
+\header {
+
+ texidoc = "Advanced tie chord formatting also works with arpegiated
+ties. Due to arpeggios, tie directions may be changed relative to the
+unarpegiated case."
+
+
+}
+
+\version "2.9.3"
+
+\version "2.8.1"
+\layout { ragged-right = ##t }
+\new Staff \relative c'' {
+ <e c a f>2~ <e c a f> |
+ \set tieWaitForNote = ##t
+ e8~ c~ a~ f~ <e' c a f>2 |
+ f,8~ a~ c~ e~ <f, a c e>2 |
+}
+
\header
{
- texidoc = "when @code{tieWaitForNote} is set, the right-tied note
- does not have to follow the lef-tied note directly. When
- @code{tieWaitForNote} is set to false, any tie will erase all pending
- ties."
+ texidoc =
+
+ "when @code{tieWaitForNote} is set, the right-tied note does not
+ have to follow the lef-tied note directly. When @code{tieWaitForNote}
+ is set to false, any tie will erase all pending ties."
}
\set tieWaitForNote = ##f
<c e> ~
<c e c'>
+ |
+
}
Tie_configuration_variation ();
};
-typedef map <int, vector<Skyline_entry> > Chord_outline_map ;
+typedef map <int, vector<Skyline_entry> > Chord_outline_map;
+typedef map <int, Box> Column_extent_map;
class Tie_formatting_problem
{
Chord_outline_map chord_outlines_;
- Drul_array< Box > stem_extents_;
- Drul_array< Box > head_extents_;
+ Column_extent_map stem_extents_;
+ Column_extent_map head_extents_;
+
set<int> dot_positions_;
Interval dot_x_;
vector<Tie_specification> specifications_;
Tie_details details_;
void print_ties_configuration (Ties_configuration const *);
+ Interval get_stem_extent (int, Axis) const;
+ Interval get_head_extent (int, Axis) const;
+
public:
Tie_formatting_problem ();
~Tie_formatting_problem ();
insert_extent_into_skyline (&chord_outlines_[column_rank], Box (x,y), Y_AXIS, -dir);
- stem_extents_[dir].unite (Box (x,y));
+ stem_extents_[column_rank].unite (Box (x,y));
if (dir == LEFT)
{
}
while (flip (&updowndir) != DOWN);
- head_extents_[dir].set_empty ();
+ head_extents_[column_rank].set_empty ();
for (vsize i = 0; i < head_boxes.size (); i++)
{
- head_extents_[dir].unite (head_boxes[i]);
+ head_extents_[column_rank].unite (head_boxes[i]);
}
}
}
if (y_tune
- && max (fabs (head_extents_[LEFT][Y_AXIS][dir] - y),
- fabs (head_extents_[RIGHT][Y_AXIS][dir] - y)) < 0.25
+ && max (fabs (get_head_extent (columns[LEFT], Y_AXIS)[dir] - y),
+ fabs (get_head_extent (columns[RIGHT],Y_AXIS)[dir] - y)) < 0.25
&& !Staff_symbol_referencer::on_line (details_.staff_symbol_referencer_, pos))
{
conf->delta_y_ =
- (head_extents_[LEFT][Y_AXIS][dir] - y)
+ (get_head_extent (columns[LEFT], Y_AXIS)[dir] - y)
+ dir * details_.outer_tie_vertical_gap_;
}
do
{
Real y = conf->position_ * details_.staff_space_ * 0.5 + conf->delta_y_;
- if (stem_extents_[d][X_AXIS].is_empty ()
- || !stem_extents_[d][Y_AXIS].contains (y))
+ if (get_stem_extent (conf->column_ranks_[d], X_AXIS).is_empty ()
+ || !get_stem_extent (conf->column_ranks_[d], Y_AXIS).contains (y))
continue;
conf->attachment_x_[d] =
d * min (d * conf->attachment_x_[d],
- d * (stem_extents_[d][X_AXIS][-d] - d * details_.stem_gap_));
+ d * (get_stem_extent (conf->column_ranks_[d], X_AXIS)[-d] - d * details_.stem_gap_));
}
while (flip (&d) != LEFT);
return conf;
}
+Interval
+Tie_formatting_problem::get_head_extent (int col, Axis a) const
+{
+ return (*head_extents_.find (col)).second[a];
+}
+
+Interval
+Tie_formatting_problem::get_stem_extent (int col, Axis a) const
+{
+ return (*stem_extents_.find (col)).second[a];
+}
+
/**
TIE_IDX and TIES_CONF are optional.
*/