]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.46 release/1.5.46
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 23 Mar 2002 02:36:37 +0000 (03:36 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 23 Mar 2002 02:36:37 +0000 (03:36 +0100)
59 files changed:
ChangeLog
Documentation/topdocs/INSTALL.texi
Documentation/user/appendices.itely
INSTALL.txt
VERSION
buildscripts/clean-fonts.sh
buildscripts/lilypond-login.sh
buildscripts/lilypond-profile.sh
input/baerenreiter-sarabande.ly
input/regression/figured-bass.ly
input/regression/grace-volta-repeat.ly [new file with mode: 0644]
input/test/beam-dir-function.ly
lily/bar-check-iterator.cc
lily/beam.cc
lily/global-translator.cc
lily/grob.cc
lily/include/beam.hh
lily/include/dimensions.hh
lily/include/line-spanner.hh
lily/include/lookup.hh
lily/include/music-output-def.hh
lily/include/porrectus.hh
lily/include/repeated-music.hh
lily/include/scm-hash.hh
lily/lily-guile.cc
lily/line-spanner.cc
lily/lookup.cc
lily/music.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/porrectus.cc
lily/repeated-music.cc
lily/simple-spacer.cc
lily/spacing-spanner.cc
lily/text-spanner.cc
ly/engraver-init.ly
ly/grace-init.ly
ly/params-init.ly
make/out/lilypond.lsm
make/out/lilypond.mandrake.spec
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
mf/GNUmakefile
mf/feta-eindelijk.mf
mf/parmesan-clefs.mf
mf/parmesan-rests.mf
scm/c++.scm
scm/clef.scm
scm/grob-description.scm
scm/molecule.scm
scm/music-functions.scm
scm/music-property-description.scm
scm/ps.scm
scm/tex.scm
scripts/lilypond-book.py
scripts/ly2dvi.py
stepmake/stepmake/toplevel-targets.make
tex/lily-ps-defs.tex
tex/lilyponddefs.tex

index 5432c20c492741ab261a1c7bb23885071c7615f7..f153772d05677d01cf76aff7c2b1a7a42493e968 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,75 @@
+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
index 91cf161cce0880166c3d5befec5df888b5d3967a..67ad977ab9c38acb3ae7d21f06bee33ad79b7e64 100644 (file)
@@ -172,7 +172,7 @@ configure something like:
 @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.
 
index dd424a003b26726d9314c1a907fcf65242800d62..f09c9738e1bc2806fe0ee046c235147e2184b1c7 100644 (file)
@@ -208,5 +208,5 @@ The following symbols are available in the Feta font and may be
 accessed directly using text markup such as 
 @code{g^#'(music "scripts-segno")}, see @ref{Text markup}.
 
-@lilypondfile{feta16.ly}
+@lilypondfile{feta16list.ly}
 
index d7e47a1d6e2cbd1b50a5090532390b75a435a020..90ed864e96b1e554e4ed171b355b81ffe1791a24 100644 (file)
@@ -176,9 +176,10 @@ Compilation
 
           ./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
diff --git a/VERSION b/VERSION
index 22c74e010df09aab47c71729e598e47f986e9b2b..500f43c91c94a5254c286a319699fbef1606748f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,9 +1,10 @@
 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.
 #
index 395a35cff7d619d46e43e54fe912d2c7d0bb448d..0dc0ff2684a2abe11b24dfdee3c46c9d8e2ad715 100644 (file)
@@ -18,6 +18,8 @@ dirs=".
 /var/spool/texmf
 /var/tmp/texfonts
 /var/texfonts
+/var/cache/fonts
+/usr/share/texmf/fonts
 "
 
 for i in $dirs; do
index 67a8f346715a1b9e4bc3aa81427a7069ee81e945..9e7278f6817ef07bf83fc821320295acb04721cd 100755 (executable)
 # 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
@@ -36,5 +31,11 @@ set noglob
 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
 
 
index 11464f2ba51b121368b1bd0be6bd2852e09c29e9..1e03ea439a024d72d408d3dea040a44b2276d1b7 100755 (executable)
@@ -9,9 +9,6 @@
 
 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:=""}
 
@@ -28,6 +25,11 @@ TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
 # 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
 
        
index 262ef28ca62fe30cb4b039f4e5d4b56c3c64b435..b7de5d717bdecdfbb6ee075a6a1b7adc2b63b050 100644 (file)
@@ -149,6 +149,11 @@ smallerPaper = \paper {
 baerPaper = \paper {
     indent = 7. \mm
     linewidth =183.5 \mm
+    interscoreline=4.0\mm
+    \translator {
+            \ScoreContext
+%           System \override #'molecule-callback = #box-grob-molecule
+    }
 }
 
 
index 47893be4fc47cef01f9a03d5f35c1197cb140836..8ac5ed2fbfe5426a1273cc1d86de2484a9a91478 100644 (file)
@@ -12,7 +12,7 @@ numbers, like @code{<4 6+>}.
  \context FiguredBass {
    \figures {
        <_! 3+ 5- _ 7! 9 >4
-       < 4 6 >
+       < [4 6] >
    }
  }
 
diff --git a/input/regression/grace-volta-repeat.ly b/input/regression/grace-volta-repeat.ly
new file mode 100644 (file)
index 0000000..8143a3a
--- /dev/null
@@ -0,0 +1,20 @@
+
+\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. }
+ }
+
+
index faed716f6e46e7e690d951cf385828b14a9a609c..10e994647a4e6001a4bc69edd98e862b9265dd2a 100644 (file)
@@ -2,6 +2,7 @@
 
 \header{
 texidoc="
+
 There are several ways to calculate the direction of a beam
 
 @table @samp
@@ -23,8 +24,7 @@ We should see:
 
 \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] 
