2 abbreviation-beam.cc -- implement Abbreviation_beam
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 Jan Nieuwenhuizen <jan@digicash.com>
14 #include "abbreviation-beam.hh"
18 #include "molecule.hh"
19 #include "leastsquares.hh"
21 #include "paper-def.hh"
23 #include "stem-info.hh"
26 IMPLEMENT_IS_TYPE_B1 (Abbreviation_beam, Spanner);
28 Abbreviation_beam::Abbreviation_beam ()
34 Abbreviation_beam::brew_molecule_p () const
39 return Beam::brew_molecule_p ();
41 Molecule *mol_p = new Molecule;
43 // Real inter_f = paper ()->interbeam_f ();
44 Real inter_f = paper ()->internote_f ();
45 Real x0 = stems[0]->hpos_f ();
46 for (int j=0; j <stems.size (); j++)
49 Stem * prev = (j > 0)? stems[j-1] : 0;
50 Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
52 Molecule sb = stem_beams (i, next, prev);
53 Real x = i->hpos_f ()-x0;
54 sb.translate (Offset (x, (x * slope_f + left_y)* inter_f));
57 mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
63 Abbreviation_beam::do_print () const
72 beams to go with one stem.
75 Abbreviation_beam::stem_beams (Stem *here, Stem *next, Stem *prev) const
79 - shorter beams (not reaching outer "stems")
80 for [:16 c4 c4] and [:16 c1 c1]
81 - centered beam on [:16 c1 c1] heads, rather than "stems"
83 return Beam::stem_beams (here, next, prev);