set @code{MFINPUTS} and @code{TEXINPUTS} to point to the directory
containing LilyPond metafont and @file{.tex} files. For processing
PostScript output with Ghostscript you have to set @code{GS_FONTPATH}
-to point to the directory containing LilyPond PFA files.
+to point to the directory containing LilyPond PFA files. When you
+print direct PS output, remember to send the PFA files to the printer
+as well.
Scripts to do this are included in
@file{buildscripts/out/lilypond-profile} (for sh shells) and
if (!ideal.delta ())
{
- Interval chord (Stem::chord_start_f (first_visible_stem (me)),
- Stem::chord_start_f (last_visible_stem (me)));
+ Interval chord (Stem::chord_start_y (first_visible_stem (me)),
+ Stem::chord_start_y (last_visible_stem (me)));
/*
== Stem::get_direction(stems[0]))
{
Real r1 = gh_scm2double (gap);
- Real dy = Stem::chord_start_f (stems.top ())
- - Stem::chord_start_f (stems[0]);
+ Real dy = Stem::chord_start_y (stems.top ())
+ - Stem::chord_start_y (stems[0]);
Real slope = dy / (stems.size () - 1);
- Real y0 = Stem::chord_start_f (stems[0]);
+ Real y0 = Stem::chord_start_y (stems[0]);
for (int i = 1; i < stems.size () - 1; i++)
{
- Real c = (Stem::chord_start_f (stems[i]) - y0) - i * slope;
+ Real c = (Stem::chord_start_y (stems[i]) - y0) - i * slope;
if (c > r1)
{
concaveness1 = true;
Direction dir = Directional_element_interface::get (me);
Real concave = 0;
- Interval iv (Stem::chord_start_f (stems[0]),
- Stem::chord_start_f (stems.top ()));
+ Interval iv (Stem::chord_start_y (stems[0]),
+ Stem::chord_start_y (stems.top ()));
if (iv[MAX] < iv[MIN])
iv.swap ();
for (int i = 1; i < stems.size () - 1; i++)
{
Real c = 0;
- Real f = Stem::chord_start_f (stems[i]);
+ Real f = Stem::chord_start_y (stems[i]);
if ((c = f - iv[MAX]) > 0)
concave += c;
else if ((c = f - iv[MIN]) < 0)
Real nw_f;
if (!Stem::first_head (here))
nw_f = 0;
- else {
- int t = Stem::type_i (here);
+ else
+ {
+ int t = Stem::duration_log (here);
- SCM proc = me->get_grob_property ("flag-width-function");
- SCM result = gh_call1 (proc, gh_int2scm (t));
- nw_f = gh_scm2double (result);
- }
+ SCM proc = me->get_grob_property ("flag-width-function");
+ SCM result = gh_call1 (proc, gh_int2scm (t));
+ nw_f = gh_scm2double (result);
+ }
Direction dir = Directional_element_interface::get (me);
if (Stem::invisible_b (s))
continue;
- if (((int)Stem::chord_start_f (s))
+ if (((int)Stem::chord_start_y (s))
&& (Stem::get_direction (s) != Stem::get_default_dir (s)))
f++;
}
Stem::set_beaming (s, f, RIGHT);
SCM d = s->get_grob_property ("direction");
- if (Stem::type_i (s) != 1)
+ if (Stem::duration_log (s) != 1)
{
- int gap_i =Stem::duration_log (s) - ((Stem::type_i (s) >? 2) - 2);
+ int gap_i =Stem::duration_log (s) - ((Stem::duration_log (s) >? 2) - 2);
beam_p_->set_grob_property ("gap", gh_int2scm (gap_i));
}
s->set_grob_property ("direction", d);
static Grob * support_head (Grob*) ;
static void add_head (Grob*me, Grob*n);
static Stem_info calc_stem_info (Grob *) ;
- static Real chord_start_f (Grob *) ;
+ static Real chord_start_y (Grob *) ;
static Direction get_direction (Grob*) ;
- static int type_i (Grob *) ;
static void set_stemend (Grob *,Real);
static Direction get_default_dir (Grob *) ;
}
else if (str == "alongside-stem")
{
- o = Offset (0, Stem::chord_start_f (stem));
+ o = Offset (0, Stem::chord_start_y (stem));
/*
Default position is on stem X, on outer side of head Y
*/
TODO:
lengthen stem if necessary
*/
-
-
MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2);
/*
assert (a == Y_AXIS);
SCM mol = me->get_uncached_molecule ();
- return ly_interval2scm (unsmob_molecule (mol)->extent (a));
+
+ if (Molecule *m = unsmob_molecule (mol))
+ return ly_interval2scm (m->extent (a));
+ else
+ return ly_interval2scm (Interval());
}
Molecule a (Lookup::beam (dydx, width, thick));
a.translate (Offset (-width/2, width / 2 * dydx));
- int tremolo_flags;
+ int tremolo_flags = 0;
SCM s = me->get_grob_property ("flag-count");
if (gh_number_p (s))
tremolo_flags = gh_scm2int (s);
- else
- // huh?
- tremolo_flags = 1;
+ if (!tremolo_flags)
+ {
+ programming_error ("No tremolo flags?");
+
+ me->suicide();
+ return SCM_EOL;
+ }
+
+ /*
+ Who the fuck is 0.81 ?
+
+ --hwn.
+ */
Real interbeam = beam ? Beam::get_interbeam (beam) : 0.81;
Molecule mol;
b.translate_axis (interbeam * i, Y_AXIS);
mol.add_molecule (b);
}
- if (tremolo_flags)
- mol.translate_axis (-mol.extent (Y_AXIS).center (), Y_AXIS);
- if (beam)
+ Direction stemdir = Stem::get_direction (stem);
+ Interval mol_ext = mol.extent (Y_AXIS);
+
+ // ugh, rather calc from Stem_tremolo_req
+ int beams_i = (beam)
+ ? (Stem::beam_count (stem, RIGHT) >? Stem::beam_count (stem, LEFT))
+ : 0;
+
+ Real beamthickness = 0.0;
+ SCM sbt = (beam) ? beam->get_grob_property ("thickness") : SCM_EOL ;
+ if (gh_number_p (sbt))
+ {
+ beamthickness = gh_scm2double (sbt) * ss;
+ }
+
+ Real end_y
+ = Stem::stem_end_position (stem) *ss/2
+ - stemdir * (beams_i * beamthickness
+ + ((beams_i -1) >? 0) * interbeam);
+
+ /*
+ the 0.33 ss is to compensate for the size of the note head
+ */
+ Real chord_start_y = Stem::chord_start_y (stem) +
+ 0.33 * ss * stemdir;
+
+ Real padding = interbeam;
+
+ /*
+ if there is not enough space, center on remaining space,
+ else one beamspace away from stem end.
+ */
+ if (stemdir * (end_y - chord_start_y) - 2*padding - mol_ext.length () < 0.0)
{
- // ugh, rather calc from Stem_tremolo_req
- int beams_i = Stem::beam_count (stem, RIGHT)
- >? Stem::beam_count (stem, LEFT);
- mol.translate (Offset (0,
- Stem::stem_end_position (stem) * ss / 2 -
- Directional_element_interface::get (beam)
- * beams_i * interbeam));
+ mol.translate_axis ((end_y + chord_start_y) /2.0 - mol_ext.center (),Y_AXIS);
}
else
- {
- /*
- Beams should intersect one beamthickness below stem end
- */
- Real dy = Stem::stem_end_position (stem) * ss / 2;
- dy -= mol.extent (Y_AXIS).length () / 2 * Stem::get_direction (stem);
-
- mol.translate (Offset (0, dy));
+ {
+ mol.translate_axis (end_y - stemdir * interbeam
+ -mol_ext [stemdir]
+ , Y_AXIS);
}
return mol.smobbed_copy ();
Jan Nieuwenhuizen <janneke@gnu.org>
TODO: This is way too hairy
+
+ TODO: fix naming.
+
+ Stem-end, chord-start, etc. is all confusing naming.
*/
#include <math.h> // rint
Real
-Stem::chord_start_f (Grob*me)
+Stem::chord_start_y (Grob*me)
{
return head_positions (me)[get_direction (me)]
* Staff_symbol_referencer::staff_space (me)/2.0;
me->set_grob_property ("stem-end-position", gh_double2scm (se));
}
-int
-Stem::type_i (Grob*me)
-{
- return first_head (me) ? Note_head::balltype_i (first_head (me)) : 2;
-}
/*
Note head that determines hshift for upstems
Real shorten_f = a[ ((duration_log (me) - 2) >? 0) <? (a.size () - 1)] * 2;
/* On boundary: shorten only half */
- if (abs (chord_start_f (me)) == 0.5)
+ if (abs (chord_start_y (me)) == 0.5)
shorten_f *= 0.5;
/* URGURGURG
/* stems in unnatural (forced) direction should be shortened,
according to [Roush & Gourlay] */
- if (chord_start_f (me)
+ if (chord_start_y (me)
&& (get_direction (me) != get_default_dir (me)))
length_f -= shorten_f;
Real thick = gh_scm2double (beam->get_grob_property ("thickness"));
Stem_info info;
- info.ideal_y = chord_start_f (me);
+ info.ideal_y = chord_start_y (me);
// for simplicity, we calculate as if dir == UP
%files documentation
%doc web/
+%doc input/
+%doc mutopia/