index bc01898832db6b1ff8012639596640b6f39799b7..b916066f6a7e894d35edaf47b0c0bc9c4588e369 100644 (file)
@@ -56,15 +56,13 @@ Bar_check_iterator::process (Moment m)
       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 ());
+           }
        }
     }
-}
-    
+}    
index d511651d4a14884de9750731c3a09511fce921c7..23d0998d1f54b138bf0a13eb6fc2433721aa1e86 100644 (file)
@@ -19,7 +19,9 @@
     It may only set directions for stems.
 
   * Rewrite stem_beams.
-    
+
+  * Use Number_pair i.s.o Interval to represent (yl, yr).
+  
   */
 
 
@@ -43,6 +45,8 @@
 #include "font-interface.hh"  // debug output.
 
 
+#define DEBUG_QUANTING 0
+
 
 static Real
 shrink_extra_weight (Real x)
@@ -63,6 +67,10 @@ Beam::add_stem (Grob *me, Grob *s)
   add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (s));
 }
 
+
+/*
+  TODO: fix this for grace notes.
+ */
 Real
 Beam::get_interbeam (Grob *me)
 {
@@ -275,7 +283,8 @@ Beam::consider_auto_knees (Grob *me)
 }
 
 /* Set stem's shorten property if unset.
-   TODO:
+
+ TODO:
    take some y-position (chord/beam/nearest?) into account
    scmify forced-fraction */
 void
@@ -339,6 +348,7 @@ struct Quant_score
   Real demerits;
 };
 
