+2002-03-23 Han-Wen <hanwen@cs.uu.nl>
+
+ * VERSION: 1.5.46
+
+ * lily/beam.cc (score_slopes_dy, score_stem_lengths,
+ score_forbidden_quants): ): take out of SCM, pass parameters so
+ grob props are read only once. (wtk1-fugue2 from 31 sec to 14
+ secs).
+
+ * lily/lily-guile.cc (ly_unit): return internal unit.
+
+ * scm/tex.scm (header-end): insert scaling factor, using ly-unit
+
+ * lily/paper-outputter.cc (output_version): output internal unit
+ from Paper_outputter
+
+ * scripts/ly2dvi.py: Read unit from paper vars (43.jcn3).
+
+2002-03-22 Mats Bengtsson <mats.bengtsson@s3.kth.se>
+
+ * scripts/ly2dvi.py: clean up old .*pk font caching code.
+
+ * scm/ps.scm: Use uppercase postscript font names for the standard
+ TeX fonts.
+
+ * scripts/ly2dvi.py, buildscripts/lilypond-{login,profile}.sh, :
+ Add all available TeX Type1 fonts, including Feta, to the
+ Ghostscript font path.
+
+ * Documentation/topdocs/INSTALL.texi (Top): Add required pktrace
+ version (affects the FontName) in lilypond.map.
+
+ * mf/GNUmakefile, Documentation/user/appendices.itely: Rename font
+ documentation file to fetaNNlist.ly to avoid name collisions between
+ lilypond generated .tex file and font .tex macros file.
+
+
+2002-03-22 Juergen Reuter <reuter@ipd.uka.de>
+
+ * mf/feta-eindelijk.mf, mf/parmesan-rests.mf: added maxima rests;
+ made mensural longa and (semi-)brevis leaner
+
+ * mf/parmesan-clefs.mf, scm/clef.scm: enhanced petrucci c clef
+
+ * lily/{{lookup,porrectus}.cc,include/{lookup,porrectus}.hh}: code
+ clean-up: moved bezier shape and slope from porrectus to lookup
+
+ * buildscripts/clean-fonts.sh: added search paths /var/cache/fonts
+ and /usr/share/texmf/fonts
+
+2002-03-22 Han-Wen <hanwen@cs.uu.nl>
+
+ * lily/text-spanner.cc (brew_molecule): add #'thickness
+ (brew_molecule): add corrections for thickness in molecule padding.
+
+ * lily/line-spanner.cc (line_atom): make function private
+
+ * scripts/lilypond-book.py (get_bbox): Use GS -sDEVICE=bbox to
+ discover bounding box. This solves the cropping problem.
+
+ * lily/bar-check-iterator.cc (process): Only resynchronize bar
+ check when it fails. This fixes the combination of grace notes
+ and bar checks.
+
2002-03-21 Han-Wen <hanwen@cs.uu.nl>
+ * lily/repeated-music.cc (minimum_start): new Scheme callable function
+ (first_start): new Scheme callable. This will fix repeated music
+ starting with grace notes.
+
+ * lily/music.cc (start_mom): check start-moment-function grob property.
+
* VERSION: 1.5.45 released
* input/regression/system-extents.ly: new regression test. Test
@end example
-@item pktrace, [OPTIONAL], needed for generating PostScript Type1
+@item pktrace 1.0 or newer, [OPTIONAL], needed for generating PostScript Type1
fonts. Get it from @uref{http://www.cs.uu.nl/~hanwen/pktrace/}. You
will need to install some additional packages to get pktrace to work.
accessed directly using text markup such as
@code{g^#'(music "scripts-segno")}, see @ref{Text markup}.
-@lilypondfile{feta16.ly}
+@lilypondfile{feta16list.ly}
./configure --without-kpathsea --enable-tfm-path=/usr/share/texmf/fonts/tfm/public/cm/:/usr/share/texmf/fonts/tfm/ams/symbols
- * pktrace, [OPTIONAL], needed for generating PostScript Type1 fonts.
- Get it from `http://www.cs.uu.nl/~hanwen/pktrace/'. You will
- need to install some additional packages to get pktrace to work.
+ * pktrace 1.0 or newer, [OPTIONAL], needed for generating PostScript
+ Type1 fonts. Get it from `http://www.cs.uu.nl/~hanwen/pktrace/'.
+ You will need to install some additional packages to get pktrace
+ to work.
Running requirements
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=5
-PATCH_LEVEL=45
+PATCH_LEVEL=46
MY_PATCH_LEVEL=
+
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
#
/var/spool/texmf
/var/tmp/texfonts
/var/texfonts
+/var/cache/fonts
+/usr/share/texmf/fonts
"
for i in $dirs; do
# strange shell, this C
set datadir="@datadir@"
-if ( $?GS_FONTPATH ) then
- setenv GS_FONTPATH "$datadir/fonts/afm:$datadir/fonts/type1:$GS_FONTPATH"
- else
- setenv GS_FONTPATH "$datadir/fonts/afm:$datadir/fonts/type1"
- endif
if ( $?GS_LIB ) then
setenv GS_LIB "$datadir/ps:$GS_LIB"
else
setenv TEXMF "{$datadir,"`kpsexpand \$TEXMF`"}"
unset noglob
+# Add all available TeX Type1 fonts (including Feta) to Ghostscript:
+if ( $?GS_FONTPATH ) then
+ setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`:$GS_FONTPATH"
+ else
+ setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`
+ endif
datadir=`echo "@datadir@" | sed 's!//!/!g'`
-# For direct ps output fonts
-GS_FONTPATH="$datadir/fonts/afm:$datadir/fonts/type1:"${GS_FONTPATH:=""}
-
# For direct ps output: ps/lilyponddefs.ps
GS_LIB="$datadir/ps:"${GS_LIB:=""}
# LILYPONDPREFIX="$datadir"
# export LILYPONDPREFIX
+# For direct ps output fonts. Add all available TeX Type1 fonts
+GS_FONTPATH=`kpsewhich -expand-path=\$T1FONTS`:${GS_FONTPATH:=""}
+
+
+
export GS_LIB GS_FONTPATH TEXMF
baerPaper = \paper {
indent = 7. \mm
linewidth =183.5 \mm
+ interscoreline=4.0\mm
+ \translator {
+ \ScoreContext
+% System \override #'molecule-callback = #box-grob-molecule
+ }
}
\context FiguredBass {
\figures {
<_! 3+ 5- _ 7! 9 >4
- < 4 6 >
+ < [4 6] >
}
}
--- /dev/null
+
+\header {
+
+ texidoc = "Repeated music can start with grace notes. Bar checks
+ preceding the grace notes do not cause synchronization effects. "
+
+}
+
+\score{
+ \notes\relative c'''{\key a \minor \time 2/4
+ \repeat "volta" 2 {
+ \grace { [a16( c] } c,4 c4 |
+ \grace { [e'16( gis] } c,4 c4 |
+
+ }
+ }
+ \paper { linewidth = -1. }
+ }
+
+
\header{
texidoc="
+
There are several ways to calculate the direction of a beam
@table @samp
\score {
\notes \relative c'' {
- % the default
- %\property Voice.Beam \set #'dir-function = #beam-dir-majority
+ \property Voice.Beam \set #'dir-function = #beam-dir-majority
[d8 a]
\property Voice.Beam \set #'dir-function = #beam-dir-mean
[d a]
if (where->main_part_)
{
music_l ()->origin ()->warning (_f ("barcheck failed at: %s",
- where->str ()));
- }
-
- if (!to_boolean (sync))
- {
- tr = tr->where_defined (ly_symbol2scm("measurePosition"));
- Moment zero;
- tr->set_property ("measurePosition", zero.smobbed_copy ());
+ where->str ()));
+ if (!to_boolean (sync))
+ {
+ tr = tr->where_defined (ly_symbol2scm("measurePosition"));
+ Moment zero;
+ tr->set_property ("measurePosition", zero.smobbed_copy ());
+ }
}
}
-}
-
+}
It may only set directions for stems.
* Rewrite stem_beams.
-
+
+ * Use Number_pair i.s.o Interval to represent (yl, yr).
+
*/
#include "font-interface.hh" // debug output.
+#define DEBUG_QUANTING 0
+
static Real
shrink_extra_weight (Real x)
add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (s));
}
+
+/*
+ TODO: fix this for grace notes.
+ */
Real
Beam::get_interbeam (Grob *me)
{
}
/* Set stem's shorten property if unset.
- TODO:
+
+ TODO:
take some y-position (chord/beam/nearest?) into account
scmify forced-fraction */
void
Real demerits;
};
+
/*
TODO:
- Make all demerits customisable
Real ss = Staff_symbol_referencer::staff_space (me);
Real thickness = gh_scm2double (me->get_grob_property ("thickness")) / ss;
Real slt = me->paper_l ()->get_var ("stafflinethickness") / ss;
+
+
+ SCM sdy = me->get_grob_property ("least-squares-dy");
+ Real dy_mus = gh_number_p (sdy) ? gh_scm2double (sdy) : 0.0;
Real straddle = 0.0;
Real sit = (thickness - slt) / 2;
Array<Real> quantsl;
Array<Real> quantsr;
+ /*
+ going to REGION_SIZE == 2, yields another 0.6 second with
+ wtk1-fugue2.
+
+
+ (result indexes between 70 and 575) ? --hwn.
+
+ */
+
const int REGION_SIZE = 3;
- // -> result indexes between 70 and 575
for (int i = -REGION_SIZE ; i < REGION_SIZE; i++)
for (int j = 0; j < num_quants; j++)
{
}
- SCM score_funcs = me->get_grob_property ("quant-score-functions");
- for (SCM s = score_funcs; gh_pair_p (s); s = gh_cdr (s))
+ /*
+ This is a longish function, but we don't separate this out into
+ neat modular separate subfunctions, as the subfunctions would be
+ called for many values of YL, YR. By precomputing various
+ parameters outside of the loop, we can save a lot of time.
+
+ */
+ for (int i = qscores.size (); i--;)
+ if (qscores[i].demerits < 100)
+ {
+ qscores[i].demerits
+ += score_slopes_dy (me, qscores[i].yl, qscores[i].yr,
+ dy_mus, yr- yl);
+ }
+
+ Real rad = Staff_symbol_referencer::staff_radius (me);
+ int multiplicity = get_multiplicity (me);
+ Real interbeam = multiplicity < 4
+ ? (2*ss + slt - thickness) / 2.0
+ : (3*ss + slt - thickness) / 3.0;
+
+ for (int i = qscores.size (); i--;)
+ if (qscores[i].demerits < 100)
+ {
+ qscores[i].demerits
+ += score_forbidden_quants (me, qscores[i].yl, qscores[i].yr,
+ rad, slt, thickness, interbeam,
+ multiplicity);
+ }
+
+
+ /*
+ Do stem lengths. These depend on YL and YR linearly, so we can
+ precompute for every stem 2 factors.
+ */
+ Link_array<Grob> stems=
+ Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
+ Array<Stem_info> stem_infos;
+ Array<Real> lbase_lengths;
+ Array<Real> rbase_lengths;
+
+ Array<int> directions;
+ for (int i= 0; i < stems.size(); i++)
{
- SCM f = gh_car (s);
- for (int i = qscores.size (); i--;)
- {
- // best scores < 30;
- // if (qscores[i].demerits < 1000)
- if (qscores[i].demerits < 100)
- {
- SCM score = gh_call3 (f,
- me->self_scm (),
- gh_double2scm (qscores[i].yl),
- gh_double2scm (qscores[i].yr));
-
- qscores[i].demerits += gh_scm2double (score);
- }
- }
+ Grob*s = stems[i];
+ stem_infos.push( Stem::calc_stem_info (s));
+
+ Real b = calc_stem_y (me, s, Interval (1,0));
+ lbase_lengths.push (b);
+
+ b = calc_stem_y (me, s, Interval (0,1));
+ rbase_lengths.push (b);
+ directions.push( Directional_element_interface::get( s));
}
-
+
+ for (int i = qscores.size (); i--;)
+ if (qscores[i].demerits < 100)
+ {
+ qscores[i].demerits
+ += score_stem_lengths (stems, stem_infos,
+ lbase_lengths, rbase_lengths,
+ directions,
+ me, qscores[i].yl, qscores[i].yr);
+ }
+
+
Real best = 1e6;
int best_idx = -1;
for (int i = qscores.size (); i--;)
gh_double2scm (qscores[best_idx].yr))
);
- if (0)
+ if (DEBUG_QUANTING)
{
// debug quanting
me->set_grob_property ("quant-score",
return SCM_UNSPECIFIED;
}
-MAKE_SCHEME_CALLBACK (Beam, score_slopes_dy, 3);
-SCM
-Beam::score_slopes_dy (SCM smob, SCM syl, SCM syr)
-{
- Grob*me = unsmob_grob (smob);
- Real yl = gh_scm2double (syl);
- Real yr = gh_scm2double (syr);
- Real dy = yr - yl;
-
- SCM sdy = me->get_grob_property ("least-squares-dy");
- SCM posns = me->get_grob_property ("positions");
-
- Real dy_mus = gh_number_p (sdy) ? gh_scm2double (sdy) : 0.0;
- Real dy_damp = - gh_scm2double (gh_car (posns)) + gh_scm2double (gh_cdr (posns));
-
- Real dem = 0.0;
- if (sign (dy_damp) != sign (dy))
- {
- dem += 800;
- }
-
- dem += 400* (0 >? (fabs (dy) - fabs (dy_mus)));
-
-
- dem += shrink_extra_weight (fabs (dy_damp) - fabs (dy))* 10;
- return gh_double2scm (dem);
-}
-
-MAKE_SCHEME_CALLBACK (Beam, score_stem_lengths, 3);
-SCM
-Beam::score_stem_lengths (SCM smob, SCM syl, SCM syr)
+Real
+Beam::score_stem_lengths (Link_array<Grob>stems,
+ Array<Stem_info> stem_infos,
+ Array<Real> left_factor,
+ Array<Real> right_factor,
+ Array<int> directions,
+ Grob*me, Real yl, Real yr)
{
- Grob*me = unsmob_grob (smob);
- Real yl = gh_scm2double (syl);
- Real yr = gh_scm2double (syr);
-
- Link_array<Item> stems=
- Pointer_group_interface__extract_grobs (me, (Item*)0, "stems");
-
Real demerit_score = 0.0 ;
for (int i=0; i < stems.size (); i++)
{
- Item* s = stems[i];
+ Grob* s = stems[i];
if (Stem::invisible_b (s))
continue;
- Real current_y = calc_stem_y (me, s, Interval (yl, yr));
- Stem_info info = Stem::calc_stem_info (s);
- Direction d = Directional_element_interface::get (s);
+ Real current_y =
+ yl * left_factor[i] + right_factor[i]* yr;
+
+ Stem_info info = stem_infos[i];
+ Direction d = Direction (directions[i]);
demerit_score += 500 * ( 0 >? (info.min_y - d * current_y));
demerit_score += 500 * ( 0 >? (d * current_y - info.max_y));
demerit_score *= 2.0 /stems.size ();
- return gh_double2scm (demerit_score);
+ return demerit_score;
+}
+
+Real
+Beam::score_slopes_dy (Grob *me, Real yl, Real yr,
+ Real dy_mus, Real dy_damp)
+{
+ Real dy = yr - yl;
+
+ Real dem = 0.0;
+ if (sign (dy_damp) != sign (dy))
+ {
+ dem += 800;
+ }
+
+ dem += 400* (0 >? (fabs (dy) - fabs (dy_mus)));
+
+
+ dem += shrink_extra_weight (fabs (dy_damp) - fabs (dy))* 10;
+ return dem;
}
static Real
return x - floor (x);
}
-
-
-MAKE_SCHEME_CALLBACK (Beam, score_forbidden_quants, 3);
-SCM
-Beam::score_forbidden_quants (SCM smob, SCM syl, SCM syr)
+Real
+Beam::score_forbidden_quants (Grob*me,
+ Real yl, Real yr,
+ Real rad,
+ Real slt,
+ Real thickness, Real interbeam,
+ int multiplicity)
{
- Grob*me = unsmob_grob (smob);
- Real yl = gh_scm2double (syl);
- Real yr = gh_scm2double (syr);
Real dy = yr - yl;
- Real rad = Staff_symbol_referencer::staff_radius (me);
+
Real dem = 0.0;
if (fabs (yl) < rad && fabs ( my_modf (yl) - 0.5) < 1e-3)
dem += 1000;
if (fabs (yr) < rad && fabs ( my_modf (yr) - 0.5) < 1e-3)
dem += 1000;
-
- int multiplicity = get_multiplicity (me);
// todo: use multiplicity of outer stems.
if (multiplicity >= 2)
{
- Real slt = me->paper_l ()->get_var ("stafflinethickness");
- Real ss = Staff_symbol_referencer::staff_space (me);
- Real thickness = gh_scm2double (me->get_grob_property ("thickness"))
- * ss;
-
- Real interbeam = multiplicity < 4
- ? (2*ss + slt - thickness) / 2.0
- : (3*ss + slt - thickness) / 3.0;
-
+
Real straddle = 0.0;
Real sit = (thickness - slt) / 2;
Real inter = 0.5;
&& fabs (my_modf (yr) - inter) < 1e-3)
dem += 15;
+ Real eps = 1e-3;
+
+ /*
+ Can't we simply compute the distance between the nearest
+ staffline and the secondary beam? That would get rid of the
+ silly case analysis here (which is probably not when we have
+ different beam-thicknesses.)
+
+ --hwn
+ */
+
// hmm, without Interval/Drul_array, you get ~ 4x same code...
if (fabs (yl - dir * interbeam) < rad + inter)
{
- if (dir == UP && dy <= 1e-3
- && fabs (my_modf (yl) - sit) < 1e-3)
+ if (dir == UP && dy <= eps
+ && fabs (my_modf (yl) - sit) < eps)
dem += 15;
- if (dir == DOWN && dy >= 1e-3
- && fabs (my_modf (yl) - hang) < 1e-3)
+ if (dir == DOWN && dy >= eps
+ && fabs (my_modf (yl) - hang) < eps)
dem += 15;
}
if (fabs (yr - dir * interbeam) < rad + inter)
{
- if (dir == UP && dy >= 1e-3
- && fabs (my_modf (yr) - sit) < 1e-3)
+ if (dir == UP && dy >= eps
+ && fabs (my_modf (yr) - sit) < eps)
dem += 15;
- if (dir == DOWN && dy <= 1e-3
- && fabs (my_modf (yr) - hang) < 1e-3)
+ if (dir == DOWN && dy <= eps
+ && fabs (my_modf (yr) - hang) < eps)
dem += 15;
}
{
if (fabs (yl - 2 * dir * interbeam) < rad + inter)
{
- if (dir == UP && dy <= 1e-3
- && fabs (my_modf (yl) - straddle) < 1e-3)
+ if (dir == UP && dy <= eps
+ && fabs (my_modf (yl) - straddle) < eps)
dem += 15;
- if (dir == DOWN && dy >= 1e-3
- && fabs (my_modf (yl) - straddle) < 1e-3)
+ if (dir == DOWN && dy >= eps
+ && fabs (my_modf (yl) - straddle) < eps)
dem += 15;
}
if (fabs (yr - 2 * dir * interbeam) < rad + inter)
{
- if (dir == UP && dy >= 1e-3
- && fabs (my_modf (yr) - straddle) < 1e-3)
+ if (dir == UP && dy >= eps
+ && fabs (my_modf (yr) - straddle) < eps)
dem += 15;
- if (dir == DOWN && dy <= 1e-3
- && fabs (my_modf (yr) - straddle) < 1e-3)
+ if (dir == DOWN && dy <= eps
+ && fabs (my_modf (yr) - straddle) < eps)
dem += 15;
}
}
}
- return gh_double2scm ( dem);
+ return dem;
}
in POS, and for stem S.
*/
Real
-Beam::calc_stem_y (Grob *me, Item* s, Interval pos)
+Beam::calc_stem_y (Grob *me, Grob* s, Interval pos)
{
int beam_multiplicity = get_multiplicity (me);
int stem_multiplicity = (Stem::flag_i (s) - 2) >? 0;
if (dir!= sdir)
{
stem_y -= dir * (thick / 2 + (beam_multiplicity - 1) * interbeam);
-
+
// huh, why not for first visible?
- if (Staff_symbol_referencer::staff_symbol_l (s)
- != Staff_symbol_referencer::staff_symbol_l (last_visible_stem (me)))
- stem_y += Directional_element_interface::get (me)
- * (beam_multiplicity - stem_multiplicity) * interbeam;
+
+ Grob *last_visible = last_visible_stem (me);
+ if (last_visible)
+ {
+ if ( Staff_symbol_referencer::staff_symbol_l (s)
+ != Staff_symbol_referencer::staff_symbol_l (last_visible))
+ stem_y += Directional_element_interface::get (me)
+ * (beam_multiplicity - stem_multiplicity) * interbeam;
+ }
+ else
+ programming_error ("No last visible stem");
}
return stem_y;
->get_bound (LEFT)->relative_coordinate (0, X_AXIS),
X_AXIS);
- if (0)
+ if (DEBUG_QUANTING)
{
/*
This code prints the demerits for each beam. Perhaps this
-/* TODO:
- use filter and standard list functions.
- */
+/*
+
+TODO:
+use filter and standard list functions.
+
+*/
int
Beam::visible_stem_count (Grob *me)
{
/*
[TODO]
+
handle rest under beam (do_post: beams are calculated now)
what about combination of collisions and rest under beam.
w = sneaky_insert_extra_moment (w);
- //cout << "Proccing " << w << endl;
+ // cout << "Proccing " << w << endl;
if (first)
(Scheme_function_unknown)ly_set_grob_property);
scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0,
(Scheme_function_unknown) spanner_get_bound);
+ scm_c_define_gsubr ("ly-get-paper-variable", 2, 0, 0,
+ (Scheme_function_unknown) ly_get_paper_var);
scm_c_define_gsubr ("ly-get-extent", 3, 0, 0,
(Scheme_function_unknown) ly_get_extent);
scm_c_define_gsubr ("ly-get-parent", 2, 0, 0,
#include "lily-proto.hh"
#include "lily-guile.hh"
-
+#include "stem-info.hh"
class Beam
DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
DECLARE_SCHEME_CALLBACK (quanting, (SCM));
- DECLARE_SCHEME_CALLBACK (score_slopes_dy, (SCM, SCM,SCM));
- DECLARE_SCHEME_CALLBACK (score_stem_lengths, (SCM, SCM,SCM));
- DECLARE_SCHEME_CALLBACK (score_forbidden_quants, (SCM, SCM,SCM));
+ static Real score_slopes_dy (Grob*, Real,Real,Real,Real);
+ static Real score_stem_lengths (Link_array<Grob>,
+ Array<Stem_info>,
+ Array<Real>, Array<Real>, Array<int>,
+ Grob*,Real , Real);
+ static Real score_forbidden_quants (Grob*, Real, Real,
+ Real, Real, Real, Real,
+ int);
static Molecule stem_beams (Grob*,Item *here, Item *next, Item *prev,
static void set_stem_directions (Grob*);
static void consider_auto_knees (Grob*);
static void set_stem_shorten (Grob*);
- static Real calc_stem_y (Grob*, Item* s, Interval pos);
+ static Real calc_stem_y (Grob*, Grob* s, Interval pos);
static void set_stem_lengths (Grob*);
static int forced_stem_count (Grob*);
};
#define BIGPOINT *BIGPOINT_TO_POINT
#define CHAR *CHAR_TO_PT
+
+#define INTERNAL_UNIT "pt"
+
#else // mm
#define PT *PT_TO_PT *PT_TO_MM
#define INCH *INCH_TO_PT *PT_TO_MM
#define BIGPOINT *BIGPOINT_TO_POINT *PT_TO_MM
#define CHAR *CHAR_TO_PT *PT_TO_MM
+#define INTERNAL_UNIT "mm"
#endif
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static SCM line_atom (Grob* me, Real dx, Real dy);
- static Molecule line_molecule (Grob* me, Real dx, Real dy);
+
+ static Molecule line_molecule (Grob* me, Real thick, Real dx, Real dy);
private:
static Offset get_broken_offset (Grob *me, Direction dir);
static Molecule accordion (SCM arg, Real interline_f, Font_metric*fm);
static Molecule frame (Box b, Real thick);
static Molecule slur (Bezier controls, Real cthick, Real thick) ;
+ static Molecule bezier_sandwich (Bezier, Bezier);
+ static Molecule horizontal_slope (Real, Real, Real);
static Molecule beam (Real, Real, Real) ;
static Molecule dashed_slur (Bezier, Real thick, Real dash) ;
static Molecule blank (Box b) ;
Definition of how to output lilypond.
TODO: smobify, remove Music_output_def_identifier.
+
+ TODO: remove Scope structure. Scheme_hash_table has all the info.
*/
class Music_output_def
{
public:
Scheme_hash_table * translator_tab_;
Scheme_hash_table * variable_tab_;
+
Scope *translator_p_dict_p_;
Scope *scope_p_;
static Molecule brew_mensural_molecule (Item *, Real,
bool, Real, Real,
bool, Direction);
- static Molecule brew_bezier_sandwich (Bezier, Bezier);
- static Molecule brew_horizontal_slope (Real, Real, Real);
static Molecule create_ledger_line (Interval, Grob *);
static Molecule create_streepjes (Grob *, int, int, Interval);
};
DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM));
DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM));
DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));
+ DECLARE_SCHEME_CALLBACK (minimum_start, (SCM));
+ DECLARE_SCHEME_CALLBACK (first_start, (SCM));
/// Transpose, with the interval central C to #p#
virtual void transpose (Pitch p);
scm_gc_unprotect_object (tab->self_scm_);
-
-
-
- TODO:
-
- - This should come from GUILE. We're typically doing double work,
- because KEY already is a symbol, and is looked up in a symbol
- hashtable.
-
- - use GUILE hashtables iso STL.
*/
class Scheme_hash_table
#include "offset.hh"
#include "interval.hh"
#include "pitch.hh"
+#include "dimensions.hh"
SCM
ly_last (SCM list)
return gh_eval_str ((char*)vs);
}
+SCM
+ly_unit ()
+{
+ return gh_str02scm (INTERNAL_UNIT);
+}
+
static void
init_functions ()
{
(Scheme_function_unknown)ly_warning);
scm_c_define_gsubr ("ly-version", 0, 0, 0,
(Scheme_function_unknown)ly_version);
+ scm_c_define_gsubr ("ly-unit", 0, 0, 0,
+ (Scheme_function_unknown)ly_unit);
scm_c_define_gsubr ("ly-gulp-file", 1,0, 0,
(Scheme_function_unknown)ly_gulp_file);
scm_c_define_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p);
#include <math.h>
-SCM
-Line_spanner::line_atom (Grob* me, Real dx, Real dy)
+
+/*
+ slightishly clumsy interface?
+
+ Make a Scheme expression for a line going from (0,0) to (dx,dy).
+ */
+
+static SCM
+line_atom (Grob* me, Real thick, Real dx, Real dy)
{
SCM type = me->get_grob_property ("type");
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real thick = me->paper_l ()->get_var ("stafflinethickness");
-
- SCM s = me->get_grob_property ("line-thickness");
- if (gh_number_p (s))
- thick *= gh_scm2double (s);
// maybe these should be in line-thickness?
Real length = staff_space;
- s = me->get_grob_property ("dash-length");
+ SCM s = me->get_grob_property ("dash-length");
if (gh_number_p (s))
length = gh_scm2double (s) * staff_space;
}
Molecule
-Line_spanner::line_molecule (Grob* me, Real dx, Real dy)
+Line_spanner::line_molecule (Grob* me, Real thick, Real dx, Real dy)
{
Molecule mol;
SCM type = me->get_grob_property ("type");
|| type == ly_symbol2scm ("dotted-line")
|| (type == ly_symbol2scm ("trill") && dy != 0)))
{
- Box b (Interval (0, dx), Interval (0, dy));
- mol = Molecule (b, line_atom (me, dx, dy));
+ Box b (Interval (-0.5* thick + (0 <? dx) ,0.5* thick+ (0 >? dx)),
+ Interval (- 0.5* thick + (0<? dy), 0.5*thick + (0 >? dy)));
+ mol = Molecule (b, line_atom (me, thick, dx, dy));
}
else if (gh_symbol_p (type)
&& type == ly_symbol2scm ("trill"))
Y_AXIS));
}
+
+ Real thick = me->paper_l ()->get_var ("stafflinethickness");
+
+ SCM s = me->get_grob_property ("line-thickness");
+ if (gh_number_p (s))
+ thick *= gh_scm2double (s);
+
- Molecule line = line_molecule (me, dxy[X_AXIS], dxy[Y_AXIS]);
+ Molecule line = line_molecule (me, thick, dxy[X_AXIS], dxy[Y_AXIS]);
line.translate_axis (bound[LEFT]->extent (bound[LEFT],
X_AXIS).length ()/2, X_AXIS);
line.translate (ofxy - my_off + his_off);
return Molecule (b, at);
}
+/*
+ * Bezier Sandwich:
+ *
+ * .|
+ * . |
+ * top . |
+ * . curve |
+ * . |
+ * . |
+ * . |
+ * | |
+ * | .|
+ * | .
+ * | bottom .
+ * | . curve
+ * | .
+ * | .
+ * | .
+ * | .
+ * |.
+ * |
+ *
+ */
+Molecule
+Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
+{
+ /*
+ Need the weird order b.o. the way PS want its arguments
+ */
+ SCM list = SCM_EOL;
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[3]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[0]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[1]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[2]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[0]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[3]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[2]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[1]), list);
+
+ SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
+ ly_quote_scm (list),
+ gh_double2scm (0.0),
+ SCM_UNDEFINED);
+
+ Interval x_extent = top_curve.extent (X_AXIS);
+ x_extent.unite (bottom_curve.extent (X_AXIS));
+ Interval y_extent = top_curve.extent (Y_AXIS);
+ y_extent.unite (bottom_curve.extent (Y_AXIS));
+ Box b (x_extent, y_extent);
+
+ return Molecule (b, horizontal_bend);
+}
+
+/*
+ * Horizontal Slope:
+ *
+ * /| ^
+ * / | |
+ * / | | height
+ * / | |
+ * / | v
+ * | /
+ * | /
+ * (0,0) x /slope=dy/dx
+ * | /
+ * |/
+ *
+ * <----->
+ * width
+ */
+Molecule
+Lookup::horizontal_slope (Real width, Real slope, Real height)
+{
+ SCM width_scm = gh_double2scm (width);
+ SCM slope_scm = gh_double2scm (slope);
+ SCM height_scm = gh_double2scm (height);
+ SCM horizontal_slope = scm_list_n (ly_symbol2scm ("beam"),
+ width_scm, slope_scm,
+ height_scm, SCM_UNDEFINED);
+ Box b (Interval (0, width),
+ Interval (-height/2, height/2 + width*slope));
+ return Molecule (b, horizontal_slope);
+}
+
/*
TODO: junk me.
*/
Moment
Music::start_mom () const
{
+ SCM l = get_mus_property ("start-moment-function");
+ if (gh_procedure_p (l))
+ {
+ SCM res = gh_call1 (l, self_scm ());
+ return *unsmob_moment (res);
+ }
+
Moment m ;
return m;
}
SCM
Paper_def::font_descriptions ()const
{
-
-
SCM l = SCM_EOL;
for (SCM s = scaled_fonts_; gh_pair_p (s); s = ly_cdr (s))
{
output_String_def ("lilypondtagline", id_str);
output_String_def ("LilyPondVersion", version_str ());
+ output_String_def ("lilypondpaperunit", String (INTERNAL_UNIT));
}
-
-
void
Paper_outputter::output_Real_def (String k, Real v)
{
if (solid)
{
Molecule solid_head =
- brew_bezier_sandwich (top_curve, bottom_curve);
+ Lookup::bezier_sandwich (top_curve, bottom_curve);
molecule.add_molecule (solid_head);
}
else // outline
Bezier inner_top_curve = top_curve;
inner_top_curve.translate (Offset (0.0, -thickness));
Molecule top_edge =
- brew_bezier_sandwich (top_curve, inner_top_curve);
+ Lookup::bezier_sandwich (top_curve, inner_top_curve);
molecule.add_molecule(top_edge);
Bezier inner_bottom_curve = bottom_curve;
inner_bottom_curve.translate (Offset (0.0, +thickness));
Molecule bottom_edge =
- brew_bezier_sandwich (bottom_curve, inner_bottom_curve);
+ Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
molecule.add_molecule(bottom_edge);
// TODO: Use horizontal slope with proper slope value rather
if (solid)
{
Molecule solid_head =
- brew_horizontal_slope (width, corrected_slope, height);
+ Lookup::horizontal_slope (width, corrected_slope, height);
molecule.add_molecule (solid_head);
}
else // outline
{
Molecule left_edge =
- brew_horizontal_slope (thickness, corrected_slope, height);
+ Lookup::horizontal_slope (thickness, corrected_slope, height);
molecule.add_molecule(left_edge);
Molecule right_edge =
- brew_horizontal_slope (thickness, corrected_slope, height);
+ Lookup::horizontal_slope (thickness, corrected_slope, height);
right_edge.translate_axis (width-thickness, X_AXIS);
right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
molecule.add_molecule(right_edge);
Molecule bottom_edge =
- brew_horizontal_slope (width, corrected_slope, thickness);
+ Lookup::horizontal_slope (width, corrected_slope, thickness);
bottom_edge.translate_axis (-0.5*height, Y_AXIS);
molecule.add_molecule (bottom_edge);
Molecule top_edge =
- brew_horizontal_slope (width, corrected_slope, thickness);
+ Lookup::horizontal_slope (width, corrected_slope, thickness);
top_edge.translate_axis (+0.5*height, Y_AXIS);
molecule.add_molecule (top_edge);
}
molecule.translate_axis (ypos_correction, Y_AXIS);
return molecule;
}
-
-/*
- * Bezier Sandwich:
- *
- * .|
- * . |
- * top . |
- * . curve |
- * . |
- * . |
- * . |
- * | |
- * | .|
- * | .
- * | bottom .
- * | . curve
- * | .
- * | .
- * | .
- * | .
- * |.
- * |
- *
- */
-// TODO: Move this to class Lookup?
-Molecule
-Porrectus::brew_bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
-{
- /*
- Need the weird order b.o. the way PS want its arguments
- */
- SCM list = SCM_EOL;
- list = gh_cons (ly_offset2scm (bottom_curve.control_[3]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[0]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[1]), list);
- list = gh_cons (ly_offset2scm (bottom_curve.control_[2]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[0]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[3]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[2]), list);
- list = gh_cons (ly_offset2scm (top_curve.control_[1]), list);
-
- SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
- ly_quote_scm (list),
- gh_double2scm (0.0),
- SCM_UNDEFINED);
-
- Interval x_extent = top_curve.extent (X_AXIS);
- x_extent.unite (bottom_curve.extent (X_AXIS));
- Interval y_extent = top_curve.extent (Y_AXIS);
- y_extent.unite (bottom_curve.extent (Y_AXIS));
- Box b (x_extent, y_extent);
-
- return Molecule (b, horizontal_bend);
-}
-
-/*
- * Horizontal Slope:
- *
- * /| ^
- * / | |
- * / | | height
- * / | |
- * / | v
- * | /
- * | /
- * (0,0) x /slope=dy/dx
- * | /
- * |/
- *
- * <----->
- * width
- */
-// TODO: Move this to class Lookup?
-Molecule
-Porrectus::brew_horizontal_slope (Real width, Real slope, Real height)
-{
- SCM width_scm = gh_double2scm (width);
- SCM slope_scm = gh_double2scm (slope);
- SCM height_scm = gh_double2scm (height);
- SCM horizontal_slope = scm_list_n (ly_symbol2scm ("beam"),
- width_scm, slope_scm,
- height_scm, SCM_UNDEFINED);
- Box b (Interval (0, width),
- Interval (-height/2, height/2 + width*slope));
- return Molecule (b, horizontal_slope);
-}
#include "music-list.hh"
#include "pitch.hh"
#include "debug.hh"
+#include "music-sequence.hh"
Music *
Repeated_music::body ()const
{
set_mus_property ("type", ly_symbol2scm ("repeated-music"));
}
+
+
+MAKE_SCHEME_CALLBACK (Repeated_music,minimum_start, 1);
+MAKE_SCHEME_CALLBACK (Repeated_music,first_start, 1);
+
+SCM
+Repeated_music::minimum_start (SCM m)
+{
+ Music * me = unsmob_music (m);
+ Music * body = unsmob_music (me->get_mus_property ("element"));
+
+ if (body)
+ return body->start_mom ().smobbed_copy();
+ else
+ {
+ return Music_sequence::minimum_start (me->get_mus_property ("elements")).smobbed_copy();
+ }
+}
+
+SCM
+Repeated_music::first_start (SCM m)
+{
+ Music * me = unsmob_music (m);
+ Music * body = unsmob_music (me->get_mus_property ("element"));
+
+ Moment rv = (body) ? body->start_mom () :
+ Music_sequence::first_start (me->get_mus_property ("elements"));
+
+ return rv.smobbed_copy ();
+}
positions->force_f_ = force_f_;
if ((force_f_ < 0))
{
- positions->force_f_ *= 1.3;
+
+ /*
+ We used to have a penalty for compression, no matter what, but that
+ fucked up wtk1-fugue2 (taking 3 full pages.)
+
+ maybe this should be tunable?
+ */
if (compression_penalty_b_)
positions->force_f_ *= 2; // hmm.
}
return d;
}
+/*
+ Generate spacing for a single measure. We used to have code that did
+ per-measure spacing. Now we have piecewise spacing. We should fix
+ this to support "spacing-regions": some regions have different notes
+ (different time sigs) than others, and should be spaced differently.
+ */
void
Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols)
{
}
}
+
+/*
+ Generate the space between two musical columns LC and RC, given spacing parameters INCR and SHRTEST.
+ */
void
Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real increment, Rational shortest)
{
/*
- text-spanner.cc -- implement Text_spanner
+text-spanner.cc -- implement Text_spanner
- source file of the GNU LilyPond music typesetter
+source file of the GNU LilyPond music typesetter
- (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+(c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "molecule.hh"
/*
TODO:
- - vertical start / vertical end (fixme-name) |
- - contination types (vert. star, vert. end) |-> eat volta-spanner
- - more styles
- - more texts/positions
- */
+ - vertical start / vertical end (fixme-name) |
+ - contination types (vert. star, vert. end) |-> eat volta-spanner
+ - more styles
+ - more texts/positions
+*/
MAKE_SCHEME_CALLBACK (Text_spanner, brew_molecule, 1);
+/*
+ TODO: this function is too long, too hairy.
+
+ TODO: document this. What the heck is happening here?
+*/
SCM
Text_spanner::brew_molecule (SCM smob)
{
if (!e.empty_b ())
r = e[-d] + padding;
/* Text spanners such as ottava, should span from outer limits of
- noteheads, iso (de)cresc. spanners that span the inner space */
+ noteheads, iso (de)cresc. spanners that span the inner space */
if (me->get_grob_property ("outer") != SCM_EOL)
// r *= -1; // huh?
{
width += gh_scm2double (me->get_grob_property ("width-correct"));
/* /Ugh */
+ // who is ecs? --hwn
SCM properties = Font_interface::font_alist_chain (me);
}
/* ugh */
- Real thick = me->paper_l ()->get_var ("stafflinethickness");
- Molecule line = Line_spanner::line_molecule (me, width, 0);
+ Real thick = me->paper_l ()->get_var ("stafflinethickness");
+ SCM st = me->get_grob_property ("thickness");
+ if (gh_number_p (st))
+ {
+ thick *= gh_scm2double (st);
+
+ }
+ Molecule line = Line_spanner::line_molecule (me, thick, width, 0);
Drul_array<Molecule> edge_line;
s = me->get_grob_property ("edge-height");
Real dy = gh_scm2double (index_cell (s, d)) * - dir;
if (dy)
{
- SCM list = Line_spanner::line_atom (me, dx, dy);
- Box b (Interval (-thick, 0),
- dy > 0
- ? Interval (0, dy)
- : Interval (dy, 0));
- edge_line[d] = Molecule (b, list);
+ edge_line[d] = Line_spanner::line_molecule (me, thick, dx, dy);
}
}
while (flip (&d) != LEFT);
if (!edge_line[LEFT].empty_b ())
m.add_at_edge (X_AXIS, RIGHT, edge_line[LEFT], 0);
if (!line.empty_b ())
- m.add_at_edge (X_AXIS, RIGHT, line, 0);
+ m.add_at_edge (X_AXIS, RIGHT, line,
+ edge_line[LEFT].empty_b () ? 0 : - thick/2);
if (!edge_line[RIGHT].empty_b ())
- m.add_at_edge (X_AXIS, RIGHT, edge_line[RIGHT], 0);
+ m.add_at_edge (X_AXIS, RIGHT, edge_line[RIGHT], -thick/2);
if (!edge[RIGHT].empty_b ())
m.add_at_edge (X_AXIS, RIGHT, edge[RIGHT], 0);
m.translate_axis (broken_left + extra_off[LEFT] + shorten[LEFT], X_AXIS);
*/
void
-Text_spanner::setup_pedal_bracket(Spanner *s)
+Text_spanner::setup_pedal_bracket(Spanner *me)
{
- Real thick = s->paper_l ()->get_var ("stafflinethickness");
+ Real thick = me->paper_l ()->get_var ("stafflinethickness");
+ SCM st = me->get_grob_property ("thickness");
+ if (gh_number_p (st))
+ {
+ thick *= gh_scm2double (st);
+ }
Drul_array<bool> w, broken;
Drul_array<Real> height, width, shorten, r;
- SCM pa = s->get_grob_property ("if-text-padding");
- SCM ew = s->get_grob_property ("edge-width");
- SCM eh = s->get_grob_property ("edge-height");
- SCM sp = s->get_grob_property ("shorten-pair");
- SCM wl = s->get_grob_property ("left-widen");
- SCM wr = s->get_grob_property ("right-widen");
+ SCM pa = me->get_grob_property ("if-text-padding");
+ SCM ew = me->get_grob_property ("edge-width");
+ SCM eh = me->get_grob_property ("edge-height");
+ SCM sp = me->get_grob_property ("shorten-pair");
+ SCM wl = me->get_grob_property ("left-widen");
+ SCM wr = me->get_grob_property ("right-widen");
// Pedal has an angled left edge \__ or an angled right edge __/
w[LEFT] = w[RIGHT] = false;
padding = gh_scm2double (pa);
do {
- Item *b = s->get_bound (d);
+ Item *b = me->get_bound (d);
e = b->extent (b, X_AXIS);
if (!e.empty_b ())
Real extra_short = 0;
// For 'Mixed' style pedals, i.e. a bracket preceded by text: Ped._____|
// need to shorten by the extent of the text grob
- if ( to_boolean (s->get_grob_property ("text-start")) )
+ if ( to_boolean (me->get_grob_property ("text-start")) )
{
height[LEFT] = 0;
- Grob * textbit = s->get_parent(Y_AXIS);
+ Grob * textbit = me->get_parent(Y_AXIS);
extra_short = padding;
if (textbit->has_interface(ly_symbol2scm("piano-pedal-interface")))
// for pretty Ped. scripts.
{
SCM text = textbit->get_grob_property("text");
if (gh_string_p (text)) {
- SCM properties = Font_interface::font_alist_chain (s);
- Molecule mol = Text_item::text2molecule (s, text, properties);
+ SCM properties = Font_interface::font_alist_chain (me);
+ Molecule mol = Text_item::text2molecule (me, text, properties);
extra_short += mol.extent(X_AXIS).length() / 2;
}
}
shorten[LEFT] += abs(width[LEFT]) * 2 + extra_short ;
if (broken[LEFT]) {
- shorten[LEFT] -= s->get_broken_left_end_align () ;
+ shorten[LEFT] -= me->get_broken_left_end_align () ;
shorten[RIGHT] -= r[RIGHT];
}
else
// Shorten bracket on the right so it ends just before the spanned note.
shorten[RIGHT] += thick - (r[LEFT] + r[RIGHT]);
- s->set_grob_property ("edge-height", gh_cons ( gh_double2scm ( height[LEFT] ) ,
- gh_double2scm ( height[RIGHT]) ) );
- s->set_grob_property ("edge-width", gh_cons ( gh_double2scm ( width[LEFT] ),
- gh_double2scm ( width[RIGHT] ) ));
- s->set_grob_property ("shorten-pair", gh_cons ( gh_double2scm ( shorten[LEFT] ),
- gh_double2scm ( shorten[RIGHT] ) ));
+ me->set_grob_property ("edge-height", gh_cons ( gh_double2scm ( height[LEFT] ) ,
+ gh_double2scm ( height[RIGHT]) ) );
+ me->set_grob_property ("edge-width", gh_cons ( gh_double2scm ( width[LEFT] ),
+ gh_double2scm ( width[RIGHT] ) ));
+ me->set_grob_property ("shorten-pair", gh_cons ( gh_double2scm ( shorten[LEFT] ),
+ gh_double2scm ( shorten[RIGHT] ) ));
}
\consists "Grob_pq_engraver"
\consistsend "Axis_group_engraver"
-
- MinimumVerticalExtent = #'(-4 . 4)
+
+
+ MinimumVerticalExtent = #'(-6 . 6)
ExtraVerticalExtent = ##f
VerticalExtent = ##f
localKeySignature = #'()
\property Voice.Stem \override #'no-stem-extend = ##t
\property Voice.Stem \override #'flag-style = #"grace"
- \property Voice.Beam \override #'space-function = #grace-beam-space-function
\property Voice.Beam \override #'thickness = #0.384
% Can't use Staff.fontSize, since time sigs, keys sigs, etc. will
\include \paperfile
\include "paper-init.ly"
+unit = "mm"
staffspace = \staffheight / 4.0
stafflinethickness = \staffspace / 10.0
outputscale = \staffheight / 4.0
% blotdiameter = 0.4 \pt
blotdiameter = 0.04 \pt
+interscoreline = 4. \mm
\translator { \NoteNamesContext }
Begin3
Title: LilyPond
-Version: 1.5.45
-Entered-date: 21MRT02
+Version: 1.5.46
+Entered-date: 23MRT02
Description: @BLURB@
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.5.45.tar.gz
+ 1000k lilypond-1.5.46.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.5.45.tar.gz
+ 1000k lilypond-1.5.46.tar.gz
Copying-policy: GPL
End
%define name lilypond
-%define version 1.5.45
+%define version 1.5.46
%define release 1mdk
Name: %{name}
%define info yes
Name: lilypond
-Version: 1.5.45
+Version: 1.5.46
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.46.tar.gz
Summary: Create and print music notation
URL: http://www.lilypond.org/
BuildRoot: /tmp/lilypond-install
Distribution: SuSE Linux 7.0 (i386)
Name: lilypond
-Version: 1.5.45
+Version: 1.5.46
Release: 2
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.46.tar.gz
# music notation software for.. ?
Summary: A program for printing sheet music.
URL: http://www.lilypond.org/
##
## todo: this also depends on .tfm, FIXME.
$(outdir)/%.afm $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log
- $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --afm $(outdir)/$(<F:.log=.afm) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=.ly) $<
+ $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --afm $(outdir)/$(<F:.log=.afm) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=list.ly) $<
local-clean:
rm -f mfplain.mem mfplain.log
draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
enddef;
+fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
+ set_char_box(0, neomens_block_rest_x#,
+ neomens_block_rest_y#, 2 neomens_block_rest_y#);
+ draw_block ((0,-neomens_block_rest_y),
+ (neomens_block_rest_x, 2 neomens_block_rest_y));
+fet_endchar;
+
fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
set_char_box(0, neomens_block_rest_x#,
neomens_block_rest_y#, neomens_block_rest_y#);
fet_endchar;
-def draw_petrucci_c_clef(expr exact_center, reduction) =
+def draw_petrucci_c_clef(expr exact_center, flare_align, reduction) =
% inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
% 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
draw_brevis(exact_center, reduction, true, true);
- save reduced_il, reduced_slt;
+ save half_reduced_il, reduced_il, reduced_slt;
save stem_width, interline;
+ half_reduced_il# = staff_space# * sqrt(reduction);
reduced_il# = staff_space# * reduction;
reduced_slt# = stafflinethickness# * reduction;
stem_width# = 1.4 reduced_slt#;
interline# = staff_space#;
+ define_pixels(half_reduced_il);
define_pixels(reduced_il);
define_pixels(reduced_slt);
define_pixels(stem_width);
addto currentpicture also currentpicture
yscaled -1 shifted (0, 2*(ypart exact_center) - interline);
- pickup pencircle xscaled stem_width yscaled blot_diameter;
- z6 = exact_center + (stem_width/2, 0);
- z7 = z6 + (0, -2.2reduced_il);
- draw z6 .. z7;
-
addto currentpicture also currentpicture
- xscaled -1 shifted (2x4l,0);
-
- z8 = exact_center + (stem_width/2, 0);
- z9 = z8 + (0, -3.2reduced_il);
- draw z8 .. z9;
+ xscaled -1 shifted (reduction*2x4l,0);
addto currentpicture also currentpicture
yscaled -1 shifted (0, 4*(ypart exact_center));
+ pickup pencircle xscaled stem_width yscaled blot_diameter;
+
+ xpart z6 = xpart z7 = xpart exact_center + stem_width/2;
+ ypart z6 = ypart exact_center +
+ min(3.2, 3.2 + 0.2 + flare_align)*half_reduced_il;
+ ypart z7 = ypart exact_center -
+ min(3.2, 3.2 + 0.2 - flare_align)*half_reduced_il;
+ draw z6 .. z7;
+
+ xpart z8 = xpart z9 = reduction*2x4l - xpart exact_center - stem_width/2;
+ ypart z8 = min(ypart z6 - 0.2*half_reduced_il,
+ xpart exact_center + 2.2half_reduced_il);
+ ypart z9 = max(ypart z7 + 0.2*half_reduced_il,
+ xpart exact_center - 2.2half_reduced_il);
+ draw z8 .. z9;
+
set_char_box(0, 2head_width#,
noteheight#*4*reduction, noteheight#*4*reduction);
enddef;
-fet_beginchar("petrucci c clef", "petrucci_c", "petruccicclef")
+fet_beginchar("petrucci c1 clef", "petrucci_c1", "petruccic1clef")
+ if test = 1:
+ draw_staff(-1,3, 0.0);
+ fi;
+ draw_petrucci_c_clef((0,0), +2, 1.0);
+fet_endchar;
+fet_beginchar("petrucci c1 clef", "petrucci_c1_change", "cpetruccic1clef")
+ draw_petrucci_c_clef((1.3 staff_space#,0), +2, .8);
+fet_endchar;
+
+fet_beginchar("petrucci c2 clef", "petrucci_c2", "petruccic2clef")
+ if test = 1:
+ draw_staff(-1,3, 0.0);
+ fi;
+ draw_petrucci_c_clef((0,0), +1, 1.0);
+fet_endchar;
+fet_beginchar("petrucci c2 clef", "petrucci_c2_change", "cpetruccic2clef")
+ draw_petrucci_c_clef((1.3 staff_space#,0), +1, .8);
+fet_endchar;
+
+fet_beginchar("petrucci c3 clef", "petrucci_c3", "petruccic3clef")
+ if test = 1:
+ draw_staff(-1,3, 0.0);
+ fi;
+ draw_petrucci_c_clef((0,0), 0, 1.0);
+fet_endchar;
+fet_beginchar("petrucci c3 clef", "petrucci_c3_change", "cpetruccic3clef")
+ draw_petrucci_c_clef((1.3 staff_space#,0), 0, .8);
+fet_endchar;
+
+fet_beginchar("petrucci c4 clef", "petrucci_c4", "petruccic4clef")
+ if test = 1:
+ draw_staff(-1,3, 0.0);
+ fi;
+ draw_petrucci_c_clef((0,0), -1, 1.0);
+fet_endchar;
+fet_beginchar("petrucci c4 clef", "petrucci_c4_change", "cpetruccic4clef")
+ draw_petrucci_c_clef((1.3 staff_space#,0), -1, .8);
+fet_endchar;
+
+fet_beginchar("petrucci c5 clef", "petrucci_c5", "petruccic5clef")
if test = 1:
draw_staff(-1,3, 0.0);
fi;
- draw_petrucci_c_clef((0,0), 1.0);
+ draw_petrucci_c_clef((0,0), -2, 1.0);
fet_endchar;
-fet_beginchar("petrucci c clef", "petrucci_c_change", "cpetruccicclef")
- draw_petrucci_c_clef((1.3 staff_space#,0), .8);
+fet_beginchar("petrucci c5 clef", "petrucci_c5_change", "cpetruc5iceclef")
+ draw_petrucci_c_clef((1.3 staff_space#,0), -2, .8);
fet_endchar;
def draw_mensural_c_clef(expr exact_center, reduction) =
% inspired by Ockeghem, "Missa Prolationum", in: MGG, volume
% 9, table 94.
- draw_petrucci_c_clef(exact_center, reduction);
+ draw_petrucci_c_clef(exact_center, 0, reduction);
addto currentpicture also currentpicture
shifted (0, -interline);
%
%
-pen_width# = 2/5 staff_space#;
+pen_width# = 0.3 staff_space#;
pen_height# = 0;
pen_rotation = 30;
slight_pen_rotation = 15;
define_pixels(mens_block_rest_y, mens_half_block_rest_y,
pen_width, pen_height);
+fet_beginchar("Mensural maxima rest", "-3mensural", "mensmaximarest");
+ set_char_box(0.7pen_width#, 0.7pen_width#,
+ mens_block_rest_y#, 2mens_block_rest_y#);
+ pickup pencircle
+ xscaled pen_width
+ yscaled pen_height
+ rotated slight_pen_rotation;
+ draw (0, -mens_block_rest_y) -- (0, 2 mens_block_rest_y);
+fet_endchar;
+
fet_beginchar("Mensural longa rest", "-2mensural", "menslongarest");
- set_char_box(pen_width#/2, pen_width#/2,
+ set_char_box(0.7pen_width#, 0.7pen_width#,
mens_block_rest_y#, mens_block_rest_y#);
pickup pencircle
xscaled pen_width
fet_endchar;
fet_beginchar("Mensural breve rest", "-1mensural", "mensbreverest");
- set_char_box(pen_width#/2, pen_width#/2,
+ set_char_box(0.7pen_width#, 0.7pen_width#,
0, mens_block_rest_y#);
pickup pencircle
xscaled pen_width
fet_endchar;
fet_beginchar("Mensural whole rest", "0mensural", "menssemibrevisrest");
- set_char_box(pen_width#/2, pen_width#/2,
+ set_char_box(0.7pen_width#, 0.7pen_width#,
mens_half_block_rest_y#, 0);
pickup pencircle
xscaled pen_width
fet_endchar;
fet_beginchar("Mensural half rest", "1mensural", "mensminimahalfrest");
- set_char_box(pen_width#/2, pen_width#/2,
+ set_char_box(0.7pen_width#, 0.7pen_width#,
0, mens_half_block_rest_y#);
pickup pencircle
xscaled pen_width
(let*
((supported-reps
`(("volta" . ((iterator-ctor . ,Volta_repeat_iterator::constructor)
+ (start-moment-function . ,Repeated_music::first_start)
(length . ,Repeated_music::volta_music_length)))
("unfold" . ((iterator-ctor . ,Unfolded_repeat_iterator::constructor)
- (length . ,Repeated_music::unfolded_music_length)))
+ (start-moment-function . ,Repeated_music::first_start)
+ (length . ,Repeated_music::unfolded_music_length)))
("fold" . ((iterator-ctor . ,Folded_repeat_iterator::constructor)
+ (start-moment-function . ,Repeated_music::minimum_start)
(length . ,Repeated_music::folded_music_length)))
("percent" . ((iterator-ctor . ,Percent_repeat_iterator::constructor)
+ (start-moment-function . ,Repeated_music::first_start)
(length . ,Repeated_music::unfolded_music_length)))
("tremolo" . ((iterator-ctor . ,Chord_tremolo_iterator::constructor)
+ (start-moment-function . ,Repeated_music::first_start)
(length . ,Repeated_music::unfolded_music_length)))))
(handle (assoc name supported-reps)))
("neo_mensural_c2" . ("clefs-neo_mensural_c" -2 0))
("neo_mensural_c3" . ("clefs-neo_mensural_c" 0 0))
("neo_mensural_c4" . ("clefs-neo_mensural_c" 2 0))
- ("petrucci_c1" . ("clefs-petrucci_c" -4 0))
- ("petrucci_c2" . ("clefs-petrucci_c" -2 0))
- ("petrucci_c3" . ("clefs-petrucci_c" 0 0))
- ("petrucci_c4" . ("clefs-petrucci_c" 2 0))
- ("petrucci_c5" . ("clefs-petrucci_c" 4 0))
+ ("petrucci_c1" . ("clefs-petrucci_c1" -4 0))
+ ("petrucci_c2" . ("clefs-petrucci_c2" -2 0))
+ ("petrucci_c3" . ("clefs-petrucci_c3" 0 0))
+ ("petrucci_c4" . ("clefs-petrucci_c4" 2 0))
+ ("petrucci_c5" . ("clefs-petrucci_c5" 4 0))
("petrucci_f" . ("clefs-petrucci_f" 2 0))
("petrucci_g" . ("clefs-petrucci_g" -2 0))
)
("clefs-mensural_f" . 4)
("clefs-mensural_g" . -4)
("clefs-neo_mensural_c" . 0)
- ("clefs-petrucci_c" . 0)
+ ("clefs-petrucci_c1" . 0)
+ ("clefs-petrucci_c2" . 0)
+ ("clefs-petrucci_c3" . 0)
+ ("clefs-petrucci_c4" . 0)
+ ("clefs-petrucci_c5" . 0)
("clefs-petrucci_f" . 4)
("clefs-petrucci_g" . -4)
)
(before-line-breaking-callback . ,Beam::before_line_breaking)
(after-line-breaking-callback . (,Beam::after_line_breaking
,Beam::end_after_line_breaking))
- (quant-score-functions . (,Beam::score_forbidden_quants
- ,Beam::score_slopes_dy
- ,Beam::score_stem_lengths
- ))
+; (quant-score-functions . (
+; ,Beam::score_stem_lengths
+; ))
(neutral-direction . -1)
(dir-function . ,beam-dir-majority-median)
(beamed-stem-shorten . (1.0 0.5))
(edge-width . (0.5 . 0.5))
(edge-height . (1.0 . 1.0))
(shorten-pair . (0.0 . 0.0))
- (left-widen . #f)
- (right-widen . #f)
- (text-start . #f)
+ (thickness . 1.0)
(meta . ,(grob-description piano-pedal-interface))
))
(define (box-grob-molecule grob)
- "Make a box of exactly the extents of the grob."
+ "Make a box of exactly the extents of the grob. The box precisely
+encloses the contents.
+"
(let* ((xext (ly-get-extent grob grob 0))
(yext (ly-get-extent grob grob 1))
(mol (ly-make-molecule '() '(10000 . -10000) '(10000 . -10000)))
(thick 0.1)
)
- (display "hoi")
- (set! mol (ly-add-molecule mol (box-molecule xext (cons (car yext) (+ (car yext) thick)))))
- (set! mol (ly-add-molecule mol (box-molecule xext (cons (- (cdr yext) thick) (cdr yext)))))
- (set! mol (ly-add-molecule mol (box-molecule (cons (car xext) (+ (car xext) thick)) yext)))
- (set! mol (ly-add-molecule mol (box-molecule (cons (- (cdr xext) thick) (cdr xext)) yext)))
+
+ (set! mol (ly-add-molecule mol (box-molecule xext (cons (- (car yext) thick) (car yext) ))))
+ (set! mol (ly-add-molecule mol (box-molecule xext (cons (cdr yext) (+ (cdr yext) thick) ))))
+ (set! mol (ly-add-molecule mol (box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext)))
+ (set! mol (ly-add-molecule mol (box-molecule (cons (- (car xext) thick) (car xext)) yext)))
mol
))
(begin
(ly-set-mus-property
music 'length Repeated_music::unfolded_music_length)
+ (ly-set-mus-property
+ music 'start-moment-function Repeated_music::first_start)
(ly-set-mus-property
music 'iterator-ctor Unfolded_repeat_iterator::constructor)))
music))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
(define (pitchify-scripts music)
"Copy the pitch fields of the Note_requests into Text_script_requests, to aid
Fingering_engraver."
(music-property-description 'type symbol? "The type of this music object. Determines iteration in some cases.")
(music-property-description 'repeat-count integer? "do a @code{\repeat} how ofen?")
(music-property-description 'span-direction dir? "Does this start or stop a spanner?")
+
+(music-property-description 'start-moment-function procedure? "Function to compute the negative length of
+starting grace notes.")
+
(music-property-description 'symbol symbol? "Grob name to perform an override/revert on.")
(music-property-description 'text markup? "markup expression to be printed")
;; markup?
(string-append
"/" command
" { /"
- (car name-mag)
+ (capitalize-font-name (car name-mag))
" findfont "
"20 " (ly-number->string (cdr name-mag)) " mul "
"output-scale div scalefont setfont } bind def "
"\n"))
+;; Ugh, the Bluesky type1 fonts for computer modern use capitalized
+;; postscript font names.
+(define (capitalize-font-name name)
+ (if (equal? (substring name 0 2) "cm")
+ (string-upcase name)
+ name))
+
(define (beam width slope thick)
(string-append
(numbers->string (list slope width thick)) " draw_beam" ))
(define (header-end)
(string-append
+ "\\def\\scaletounit{ "
+ (number->string (cond
+ ((equal? (ly-unit) "mm") (/ 72.0 25.4))
+ ((equal? (ly-unit) "pt") (/ 72.0 72.27))
+ (else (error "unknown unit" (ly-unit)))
+ ))
+ " mul }"
"\\special{\\string! "
;; URG: ly-gulp-file: now we can't use scm output without Lily
(ly-gulp-file "music-drawing-routines.ps"))
(if (defined? 'ps-testing) "/testing true def%\n" "")
"}"
- "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale "
- ;; "pt"
- "mm"
-
+ "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit"
"\\turnOnPostScript"))
;; Note: this string must match the string in ly2dvi.py!!!
(embedded-ps (list 'bezier-sandwich `(quote ,l) thick)))
(define (start-line ht)
- (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
+ (string-append "\\vbox to " (number->dim ht) "{\\hbox{"
+ "%\n"))
(define (stop-line)
"}\\vss}\\interscoreline\n")
def get_bbox (filename):
- f = open (filename)
+ system ('gs -sDEVICE=bbox -q -sOutputFile=- -dNOPAUSE %s -c quit > %s.bbox 2>&1 ' % (filename, filename))
+
+ box = open (filename + '.bbox').read()
+ m = re.match ('^%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)', box)
gr = []
- while 1:
- l =f.readline ()
- m = re.match ('^%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)', l)
- if m:
- gr = map (string.atoi, m.groups ())
- break
+ if m:
+ gr = map (string.atoi, m.groups ())
return gr
def make_pixmap (name):
bbox = get_bbox (name + '.eps')
- margin = 3
+ margin = 0
fo = open (name + '.trans.eps' , 'w')
fo.write ('%d %d translate\n' % (-bbox[0]+margin, -bbox[1]+margin))
fo.close ()
# Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (Bourne shell script)
#
-
-#
-# TODO: should allow to set a central pk cache directory from the command line.
-# TODO: should allow to switch off pk cache.
-#
-
#
# Note: gettext work best if we use ' for docstrings and "
# for gettextable strings.
'pagenumber' : [1],
'textheight' : [],
'linewidth' : [],
- 'orientation' : []
+ 'orientation' : [],
+ 'unit' : ['pt'],
}
extra_fields = extra_init.keys ()
include_path = ['.']
lily_p = 1
paper_p = 1
-cache_pks_p = 1
-
-PK_PATTERN='feta.*\.[0-9]+pk'
output_name = ''
targets = {
kpse = os.popen ('kpsexpand \$TEXMF').read()
kpse = re.sub('[ \t\n]+$','', kpse)
+type1_paths = os.popen ('kpsewhich -expand-path=\$T1FONTS').read ()
environment = {
## todo: prevent multiple addition.
'TEXMF' : "{%s,%s}" % (datadir, kpse) ,
- 'GS_FONTPATH' : datadir + '/afm:' + datadir + '/pfa',
+ 'GS_FONTPATH' : type1_paths,
'GS_LIB' : datadir + '/ps',
}
if extra['orientation']:
orientation = extra['orientation'][0]
- # set sane geometry width (a4-width) for linewidth = -1.
+ unit = extra['unit'][-1]
+ # set sane geometry width (a4-width) for linewidth = -1.
maxlw = max (extra['linewidth'] + [-1])
if maxlw < 0:
# who the hell is 597 ?
linewidth = '597pt'
else:
- linewidth = maxlw
- s = s + '\geometry{width=%smm%s,headheight=2mm,footskip=2mm,%s}\n' % (linewidth, textheight, orientation)
+ linewidth = '%d%s' % (maxlw, unit)
+ s = s + '\geometry{width=%s%s,headheight=2mm,footskip=2mm,%s}\n' % (linewidth, textheight, orientation)
if extra['latexoptions']:
s = s + '\geometry{twosideshift=4mm}\n'
setup_environment ()
tmpdir = setup_temp ()
- if cache_pks_p :
- os.chdir (outdir)
- cp_to_dir (PK_PATTERN, tmpdir)
# to be sure, add tmpdir *in front* of inclusion path.
#os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
elif verbose_p:
warning (_ ("can't find file: `%s'") % outname)
- if cache_pks_p:
- cp_to_dir (PK_PATTERN, outdir)
-
os.chdir (original_dir)
cleanup_temp ()
$(MAKE) local-dist $(distdir)
chmod -R a+r $(distdir)
chmod a+x `find $(distdir) -type d -print`
- (cd ./$(depth)/$(outdir); $(TAR) cf - $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
+ (cd ./$(depth)/$(outdir); $(TAR) -cf - --owner=0 --group=0 $(DIST_NAME) | gzip -9 > $(DIST_NAME).tar.gz)
# ugh.
# Can't compare "stage1" dist with "stage2" dist in this way?
-ln -f $(depth)/$(outdir)/$(distname).tar.gz $(release-dir)
%
\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}}
\def\lilySpace{ }
-
-% PostScript PT/IN: 72/25.4
-\def\scaletounit{ 2.834645 mul }
-
-% for true printers points to postscript points:
-%\def\scaletounit{1.00375}
\def\turnOnPostScript{%
% This sets CTM so that you get to the currentpoint
% by executing a 0 0 moveto
% Attempt to keep lilypiecetitle together with the piece:
\def\myfilbreak{\par\vfil\penalty200\vfilneg}
-% stacked horizontal lines
-\ifundefined{lilypondpaperinterscoreline}
- \def\lilypondpaperinterscoreline{16}
-\fi
+
\ifundefined{lilypondpaperinterscorelinefill}
\def\lilypondpaperinterscorelinefill{0}
\else
\def\lilypondpaperinterscorelinefill{1}
\fi
-\def\interscoreline{\vskip\lilypondpaperinterscoreline pt plus %
- \lilypondpaperinterscorelinefill fill}
+\def\interscoreline{\vskip \lilypondpaperinterscoreline \lilypondpaperunit plus \lilypondpaperinterscorelinefill fill}
\def\placebox#1#2#3{%
\botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}%