dpkg --purge lilypond lilypond1.3
@end example
+@subsection MacOS X
+
+LilyPond has been built on Darwin, to be precise, on:
+@example
+ Darwin buoux.aspiratie.nl 5.3 Darwin Kernel Version 5.3: Thu Jan 24
+ 22:06:02 PST 2002; root:xnu/xnu-201.19.obj~1/RELEASE_PPC Power Macintosh powerpc
+@end example
+
+using:
+
+@example
+ Apple Computer, Inc. version gcc-932.1, based on gcc version 2.95.2 19991024 (release)
+@end example
+
+To make sure you have all packages needed to build LilyPond installed,
+run as root:
+
+@example
+ apt-get install bash python guile debianutils flex bison texinfo \
+ ghostscript6 netpbm m4 gettext
+@end example
+
+and:
+
+@example
+ fink install tetex
+@end example
+
+@c brokenness of autoconf; don't ask
+Then, configure, patch, make and install LilyPond using these commands:
+
+@example
+ CC="cc -I/sw/include" CXX="c++ -I/sw/include" LDFLAGS="-L/sw/lib" \
+ ./configure --prefix=/sw
+ make -C lily out/parser.hh out/parser.cc
+ patch -p0 < darwin.patch
+ make -C lily out/parser.o
+ make all
+ make install
+@end example
+
+For installing, you must be root, of course.
@c Why isn't this in BUGS (where it belongs?)
@section Problems
README_FILES = ChangeLog CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
IN_FILES := $(wildcard *.in)
-EXTRA_DIST_FILES = $(wildcard *.el) vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES) emacsclient.patch lexer-gcc-3.0.patch .cvsignore
+EXTRA_DIST_FILES = $(wildcard *.el) vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES) emacsclient.patch lexer-gcc-3.0.patch darwin.patch .cvsignore
NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
INSTALLATION_DIR=$(datadir)
INSTALLATION_FILES=$(configuration) VERSION
--- /dev/null
+--- lily/out/parser.hh.orig Tue Mar 12 16:10:02 2002
++++ lily/out/parser.hh Tue Mar 12 16:23:58 2002
+@@ -14,7 +14,7 @@
+
+ Request * request;
+
+- //* We use SCMs to do strings, because it saves us the trouble of
++ /* We use SCMs to do strings, because it saves us the trouble of
+ deleting them. Let's hope that a stack overflow doesnt trigger a move
+ of the parse stack onto the heap. */
+
+--- lily/out/parser.cc.orig Tue Mar 12 16:08:40 2002
++++ lily/out/parser.cc Tue Mar 12 16:16:02 2002
+@@ -227,7 +227,7 @@
+
+
+ // needed for bison.simple's malloc () and free ()
+-#include <malloc.h>
++#include <stdlib.h>
+
+ #ifndef NDEBUG
+ #define YYDEBUG 1
+@@ -258,7 +258,7 @@
+
+ Request * request;
+
+- //* We use SCMs to do strings, because it saves us the trouble of
++ /* We use SCMs to do strings, because it saves us the trouble of
+ deleting them. Let's hope that a stack overflow doesnt trigger a move
+ of the parse stack onto the heap. */
+
+ SCM scm;
-% #(set! point-and-click line-column-location)
+%% #(set! point-and-click line-column-location)
\header {
-title = "Solo Cello Suite II"
-piece ="Sarabande"
-composer = "J.S.Bach"
-editor = "August Wenzinger"
-source= "B\\\"arenreiter Urtext"
+ title = "Solo Cello Suite II"
+ piece ="Sarabande"
+ composer = "J.S.Bach"
+ editor = "August Wenzinger"
+ source= "B\\\"arenreiter Urtext"
-texidoc = "The B\\\"arenreiter edition of the Cello Suites is the most
+ texidoc = "The B\\\"arenreiter edition of the Cello Suites is the most
beautifully typeset piece of music in our collection of music (we both
own one. It is also lovely on French Horn). This piece follows the
same beaming as the printed edition. This is done in order to
the spacing is almost identical. With a line-break forced before
measure 25, we get back the linebreaking of Baerenreiter.
+
+
This file used to show spacing weaknesses. Now it shows weaknesses in
beam and slur handling.
-Note that the Barenreiter edition contains a mistake. The second line
-begins with measure 6, not 5. "
+Note that the Barenreiter edition contains an engraving mistake. The
+second line begins with measure 6 (but prints 5).
+"
}
sarabandeA = \context Voice \notes \relative c {
- \property Staff.NoteCollision \set #'merge-differently-dotted = ##t
- < { d8. e16 e4.-\trill d16 e } \\
- { d4 a2 } >
- f4. [e8 d c] |
- [bes g'] [f e16(f] [g a bes)d,] |
- cis4.-\trill b8 a g |
-
-% check spacing without accs:
-% c4.-\trill [bes8 a g] |
-
- < { d'8. e16 f4.-\trill d16 e |
- f4. d8 e f }
- \\
- { <a,4 f> a2 <a4. d,4.> } > |
- %5
-
- g8 bes16()a c()bes a()g d'8 f, |
- < e4.-\trill
- \\ <a,,4 e'> >
- [d8 c bes]
- %8
- < { f'8 g16()a a4. g16()f |
- g8 a16()bes bes4. c16()d }
- \\
- { a,4 <bes4. d4. > r8 bes4 <g2 f'2> }
- > |
-
- % 11
- [e,8 f] [c, g'] [f' e] |
- f4 f,2 |
- < { a'4 a4.-\trill bes8
- c bes16 a } \\
- { [f8 es] es4. r8 d4 } >
-
- fis8.-\trill es16 d8 c |
- [bes g'] [a, fis'] [es' d] |
- %16
- < bes4.-\trill d, g, > a8 g f! |
- e bes a f' g a |
- d, as g es' f g |
- [cis, bes'] [a g16 f] [e!8 f16 d] |
- cis8 e16 a a,8. g'16 f8()e |
- %21
- < { d e16()f f4. e16()d |
- e8 f16()g g4. a16()bes |
- a8 cis16 d d,8 e16 f32 g f8-\trill e16()d } \\
- { bes4 g2 |
- g4 <bes4. cis,> s8 |
- <d8 a f> r r g, a4 } >
- |
- d4 d,16 a'( b cis d e f )g |
- \break
- %25
- < { a16(b c)b c4. b16()a |
- b cis d cis d4. e16()f | }
- \\
- { f,4 fis4. s8 |
- <d4 g,> gis4. } >
- d16(cis)d f, a,8 e' d' cis |
- d4 d,,2 |
+ \property Staff.NoteCollision \set #'merge-differently-dotted = ##t
+ < { d8. e16 e4.-\trill d16 e } \\
+ { d4 a2 } >
+ f4. [e8 d c] |
+ [bes g'] [f e16(f] [g a bes)d,] |
+ cis4.-\trill [b8 a g] |
+
+ %% check spacing without accs:
+ %% c4.-\trill [bes8 a g] |
+
+ < { d'8. e16 f4.-\trill d16 e |
+ f4. [d8 e f] }
+ \\
+ { <a,4 f> a2 <a4. d,4.> } > |
+ %%5
+
+ g8 bes16()a c()bes a()g d'8 f, |
+ < e4.-\trill
+ \\ <a,,4 e'> >
+ [d8 c bes]
+ %%8
+ < { f'8 g16()a a4. g16()f |
+ g8 a16()bes bes4. c16()d }
+ \\
+ { a,4 <bes4. d4. > r8 bes4 <g2 f'2> }
+ > |
+
+ %% 11
+ [e,8 f] [c, g'] [f' e] |
+ f4 f,2 |
+ < { a'4 a4.-\trill bes8
+ c bes16 a } \\
+ { [f8 es] es4. r8 d4 } >
+
+ fis8.-\trill es16 d8 c |
+ [bes g']
+ \stemUp
+ [a, fis']
+ \stemBoth
+ [es' d] |
+ %%16
+ < bes4.-\trill d, g, > [a8 g f!] |
+ e bes a f' g a |
+ d, as g es' f g |
+ [cis, bes'] [a g16 f] [e!8 f16 d] |
+ cis8 e16 a a,8. g'16 f8()e |
+ %%21
+ < { d e16()f f4. e16()d |
+ e8 f16()g g4. a16()bes |
+ a8 cis16 d d,8 e16 f32 g f8-\trill e16()d } \\
+ { bes4 g2 |
+ g4 <bes4. cis,> s8 |
+ <d8 a f> r r g, a4 } >
+ |
+ \stemUp
+ d4 d,16 a'( b cis d e f )g |
+ \stemBoth
+ \break
+ %%25
+ < { a16(b c)b c4. b16()a |
+ b cis d cis d4. e16()f | }
+ \\
+ { f,4 fis4. s8 |
+ <d4 g,> gis4. } >
+ \stemUp
+ d16(cis)d f,
+ \stemBoth
+ [a,8 e'] [d' cis] |
+ d4 d,,2 |
}
sarabande = \context Staff \notes<
- \apply #voicify-music \sarabandeA
-
+ \apply #voicify-music \sarabandeA
+
>
\version "1.3.148"
sarabandeCelloGlobal = \notes{
- \time 3/4
- \key f \major
- \clef bass
- \repeat "volta" 2 {
- s2.*12
- } \repeat "volta" 2 {
- s2.*16
- }
+ \time 3/4
+ \key f \major
+ \clef bass
+ \repeat "volta" 2 {
+ s2.*12
+ } \repeat "volta" 2 {
+ s2.*16
+ }
}
sarabandeCelloScripts = \notes{
}
sarabandeCelloStaff = \context Staff <
- \sarabande
- \sarabandeCelloGlobal
- \sarabandeCelloScripts
+ \sarabande
+ \sarabandeCelloGlobal
+ \sarabandeCelloScripts
>
\score{
- \sarabandeCelloStaff
- \paper{
- indent = 7. \mm
- linewidth = 183.5 \mm
- \translator { \ScoreContext
-% SpacingSpanner \override #'maximum-duration-for-spacing = #(make-moment 1 16)
-
-
-}}
- \midi{ \tempo 4 = 40 }
- \header{
- opus= ""
- piece ="Sarabande" }
+ \sarabandeCelloStaff
+ \paper{
+ indent = 7. \mm
+ linewidth = 183.5 \mm
+ \translator { \ScoreContext
+ %% SpacingSpanner \override #'maximum-duration-for-spacing = #(make-moment 1 16)
+
+
+ }}
+ \midi{ \tempo 4 = 40 }
+ \header{
+ opus= ""
+ piece ="Sarabande" }
}
+%%% Local variables:
+%%% LilyPond-indent-level:2
+%%% End:
Spanner*me = dynamic_cast<Spanner*> (m);
Real forced_fraction = forced_stem_count (me) / visible_stem_count (me);
- if (forced_fraction < 0.5)
- return;
int multiplicity = get_multiplicity (me);
SCM shorten_elt = scm_list_ref (shorten, gh_int2scm (multiplicity <? (sz - 1)));
Real shorten_f = gh_scm2double (shorten_elt) * staff_space;
- /* cute, but who invented me -- how to customise ? */
- if (forced_fraction < 1)
- shorten_f /= 2;
-
- Link_array<Item> stems=
- Pointer_group_interface__extract_grobs (me, (Item*)0, "stems");
-
- for (int i=0; i < stems.size (); i++)
- {
- Item* s = stems[i];
- if (Stem::invisible_b (s))
- continue;
- if (gh_number_p (s->get_grob_property ("shorten")))
- s->set_grob_property ("shorten", gh_double2scm (shorten_f));
- }
+ /* your similar cute comment here */
+ shorten_f *= forced_fraction;
+
+ me->set_grob_property ("shorten", gh_double2scm (shorten_f));
}
/*
return SCM_UNSPECIFIED;
}
-MAKE_SCHEME_CALLBACK (Beam, cancel_suspect_slope, 1);
+#include <stdio.h>
+MAKE_SCHEME_CALLBACK (Beam, check_concave, 1);
SCM
-Beam::cancel_suspect_slope (SCM smob)
+Beam::check_concave (SCM smob)
{
Grob *me = unsmob_grob (smob);
+
+ Link_array<Item> stems =
+ Pointer_group_interface__extract_grobs (me, (Item*) 0, "stems");
+
+ for (int i = 0; i < stems.size ();)
+ {
+ if (Stem::invisible_b (stems[i]))
+ stems.del (i);
+ else
+ i++;
+ }
- if (visible_stem_count (me) <= 1)
+ if (stems.size () < 3)
return SCM_UNSPECIFIED;
+
+ /* TODO: find-out what makes beam concave (#1, #2, #3, #4 or
+ something else) */
+ SCM s = me->get_grob_property ("concaveness-no-slope");
+
+ Real concave = 0;
+ if (!to_boolean (s))
+ {
+ /* Concaveness try #1: Sum distances of inner noteheads to line
+ between two outer noteheads. */
+
+ s = me->get_grob_property ("concave-if-bigger-than-two");
+
+ Real dy = Stem::chord_start_f (stems.top ())
+ - Stem::chord_start_f (stems[0]);
+ Real slope = dy / (stems.size () - 1);
+
+ Real y0 = Stem::chord_start_f (stems[0]);
+ for (int i = 1; i < stems.size () - 1; i++)
+ {
+ Real c = (Stem::chord_start_f (stems[i]) - y0) - i * slope;
+
+ /* try #4: (Han-Wen): neem maximum afstand lijn - tot
+ extreme notehead (in geval van akkoorden). Als die
+ afstand >= 2.0 ss was, dan moest hij recht (of blijkbaar:
+ vrijwel recht, zie m 17, 18). Dat was nl. wat stolba zei:
+ als afstand lijn-noot >= 2.0 dan recht. */
+
+ if (to_boolean (s) && c >= 2.0)
+ {
+ concave = 1000 * Directional_element_interface::get (me);
+ break;
+ }
+
+ concave += c;
+ }
+
+ }
+ else
+ {
+ /* Concaveness try #2: Sum distances of inner noteheads that
+ fall outside the interval of the two outer noteheads */
+
+ Interval iv = Interval (Stem::chord_start_f (stems[0]),
+ Stem::chord_start_f (stems.top ()));
+
+ if (iv[MAX] < iv[MIN])
+ // iv.swap ();
+ iv = Interval (iv[MAX], iv[MIN]);
+
+ for (int i = 1; i < stems.size () - 1; i++)
+ {
+ Real c = 0;
+ Real f = Stem::chord_start_f (stems[i]);
+ if ((c = f - iv[MAX]) > 0)
+ concave += c;
+ else if ((c = f - iv[MIN]) < 0)
+ concave += c;
+ }
+ }
- /* Stem_info, and thus y,dy in this function are corrected for beam-dir */
- Direction dir = Directional_element_interface::get (me);
- Real y = gh_scm2double (me->get_grob_property ("y")) * dir;
- Real dy = gh_scm2double (me->get_grob_property ("dy")) * dir;
-
- /* steep slope running against lengthened stem is suspect */
- Real first_ideal = Stem::calc_stem_info (first_visible_stem (me)).idealy_f_;
- Real last_ideal = Stem::calc_stem_info (last_visible_stem (me)).idealy_f_;
- Real lengthened = gh_scm2double (me->get_grob_property ("outer-stem-length-limit"));
- Real steep = gh_scm2double (me->get_grob_property ("slope-limit"));
+ concave *= Directional_element_interface::get (me);
+
+ Real concaveness = concave / (stems.size () - 2);
- // ugh -> use commonx
- Real dx = last_visible_stem (me)->relative_coordinate (0, X_AXIS) - first_visible_stem (me)->relative_coordinate (0, X_AXIS);
- Real dydx = dy && dx ? dy/dx : 0;
+ /* ugh: this is the a kludge to get input/regression/beam-concave.ly
+ to behave as baerenreiter.
+
+ try #3 (add-on to #2): */
+ s = me->get_grob_property ("concaveness-square");
+ if (to_boolean (s))
+ concaveness /= (stems.size () - 2);
+
+ s = me->get_grob_property ("concaveness");
+ Real r = gh_scm2double (s);
- if (( (y - first_ideal > lengthened) && (dydx > steep))
- || ((y + dy - last_ideal > lengthened) && (dydx < -steep)))
+ /* TODO: some sort of damping iso -> plain horizontal */
+ if (concaveness > r)
{
+ Direction dir = Directional_element_interface::get (me);
+ Real y = gh_scm2double (me->get_grob_property ("y")) * dir;
+ Real dy = gh_scm2double (me->get_grob_property ("dy")) * dir;
+
Real adjusted_y = y + dy / 2;
/* Store true, not dir-corrected values */
me->set_grob_property ("y", gh_double2scm (adjusted_y * dir));
me->set_grob_property ("dy", gh_double2scm (0));
}
+
+ s = me->get_grob_property ("debug-concave");
+ if (to_boolean (s))
+ {
+#if 0
+ Item *text = new Item (me->get_property ("TextScript"));
+ text->set_grob_property ("text",
+ ly_str02scm (to_str (concaveness).ch_C ())),
+ Side_position_interface::add_support (text, stem[0]);
+#else
+ printf ("concaveness: %.2f\n", concaveness);
+#endif
+ }
+
return SCM_UNSPECIFIED;
}
Real q = (abs (dy) - iv[SMALLER] <= iv[BIGGER] - abs (dy))
? iv[SMALLER]
: iv[BIGGER];
-
+
+ if (to_boolean (me->get_grob_property ("quantise-dy-never-steeper"))
+ && iv[SMALLER] != 0)
+ q = iv[SMALLER];
+
Real quantised_dy = q * sign (dy);
- Real adjusted_y = y + (dy - quantised_dy) / 2;
+ Real adjusted_y = y + (dy - quantised_dy) * 0.5;
/* Store true, not dir-corrected values */
me->set_grob_property ("y", gh_double2scm (adjusted_y * dir));
me->set_grob_property ("dy", gh_double2scm (quantised_dy * dir));
return stem_y;
}
+/* Make very sure that we don't have stems that are too short.
+ Try our best not to have stems that are too long (think: knees).
+
+ Optionally (testing): try to lengthen more, to reach more ideal
+ stem lengths */
Real
Beam::check_stem_length_f (Grob*me,Real y, Real dy)
{
Link_array<Item> stems=
Pointer_group_interface__extract_grobs (me, (Item*)0, "stems");
+ int ideal_lengthen_count = 0;
+ Real ideal_lengthen = 0;
+
for (int i=0; i < stems.size (); i++)
{
Item* s = stems[i];
// if (0 > info.maxy_f_ - stem_y)
shorten = shorten <? info.maxy_f_ - stem_y;
// if (0 < info.miny_f_ - stem_y)
- lengthen = lengthen >? info.miny_f_ - stem_y;
+ lengthen = lengthen >? info.miny_f_ - stem_y;
+
+ if (info.idealy_f_ - stem_y > 0)
+ {
+ ideal_lengthen += (info.idealy_f_ - stem_y);
+ ideal_lengthen_count++;
+ }
+ // too long is not so bad as too short
+ else if (0) //info.idealy_f_ - stem_y < 0)
+ {
+ ideal_lengthen += info.idealy_f_ - stem_y;
+ ideal_lengthen_count++;
+ }
}
if (lengthen && shorten)
me->warning (_ ("weird beam vertical offset"));
+ if (to_boolean (me->get_grob_property ("ideal-lengthen"))
+ && ideal_lengthen_count)
+ lengthen = (ideal_lengthen / ideal_lengthen_count) >? lengthen;
+
/* when all stems are too short, normal stems win */
return dir * ((shorten) ? shorten : lengthen);
}
do
{
/* Don't overwrite user override (?) */
- if (Stem::beam_count (stems[i], d) == 0
+ if (Stem::beam_count (stems[i], d) == -1
/* Don't set beaming for outside of outer stems */
&& ! (d == LEFT && i == 0)
&& ! (d == RIGHT && i == stems.size () -1))
if (!gh_pair_p (pair))
{
- pair = gh_cons (gh_int2scm (0),gh_int2scm (0));
+ pair = gh_cons (gh_int2scm (-1),gh_int2scm (-1));
me-> set_grob_property ("beaming", pair);
}
index_set_cell (pair, d, gh_int2scm (i));
if (gh_pair_p (p))
return gh_scm2int (index_cell (p,d));
else
- return 0;
+ return -1;
}
Interval
// fixme: use scm_list_n_ref () iso. array[]
Real shorten_f = a[ ((flag_i (me) - 2) >? 0) <? (a.size () - 1)] * 2;
+ /* On boundary: shorten only half */
+ if (abs (chord_start_f (me)) == 0.5)
+ shorten_f *= 0.5;
+
/* URGURGURG
'set-default-stemlen' sets direction too
*/
Directional_element_interface::set (me, dir);
}
- /*
- stems in unnatural (forced) direction should be shortened,
- according to [Roush & Gourlay]
- */
- if (( (int)chord_start_f (me))
+ /* stems in unnatural (forced) direction should be shortened,
+ according to [Roush & Gourlay] */
+ if (chord_start_f (me)
&& (get_direction (me) != get_default_dir (me)))
length_f -= shorten_f;