+
 /*
   TODO:
    - Make all demerits customisable
@@ -359,6 +369,10 @@ Beam::quanting (SCM smob)
   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;
@@ -370,8 +384,16 @@ Beam::quanting (SCM smob)
   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++)
       {
@@ -393,26 +415,72 @@ Beam::quanting (SCM smob)
       }
 
 
-  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--;)
@@ -430,7 +498,7 @@ Beam::quanting (SCM smob)
                                  gh_double2scm (qscores[best_idx].yr))
                         );
 
-  if (0)
+  if (DEBUG_QUANTING)
   {
          // debug quanting
          me->set_grob_property ("quant-score",
@@ -441,56 +509,27 @@ Beam::quanting (SCM smob)
   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));
@@ -500,7 +539,26 @@ Beam::score_stem_lengths (SCM smob, SCM syl, SCM syr)
 
   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
@@ -509,37 +567,26 @@ my_modf (Real x)
   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;
@@ -553,26 +600,37 @@ Beam::score_forbidden_quants (SCM smob, SCM syl, SCM syr)
          && 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;
        }
       
@@ -580,29 +638,29 @@ Beam::score_forbidden_quants (SCM smob, SCM syl, SCM syr)
        {
          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;
 }
 
   
@@ -798,7 +856,7 @@ Beam::end_after_line_breaking (SCM smob)
   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;
@@ -823,12 +881,19 @@ Beam::calc_stem_y (Grob *me, Item* s, Interval pos)
   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;
@@ -1095,7 +1160,7 @@ Beam::brew_molecule (SCM smob)
                      ->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
@@ -1143,9 +1208,12 @@ Beam::forced_stem_count (Grob *me)
 
 
 
-/* TODO:
-   use filter and standard list functions.
- */
+/*
+
+TODO:
+use filter and standard list functions.
+
+*/
 int
 Beam::visible_stem_count (Grob *me) 
 {
@@ -1190,6 +1258,7 @@ Beam::last_visible_stem (Grob *me)
 
 /*
   [TODO]
+  
   handle rest under beam (do_post: beams are calculated now)
   what about combination of collisions and rest under beam.
 
index 45a8f1050cbe33e7b9127f7a2e89e601722a6fda..a7fb3e0c3c0f5f946e1e8f19a3ddb9bf600c7e17 100644 (file)
@@ -98,7 +98,7 @@ Global_translator::run_iterator_on_me (Music_iterator * iter)
 
       w = sneaky_insert_extra_moment (w);
 
-            //cout << "Proccing " << w << endl;
+      //      cout << "Proccing " << w << endl;
 
       
       if (first)
index 94758b7990073928724da25a630f5e49b1cf6d4f..9484c6951a98798dc9b54c8659bc7534e20eadda 100644 (file)
@@ -919,6 +919,8 @@ init_functions ()
                      (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,
index 7e217ce0357c2606d0e1a31b4e3d62dc1b4394b9..4f32cfe0e88790ef3e8a80bc538af426adc965ba 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "lily-proto.hh"
 #include "lily-guile.hh"
-
+#include "stem-info.hh"
 
 
 class Beam
@@ -36,9 +36,14 @@ public:
   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,
@@ -49,7 +54,7 @@ private:
   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*);
 };
index 66a9d0868d36bb2215c608a30f291fdc2820235c..c5f54a17e7afcec833352a1125463cf9290917e2 100644 (file)
@@ -23,6 +23,9 @@ const Real PT_TO_MM = (1.0/MM_TO_PT);
 #define BIGPOINT *BIGPOINT_TO_POINT
 #define CHAR *CHAR_TO_PT
 
+
+#define INTERNAL_UNIT "pt"
+
 #else  // mm
 
 #define PT  *PT_TO_PT *PT_TO_MM
@@ -31,6 +34,7 @@ const Real PT_TO_MM = (1.0/MM_TO_PT);
 #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
 
index 997a75dab637389a69de2dbd41de3a4dd2fd66c5..42523311e1cec982a5fbc16f592b398214c15ca8 100644 (file)
@@ -16,8 +16,8 @@ class Line_spanner
 {
 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);
index 17b8a5e654c47be1975f1026185e305ecc1dcc34..447d0e4eca136637bee867dc583aedbdf8ba01de 100644 (file)
@@ -22,6 +22,8 @@ struct Lookup
   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) ;
index e585202a6e65eeedb35eb35ccaa800d8c28a0320..8015d6079041c6b33e3c7cd3dfc7c2354a7bf788 100644 (file)
   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_;
 
index 9fa037ab9c344950e7f894d67b9450caf27edf36..c2abfbfaaf8a5f4647255680e02d0b9147f518d4 100644 (file)
@@ -30,8 +30,6 @@ private:
   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);
 };
index 7c1df168ef05677087987852639dcdacd7ae5f6f..833609261c0eb56081b55ca21763ed7ee3975a30 100644 (file)
@@ -63,6 +63,8 @@ public:
   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);
index 54423b63028a4c4f6fbf7ed30916a825ad9e20d1..626ae3d7ae9155c614748e197049dfe64e62bfdc 100644 (file)
 
    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
index 794062bfdd21cbc297f6c2698bf4b19a8a7111f4..975b9e522915f4d32919a4cf458dbf9ff5796bca 100644 (file)
@@ -23,6 +23,7 @@
 #include "offset.hh"
 #include "interval.hh"
 #include "pitch.hh"
+#include "dimensions.hh"
 
 SCM
 ly_last (SCM list)
@@ -463,6 +464,12 @@ ly_version ()
   return gh_eval_str ((char*)vs);
 }
 
+SCM
+ly_unit ()
+{
+  return gh_str02scm (INTERNAL_UNIT);
+}
+
 static void
 init_functions ()
 {
@@ -470,6 +477,8 @@ 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);
index ba22052d9657db381dc8337684a62efc407509e4..9f8a47b83045d8e7dcf7a6fbcaca7b78c0155155 100644 (file)
 
 #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;
 
@@ -60,7 +62,7 @@ Line_spanner::line_atom (Grob* me, Real dx, Real dy)
 }
 
 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");
@@ -70,8 +72,9 @@ Line_spanner::line_molecule (Grob* me, Real dx, Real dy)
          || 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"))
@@ -240,8 +243,15 @@ Line_spanner::brew_molecule (SCM smob)
                                                          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);
index 2d832c965b9cdf6694fdb905e4ee07e7d30250b8..8e5c17eb89eb67e1f62bc2268a67cbe919c6b264 100644 (file)
@@ -160,6 +160,90 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick)
   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.
  */
index d812fca1d5816e6a6d98c9fec42d0feca539eff1..5d7e57754bcc4cd4f22a4026bbab6abec290b739 100644 (file)
@@ -93,6 +93,13 @@ Music::length_mom () const
 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;
 }
