source file of the GNU LilyPond music typesetter
- (c) 1997--1998, 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--1999, 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "abbreviation-beam.hh"
#include "misc.hh"
#include "debug.hh"
-#include "atom.hh"
+
#include "molecule.hh"
#include "leastsquares.hh"
#include "stem.hh"
#include "paper-def.hh"
#include "lookup.hh"
-#include "grouping.hh"
+#include "rhythmic-grouping.hh"
Beam::Beam ()
{
damping_i_ = 1;
quantisation_ = NORMAL;
multiple_i_ = 0;
+ vertical_align_drul_[MIN] = 0;
+ vertical_align_drul_[MAX] = -1;
}
void
mol_p->translate_axis (x0
- spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
+ // correct if last note (and therefore reference point of beam)
+ // is on different staff
+ mol_p->translate_axis (- sinfo_.top ().interstaff_f_ * internote_f, Y_AXIS);
+
return mol_p;
}
for (int i=0; i < sinfo_.size (); i++)
{
Real y = sinfo_[i].x_ * slope_f_ + left_y_;
+
// correct for knee
if (dir_ != sinfo_[i].dir_)
- y -= dir_ * (beam_f / 2
- + (sinfo_[i].mult_i_ - 1) * interbeam_f) / internote_f;
+ {
+ y -= dir_ * (beam_f / 2
+ + (sinfo_[i].mult_i_ - 1) * interbeam_f) / internote_f;
+ if (!i && sinfo_[i].stem_l_->staff_sym_l_ !=
+ sinfo_.top ().stem_l_->staff_sym_l_)
+ y += dir_ * (multiple_i_ - (sinfo_[i].stem_l_->flag_i_ - 2) >? 0)
+ * interbeam_f / internote_f;
+ }
if (set_b)
- sinfo_[i].stem_l_->set_stemend (y);
+ sinfo_[i].stem_l_->set_stemend (y - sinfo_[i].interstaff_f_);
y *= dir_;
if (y > sinfo_[i].maxy_f_)
*/
Real w = here->hpos_f () - prev->hpos_f ();
w = w/2 <? nw_f;
- Atom a;
+ Molecule a;
if (lhalfs) // generates warnings if not
a = lookup_l ()->beam (sl, w, beam_f);
a.translate (Offset (-w, -w * sl));
for (int j = 0; j < lhalfs; j++)
{
- Atom b (a);
+ Molecule b (a);
b.translate_axis (-dir_ * dy * (lwholebeams+j), Y_AXIS);
- leftbeams.add_atom (b);
+ leftbeams.add_molecule (b);
}
}
int rwholebeams = here->beams_i_drul_[RIGHT] <? next->beams_i_drul_[LEFT];
Real w = next->hpos_f () - here->hpos_f ();
- Atom a = lookup_l ()->beam (sl, w + stemdx, beam_f);
+ Molecule a = lookup_l ()->beam (sl, w + stemdx, beam_f);
a.translate_axis( - stemdx/2, X_AXIS);
int j = 0;
Real gap_f = 0;
int nogap = rwholebeams - here->beam_gap_i_;
for (; j < nogap; j++)
{
- Atom b (a);
+ Molecule b (a);
b.translate_axis (-dir_ * dy * j, Y_AXIS);
- rightbeams.add_atom (b);
+ rightbeams.add_molecule (b);
}
// TODO: notehead widths differ for different types
gap_f = nw_f / 2;
for (; j < rwholebeams; j++)
{
- Atom b (a);
+ Molecule b (a);
b.translate (Offset (gap_f, -dir_ * dy * j));
- rightbeams.add_atom (b);
+ rightbeams.add_molecule (b);
}
w = w/2 <? nw_f;
for (; j < rwholebeams + rhalfs; j++)
{
- Atom b (a);
+ Molecule b (a);
b.translate_axis (-dir_ * dy * j, Y_AXIS);
- rightbeams.add_atom (b);
+ rightbeams.add_molecule (b);
}
}