2002-07-13 Han-Wen <hanwen@cs.uu.nl>
+ * lily/stem-tremolo.cc (brew_molecule): add code for stem tremolos.
+
* lily/auto-beam-engraver.cc (create_beam_p): remember Beam
settings at the start of a potential auto beam.
return fabs (x) * ((x < 0) ? 1.5 : 1.0);
}
-// move to somewhree?
-Slice
-int_list_to_slice (SCM l)
-{
- Slice s;
- s.set_empty ();
- for (; gh_pair_p (l); l = gh_cdr (l))
- {
- if (gh_number_p (gh_car (l)))
- s.add_point (gh_scm2int (gh_car (l)));
- }
-
- return s;
-}
-
-// move to stem?
-Slice
-stem_beam_multiplicity (Grob *stem)
-{
- SCM beaming= stem->get_grob_property ("beaming");
- Slice l = int_list_to_slice (gh_car (beaming));
- Slice r = int_list_to_slice (gh_cdr (beaming));
- l.unite (r);
-
- return l;
-}
-
void
Beam::add_stem (Grob *me, Grob *s)
{
{
Grob *sc = unsmob_grob (ly_car (s));
- m = m >? (stem_beam_multiplicity (sc).length () + 1);
+ m = m >? (Stem::beam_multiplicity (sc).length () + 1);
}
return m;
}
SCM last_beaming = SCM_EOL;;
Real last_xposn = -1;
Real last_width = -1 ;
-
+
+
+ SCM gap = me->get_grob_property ("gap");
Molecule the_beam;
Real lt = me->paper_l ()->get_var ("linethickness");
for (int i = 0; i< stems.size(); i++)
{
width_corr += stem_width/2;
}
+
+ if (gh_number_p (gap))
+ {
+ Real g = gh_scm2double (gap);
+ stem_offset += g;
+ width_corr -= 2*g;
+ }
Molecule whole = Lookup::beam (dydx, w + width_corr, thick);
for (int j = fullbeams.size(); j--;)
}
else
{
- stem_y += (stem_beam_multiplicity(s)[my_dir]) * beam_space;
+ stem_y += (Stem::beam_multiplicity(s)[my_dir]) * beam_space;
}
return stem_y;
SCM ly_assoc_chain (SCM key, SCM achain);
SCM ly_assoc_cdr (SCM key, SCM alist);
Interval ly_scm2interval (SCM);
+Slice int_list_to_slice (SCM l);
SCM ly_interval2scm (Drul_array<Real>);
void taint (SCM *);
static Direction get_direction (Grob*) ;
static void set_stemend (Grob *,Real);
static Direction get_default_dir (Grob *) ;
+ static Slice Stem::beam_multiplicity (Grob *stem);
static int head_count (Grob *) ;
static bool invisible_b (Grob *) ;
scm_puts (")", p);
return SCM_UNSPECIFIED;
}
+
+Slice
+int_list_to_slice (SCM l)
+{
+ Slice s;
+ s.set_empty ();
+ for (; gh_pair_p (l); l = gh_cdr (l))
+ {
+ if (gh_number_p (gh_car (l)))
+ s.add_point (gh_scm2int (gh_car (l)));
+ }
+
+ return s;
+}
+
Interval mol_ext = mol.extent (Y_AXIS);
// ugh, rather calc from Stem_tremolo_req
+ int beams_i = (beam) ? (Stem::beam_multiplicity (stem).length ()+ 1): 0;
/*
TODO.
*/
-
- assert(false);
- int beams_i = 0;
+
Real beamthickness = 0.0;
SCM sbt = (beam) ? beam->get_grob_property ("thickness") : SCM_EOL ;
if (gh_number_p (sbt))
return si;
}
+
+// move to stem?
+Slice
+Stem::beam_multiplicity (Grob *stem)
+{
+ SCM beaming= stem->get_grob_property ("beaming");
+ Slice l = int_list_to_slice (gh_car (beaming));
+ Slice r = int_list_to_slice (gh_cdr (beaming));
+ l.unite (r);
+
+ return l;
+}
+
+
ADD_INTERFACE (Stem,"stem-interface",
"A stem",
"up-to-staff avoid-note-head adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style dir-forced");
+