index d28375ba9105103030871b0a546873eb9aec79b9..03766359ef5b5db684d72970a22335c0dd55a241 100644 (file)
@@ -165,8 +165,6 @@ Paper_def::find_font (SCM fn, Real m)
 SCM
 Paper_def::font_descriptions ()const
 {
-
-  
   SCM l = SCM_EOL;
   for (SCM s = scaled_fonts_; gh_pair_p (s); s = ly_cdr (s))
     {
index c14eb722248ca948b0b7f5b1d8f0d70cfd25a67d..1c0681010ada3952fbd63298c384f1f5eddb8d75 100644 (file)
@@ -127,11 +127,10 @@ Paper_outputter::output_version ()
 
   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)
 {
index 2bdbcd53d407efd6612cac2f1f9b73ba3be739c8..d52d871d68953b95eea455515eab9031c89361cb 100644 (file)
@@ -362,7 +362,7 @@ Porrectus::brew_vaticana_molecule (Item *me,
   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
@@ -370,13 +370,13 @@ Porrectus::brew_vaticana_molecule (Item *me,
       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
@@ -452,117 +452,31 @@ Porrectus::brew_mensural_molecule (Item *me,
   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);
-}
index 8488259923a031763324c3d588a44a0355a02d19..3ae277f8f5d051b392b350f0bef583e1b7642b52 100644 (file)
@@ -11,6 +11,7 @@
 #include "music-list.hh"
 #include "pitch.hh"
 #include "debug.hh"
+#include "music-sequence.hh"
 
 Music *
 Repeated_music::body ()const
@@ -167,3 +168,33 @@ Repeated_music::Repeated_music ()
 {
  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 ();
+}
index fa75e433a7cdcbb8ad96607461db8b2922ae04e5..3590d12f4027051879917abd8c4b3ff2c4eed791 100644 (file)
@@ -319,7 +319,13 @@ Simple_spacer::solve (Column_x_positions *positions) const
   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.
     }
index de49d2c35bafa49b2b2c6be11f6d76265ef5b2f5..f3c69d9976c47da7287bc2c2c4ef1f8e61892b88 100644 (file)
@@ -430,6 +430,12 @@ Spacing_spanner::find_shortest (Link_array<Grob> const &cols)
   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) 
 {
@@ -475,6 +481,10 @@ 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)
 {
index 554bc1d1f45e22fe960b41022e4be138ed8ceb50..6457d433c30aa346a8240bfed2d6d95f0f990b8f 100644 (file)
@@ -1,10 +1,10 @@
 /*
 
-  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) 
 {
@@ -64,7 +69,7 @@ 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?
            {
@@ -83,6 +88,7 @@ Text_spanner::brew_molecule (SCM smob)
   width += gh_scm2double (me->get_grob_property ("width-correct"));
   /* /Ugh */
 
+  // who is ecs? --hwn
 
   SCM properties = Font_interface::font_alist_chain (me);
 
@@ -127,9 +133,15 @@ Text_spanner::brew_molecule (SCM smob)
     }
 
   /* 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");
@@ -146,12 +158,7 @@ Text_spanner::brew_molecule (SCM smob)
          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);
@@ -164,9 +171,10 @@ Text_spanner::brew_molecule (SCM smob)
   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);
@@ -184,20 +192,25 @@ Text_spanner::brew_molecule (SCM smob)
 */
 
 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;
@@ -214,7 +227,7 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
     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 ())
