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 |
--- /dev/null
+\header{
+filename = "opus-130.ly";
+title = "Quartett";
+description = "";
+composer = "Ludwig van Beethoven (1770-1827)";
+opus = "130";
+enteredby = "JCN";
+copyright = "public domain";
+}
+
+% \version "1.0.10";
+
+global = \notes {
+ \key g;
+ \time 3/8;
+ \skip 4.*8;
+% 1.1.9 broken
+% \bar ":|";
+}
+
+tempi = \notes {
+ \property Voice.textstyle = "large"
+ s8^"Allegro assai"
+}
+
+dynamics = \notes {
+ \type Voice=i
+ s8\p\< \!s8.\> \!s16 | s4.\p | s8\< s8. \!s16 | s4.\p |
+ s8\p\< \!s8.\> \!s16 | s4.\p | s8\< s8. \!s16 | s4.\p |
+}
+
+violinei = \notes\relative c''{
+ \type Voice=i
+ [d8(b)d16] r | g,4. | [a16(b c8)e16] r | g,8~fis4 |
+ [d''8(b)d16] r | g,4. | [a16(b c8)fis,16] r | fis8~g4 |
+}
+
+violineii = \notes\relative c'{
+ \type Voice=i
+ [b8(d)b] | [e(g,)e'] | [e(c)a'] | [a(c)a] |
+ % copy from violinei: 5-8
+ [d8(b)d16] r | g,4. | [a16( b c8)fis,16] r | fis8~g4 |
+}
+
+viola = \notes\relative c'{
+ \type Voice=i
+ \clef "alto";
+ [g8(b)g] | [b(e,)b'] | [c,(a')c,] | [c'(d,)c'] | [b(d)b] |
+ [e(g,)e'] | [e(e,<)a' c,]> | <[a(c,> <fis b,> )b,] |
+}
+
+cello = \notes\relative c'{
+ \type Voice=i
+ \clef "bass";
+ g4 r8 | e'4 r8 | c4 r8 | d4 r8 | [g,,8 b g] | [b(e,)b'] |
+ [c,(a')d,] | [d'(d,)g] |
+}
+
+\score{
+ \type StaffGroup <
+ \type Staff = i < \tempi \global \dynamics \violinei >
+ \type Staff = ii < \global \dynamics \violineii >
+ \type Staff = iii < \global \dynamics \viola >
+ \type Staff = iv < \global \dynamics \cello >
+ >
+ \paper{
+ \translator { \OrchestralScoreContext }
+ }
+ \midi{ \tempo 4 = 160; }
+}
+
\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;
}
}
Text_def * td_p = new Text_def;
- td_p->align_dir_ = CENTER;
String loud = absd->loudness_str ();
td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
td_p->style_str_ = "dynamic";
-
-
+ td_p->align_dir_ = RIGHT;
+ Real nw_f = paper ()->note_width () * 0.8;
dynamic_p_ = new Text_item (td_p);
+ dynamic_p_->translate (Offset (nw_f, 0));
+
announce_element (Score_element_info (dynamic_p_, dreq_l));
}
else if (Span_dynamic_req *span_l = dynamic_cast <Span_dynamic_req *> (dreq_l))
{
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_];
}
{
Atom a (tdef_p_->get_atom (paper (), dir_));
-
- if (fat_b_)
- a.dim_[X_AXIS] = tdef_p_->width (paper ());
+ if (!fat_b_)
+ a.dim_[X_AXIS] = Interval (0,0);
Molecule* mol_p = new Molecule (a);
if (dir_<0) // should do something better anyway.