+pl 9.jcn2
+ - bf/redo: slur.cc, encompass-info: setting of encompass array.
+ - switched tuplet-engaver off (core dumps)
+
pl 9.jcn1
- bf (urg): no |: at start of piece
- bf?: text defs without width
MAJOR_VERSION=1
MINOR_VERSION=1
PATCH_LEVEL=9
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
Bar 1
Bar_req 1
Beam 0
-Bow 1
+Bezier 1
Bezier_bow 1
+Bezier_bow_controls 1
+Bezier_controls 0
+Bow 1
Change_iterator 1
Change_translator 1
Chord 1
\consists "Font_size_engraver";
\consists "Slur_engraver";
\consists "Ties_engraver";
- \consists "Tuplet_engraver";
+% \consists "Tuplet_engraver";
\consists "Note_heads_engraver" ;
\consists "Skip_req_swallow_translator";
};
\score{
- \melodic { R1 }
+ \notes { R1 }
\paper{
linewidth = 40.0\mm;
-shortlong = \melodic{
+shortlong = \notes{
c4()c( c c |
c c c c |
c c c c |
-% bug
-% excentric slur can't handle this ...
-\score{
- \melodic{
- \octave c;
- \stemdown;
- \[4/5c8( c f,, c c\]1/1 c c c )c |
- }
-}
-\header{
-% should look the same
-title="symmetry";
-}
-\score{
- \melodic\relative c'{
- [g'8( e )c' g,]
- [d'( f' )a, a]
- [d( f )a, d']
- [g,( e, )c' c]
- }
- \paper{
- castingalgorithm = \Wordwrap;
- linewidth = 50.0\mm;
- }
-}
\score{
\notes{
+% \property Voice.pletvisibility = 0;
% use blend for fast check
\blend
% {
--- /dev/null
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+ \notes\relative c'{
+ [g'8( e )c' g,] r2
+ \break
+ [d''8( f )a, d'] r2
+ }
+ \paper{
+ castingalgorithm = \Wordwrap;
+ linewidth = 50.0\mm;
+ }
+}
--- /dev/null
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+ \notes\relative c'{
+ [g'8( e )c' g,]
+ [d'( f' )a, a]
+ [d( f )a, d']
+ [g,( e, )c' c]
+ }
+ \paper{
+ castingalgorithm = \Wordwrap;
+ linewidth = 50.0\mm;
+ }
+}
b.translate_axis (interbeam_f * i, Y_AXIS);
beams->add_atom (b);
}
-#define EGCS_ICE
-#ifndef EGCS_ICE
beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS);
-#else
- beams->translate_axis (-(beams->extent ()[Y_AXIS].min () +
- beams->extent ()[Y_AXIS].max ()) / 2 , Y_AXIS);
-#endif
if (stem_l_)
{
}
}
+void
+Bezier::print () const
+{
+#ifndef NPRINT
+ if (check_debug && !monitor->silent_b ("Bezier_controls"))
+ {
+ if (control_[1].length ())
+ {
+ cout << "Bezier\n";
+ cout << "Controls: ";
+ for (int i=0; i < control_.size (); i++)
+ cout << control_[i].str () << ", ";
+// cout << "\n";
+ }
+ }
+#endif
+}
+
void
Bezier::set (Array<Offset> points)
{
void
Bezier_bow::calc ()
{
+#ifndef NPRINT
+// if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+ if (check_debug && !(monitor->silent_b ("Bezier_controls")
+ && monitor->silent_b ("Bezier_bow_controls")))
+ {
+ cout << "Before transform*********\n";
+ print ();
+ cout << "************************\n";
+ }
+#endif
transform ();
+ print ();
calc_controls ();
+ print ();
transform_back ();
+#ifndef NPRINT
+// if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+ if (check_debug && !(monitor->silent_b ("Bezier_controls")
+ && monitor->silent_b ("Bezier_bow_controls")))
+ {
+ cout << "After transform*********\n";
+ print ();
+ cout << "************************\n";
+ }
+#endif
}
/*
return dy;
}
+void
+Bezier_bow::print () const
+{
+#ifndef NPRINT
+ Bezier::print ();
+ if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+ {
+ cout << "Bezier_bow\n";
+ cout << "Encompass: ";
+ for (int i=0; i < encompass_.size (); i++)
+ cout << encompass_[i].str () << ", ";
+// cout << "\n";
+ }
+#endif
+}
+
void
Bezier_bow::set (Array<Offset> points, int dir)
{
Real indent = alpha * atan (beta * b);
Real height = indent + h;
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
Array<Offset> control;
control.push (Offset (0, 0));
control.push (Offset (indent, height));
control.push (Offset (b - indent, height));
control.push (Offset (b, 0));
-#else
- Array<Offset> control (4);
- control[0] = Offset (0, 0);
- control[1] = Offset (indent, height);
- control[2] = Offset (b - indent, height);
- control[3] = Offset (b, 0);
-#endif
Bezier::set (control);
}
Interval
Bow::do_height () const
{
- Array<Offset> c (get_controls());
-
Interval iv;
+ Array<Offset> c (get_controls());
for (int i=0; i < c.size (); i++)
{
Real y = c[i][Y_AXIS];
dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
d.x() += width (). length ();
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
Array<Offset> notes;
- notes.push (Offset 0, 0));
+ notes.push (Offset (0, 0));
notes.push (d);
-#else
- Array<Offset> notes (2);
- notes[0] = Offset (0, 0);
- notes[1] = Offset (d);
-#endif
return notes;
}
{
Paper_def* paper = note->paper ();
Real interline = paper->interline_f ();
- Real notewidth = paper->note_width ();
+ // UGH
+ Real notewidth = paper->note_width () * 0.8;
Real internote = interline / 2;
Stem* stem = note->stem_l_;
/*
- set o_.x () to middle of notehead or on eo_.x ()act o_.x () position of stem,
+ set o_.x () to middle of notehead or on the exact position of stem,
according to slur direction
- */
+ */
o_.x () = stem->hpos_f ();
- if (stem->dir_ != dir)
- {
- o_.x () += 0.5 * notewidth;
- // ugh
- if (dir == DOWN)
- o_.x () -= 0.5 * notewidth;
- else
- o_.x () += 0.5 * notewidth;
- }
- else if (stem->dir_ == UP)
- o_.x () += 1.0 * notewidth;
+ /*
+ stem->dir == dir
+ ________
+ | | / \
+ x| x| |x |x
+ \________/ | |
-// o_.x () -= left_o_.x ();
+ */
- o_.y () = stem->height ()[dir];
+ if (stem->dir_ != dir)
+ o_.x () -= 0.5 * notewidth * stem->dir_;
+ o_.y () = stem->height ()[dir];
/*
- leave a gap: slur mustn't touch head/stem
+ leave a gap: slur mustn't touch head/stem
*/
- if (stem->dir_ != dir)
- o_.y () += 3.0 * internote * dir;
- else
- o_.y () += 2.0 * internote * dir;
+ o_.y () += 2.5 * internote * dir;
- // ugh
- if (dir == DOWN)
- o_.y () += 1.5 * internote * dir;
-
-// o_.y () -= left_o_.y ();
+ if (stem->dir_ != dir)
+ o_.y () += 1.0 * internote * dir;
}
Calculate bezier curve into Offset (x,y) array.
*/
void calc (int steps);
+ void print () const;
void set (Array<Offset> points);
void calc_tangent_controls ();
bool check_fit_bo ();
Real check_fit_f ();
+ void print () const;
void set (Array<Offset> points, int dir);
void transform ();
void transform_back ();
Real interline_f = paper ()->interline_f ();
Real internote_f = interline_f / 2;
- Real notewidth_f = paper ()->note_width ();
+ // URG
+ Real notewidth_f = paper ()->note_width () * 0.8;
Real slur_min = paper ()->get_var ("slur_x_minimum");
/*
Array<Offset>
Slur::get_encompass_offset_arr () const
{
+ Real notewidth = paper ()->note_width () * 0.8;
+ Real gap = paper ()->get_var ("slur_x_gap");
+ Real internote = paper ()->internote_f ();
+
Offset left = Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]);
left.x () += encompass_arr_[0]->stem_l_->hpos_f ();
+ /*
+ <URG>
+ i don't understand these two, but *must* for symmetry
+ look at encompass array:
+ lilypond -D input/test/slur-symmetry*.ly
+ lilypond -D input/test/sleur.ly
+
+ do_post_processing should have calculated these into
+ dx_f_drul_[], no??
+
+ */
+
+ if (dir_ != encompass_arr_[0]->stem_l_->dir_)
+ left.x () += - 0.5 * notewidth * encompass_arr_[0]->stem_l_->dir_
+ + gap;
+ else if (encompass_arr_[0]->stem_l_->dir_ == UP)
+ left.x () -= notewidth;
+
+ if ((dir_ == encompass_arr_[0]->stem_l_->dir_)
+ && (encompass_arr_[0]->stem_l_->dir_ == DOWN))
+ left.y () -= internote * encompass_arr_[0]->stem_l_->dir_;
+ /* </URG> */
+
Offset d = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
d.x () += width ().length ();
if (encompass_arr_.top () != spanned_drul_[RIGHT])
last++;
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
-
Array<Offset> notes;
notes.push (Offset (0,0));
-// notes.push (left);
for (int i = first; i < last; i++)
{
Encompass_info info (encompass_arr_[i], dir_);
notes.push (info.o_ - left);
-// notes.push (info.o_ - left);
}
notes.push (d);
-#else
-
- int n = last - first + 2;
- Array<Offset> notes (n);
- notes[0] = Offset (0,0);
-// notes[0] = left;
-
- for (int i = first; i < last; i++)
- {
- Encompass_info info (encompass_arr_[i], dir_);
- notes[i - first + 1] = info.o_ - left;
-// notes[i - first + 1] = info.o_;
- }
- notes[n - 1] = Offset (d);
-
-#endif
-
return notes;
}
Real rule_thick(paper ()->rule_thickness ());
Interval stem_wid(-rule_thick/2, rule_thick/2);
if (stem_xdir_ == CENTER)
-#define EGCS_ICE
-#ifndef EGCS_ICE
r = head_wid.center ();
-#else
- r = (head_wid.min () + head_wid.max ()) / 2;
-#endif
else
r = head_wid[stem_xdir_] - stem_wid[stem_xdir_];
}