@@ -236,10 +249,10 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
   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. 
@@ -252,8 +265,8 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
        {
          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;
          }
        }
@@ -264,17 +277,17 @@ Text_spanner::setup_pedal_bracket(Spanner *s)
   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] ) ));
 }
index ece252544365a7e3dd2f5eab7f740891558f06e4..d6a478164c81979fc77aa308f9d9ad475bfc4279 100644 (file)
@@ -34,8 +34,9 @@ StaffContext=\translator {
        \consists "Grob_pq_engraver"
 
        \consistsend "Axis_group_engraver"
-       
-       MinimumVerticalExtent = #'(-4 . 4)
+
+
+       MinimumVerticalExtent = #'(-6 . 6)
        ExtraVerticalExtent = ##f
        VerticalExtent = ##f 
        localKeySignature = #'()
index b33942fde1ecddf0c6daffd16982b7beb810a487..b139a85bff0936c3e61d6b9563a147612084af41 100644 (file)
@@ -15,7 +15,6 @@ startGraceMusic = {
     \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
index e4c851f7eb0c6b396c65d3e0b5177221b48dcbcd..29dd3cd10d3050076906d1469c21885d57e9d40d 100644 (file)
@@ -18,12 +18,14 @@ paperfile = \papersize + "-init.ly"
 \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 }
index ca4e0756a6b3302f652bd6a080fdede62a414f58..3297d0b433de0ac0dd972277ead39777f4a01b72 100644 (file)
@@ -1,15 +1,15 @@
 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
index 4d319008eb987896276707781a7bc568ba92163b..10895b152aea39af18a922300e466f0e10fe4c3c 100644 (file)
@@ -1,5 +1,5 @@
 %define name lilypond
-%define version 1.5.45
+%define version 1.5.46
 %define release 1mdk
 
 Name: %{name}
index 4bdc2c5213c43ee9bcd2133e89dbabae0161265f..acfd4ceb7979b3cd5d64b8ca607f863a8a0e9638 100644 (file)
@@ -3,11 +3,11 @@
 %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
index 7617b7d05cc2f514c10adfa986bd5c0225e5681f..9764eec9e6e4472b5bf8232b1d0c0684fa826d66 100644 (file)
 
 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/
index ab77ff12b919fc6e825aa5048ad5c1b7809f9f13..5a667fe1f8fb3b0a207c2b06602e7175de19c81a 100644 (file)
@@ -75,7 +75,7 @@ $(outdir)/lilypond.map:
 ##
 ## 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 
index 648d26dd9465d2c79d6ba57ec750224e8a841d7d..5192fe3a7f4d9efa261b46bf4401c89e41a871cb 100644 (file)
@@ -442,6 +442,13 @@ def neomens_half_block_rest =
        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#);
index a3bc41f4497cc538d1f3f4e33156afc36377a3e9..de7bb2af77b4f09b338f8c23b33c39852ee9031c 100644 (file)
@@ -326,19 +326,21 @@ fet_beginchar("neo-mensural c clef", "neo_mensural_c_change", "cneomenscclef")
 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);
@@ -347,41 +349,88 @@ def draw_petrucci_c_clef(expr exact_center, reduction) =
        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);
index 55a526dea90f38f8a021977b0390f78c0867bae8..db96bc7fcbfd8184358fb3b5d7fcb4422c994993 100644 (file)
@@ -18,7 +18,7 @@ fet_begingroup("rests")
 %
 %
 
-pen_width# = 2/5 staff_space#;
+pen_width# = 0.3 staff_space#;
 pen_height# = 0;
 pen_rotation = 30;
 slight_pen_rotation = 15;
@@ -29,8 +29,18 @@ mens_half_block_rest_y# = 5/8 staff_space#;
 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
@@ -40,7 +50,7 @@ fet_beginchar("Mensural longa rest", "-2mensural", "menslongarest");
 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
@@ -50,7 +60,7 @@ fet_beginchar("Mensural breve rest", "-1mensural", "mensbreverest");
 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
@@ -60,7 +70,7 @@ fet_beginchar("Mensural whole rest", "0mensural", "menssemibrevisrest");
 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
index 5fea3d145d552e52751a2f415bc269bbe043b474..56612415aa07bc294d8311d94f0967e3feef1b14 100644 (file)
@@ -136,14 +136,19 @@ is the  first to satisfy CRIT "
   (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)))
index f4e77dde0744d2ee9cdba3a4a0159aa3c618b155..50d853c0df2315e68d5d083093ad7af9502aa577 100644 (file)
          ("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)
   )
index c55661e8a99ca76140438e188a44abe414ae9874..5d5fbf938c543db9c927ec1c7f708097a68feb8f 100644 (file)
        (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))
        ))
 
index 1d3c58d027d7e6eb2d20d8ccb2ad7c1c32a8f4c3..e13bbc4893d901e77eafe713bf4f7e263d130066 100644 (file)
 
 
 (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
   ))
index 10e91ee26332566b0a534e302d19e5030b57585f..77b54f113cee4799c6ac8f2d1a57588780777808 100644 (file)
@@ -20,6 +20,8 @@ written by Rune Zedeler. "
         (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)))
 
@@ -36,6 +38,10 @@ written by Rune Zedeler. "
 
     music))
 
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 (define  (pitchify-scripts music)
   "Copy the pitch fields of the Note_requests into  Text_script_requests, to aid
 Fingering_engraver."
index 93933e1aff02c726c432125d31061c4e5ccdc644..8b91f1d45f863918e9251f54aa53f447a7010f25 100644 (file)
@@ -59,6 +59,10 @@ TODO: consider making type into symbol ")
 (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?
index b7c1072b8fca2704e77c24c13536c95a76bba9d1..dbc58a79c29611015a3c1bdb4fcb15f0a2448a35 100644 (file)
   (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" ))
index 79f6886422fe3a193d8c9c2ea8ecf95314beeaf6..2769db1cd20a963e6129039d021e713b2c794c2f 100644 (file)
 
 (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")
index 44745f99bb5baf6194ce614b8420851c83647f47..cf10c42f20c5ce06d1459ee828596409249723aa 100644 (file)
@@ -986,20 +986,19 @@ def system (cmd):
 
 
 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 ()
index f1c795ba082b3fd4ebf4d0e4e4c28fcf40e25a0b..da78c42198d1a423f3d29f68970dc7bb5aff19e7 100644 (file)
@@ -9,12 +9,6 @@
 # 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.
@@ -334,7 +328,8 @@ extra_init = {
        'pagenumber' : [1],
        'textheight' : [], 
        'linewidth' : [],
-       'orientation' : []
+       'orientation' : [],
+       'unit' : ['pt'],
 }
 
 extra_fields = extra_init.keys ()
@@ -343,9 +338,6 @@ fields = layout_fields + extra_fields
 include_path = ['.']
 lily_p = 1
 paper_p = 1
-cache_pks_p = 1
-
-PK_PATTERN='feta.*\.[0-9]+pk'
 
 output_name = ''
 targets = {
@@ -362,11 +354,12 @@ dependency_files = []
 
 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',
 }
 
@@ -567,14 +560,15 @@ lily output file in TFILES after that, and return the Latex file constructed.  '
        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'
@@ -826,9 +820,6 @@ if files and files[0] != '-':
 
        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']
@@ -893,9 +884,6 @@ if files and files[0] != '-':
                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 ()
        
index 4db0600eba1b13b52fcde25cef83395e66adc95d..a8db4c32876a88d9288d597d086fb1ed195ed2fa 100644 (file)
@@ -39,7 +39,7 @@ dist:
        $(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)
index ed2eeb4af890c13a55fd4847d14501930f1b3f4c..80bf79c97d7bd27eb2226b2c8abbdb917c992601 100644 (file)
 %
 \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
index c948be1bd646bc742c7620de209cbd4fa3e1a89f..3ad96eaec792fda234c262db08cce2a80ea974be 100644 (file)
 % 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}}}}%