]> git.donarmstrong.com Git - lilypond.git/commitdiff
(change-rhs-size): add support for "paper19.ly"
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Jul 2002 16:23:33 +0000 (16:23 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Jul 2002 16:23:33 +0000 (16:23 +0000)
ChangeLog
lily/spaceable-grob.cc
ly/paper19.ly [new file with mode: 0644]
mutopia/J.S.Bach/wtk1-fugue2.ly
scm/font.scm

index 6210bb49aecf1f1e8c0a83815a79f5a92a5fcb45..714be07669fa79b0a4a2029e5eebc54991b368f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2002-07-07  Han-Wen  <hanwen@cs.uu.nl>
 
+       * scm/font.scm (change-rhs-size): add support for "paper19.ly"
+
        * VERSION: 1.5.66 released
 
        * scm/grob-description.scm (all-grob-descriptions): add
index 542838c7c14a03eb106e6661030720a82316824e..4b684c656331b26681cdbca66dc57f1b77932343 100644 (file)
@@ -6,6 +6,8 @@
   (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
+#include <stdio.h> 
+#include <math.h>
 
 #include "spaceable-grob.hh"
 #include "grob.hh"
@@ -24,6 +26,9 @@ Spaceable_grob::get_minimum_distances (Grob*me)
 void
 Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
 {
+  //  printf ("rod %lf\n", d);
+
+  
   SCM mins = get_minimum_distances (me);
   SCM newdist = gh_double2scm (d);
   for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
@@ -44,13 +49,25 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
 void
 Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength, bool expand_only)
 {
-  if (d < 0.0 || strength <= 0.0)
+  //  printf ("dist %lf, str %lf\n", d, strength); 
+  if (d <= 0.0 || strength <= 0.0)
     {
       programming_error ("Adding reverse spring! Setting to unit spring");
       d = 1.0;
       strength = 1.0;
     }
   
+  if (isinf (d) || isnan(d)
+      || isnan (strength))
+    {
+      /*
+       strength == INF is possible. It means fixed distance.
+       */
+      programming_error ("Insane distance found.");
+      d = 1.0;
+      strength = 1.0;
+    }
+    
 #ifndef NDEBUG
   SCM mins = me->get_grob_property ("ideal-distances");
   for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
diff --git a/ly/paper19.ly b/ly/paper19.ly
new file mode 100644 (file)
index 0000000..5faac41
--- /dev/null
@@ -0,0 +1,14 @@
+% paper20-init.ly
+
+
+\version "1.5.49"
+
+paperNineteen = \paper {
+       staffheight = 19.0\pt
+       \stylesheet #(make-style-sheet 'paper19)
+       
+       \include "params-init.ly"
+}
+
+\paper { \paperNineteen }
+
index 8cda734a5f60da579599df54918199f7184ac0d4..c9d437f6c211b139be18ee966b6eaa34cd767311 100644 (file)
     ".\\\\Unrestricted modification and redistribution is permitted
     and encouraged---copy this music and share it.}"
   tagline = \mutopiapublicdomain
-  lastupdated = "2000/Feb/14"
+  lastupdated = "2002/July/7"
+  footer = "Mutopia-2002/07/07-6"
+
 }
 
 
-% It would be nice to squeeze this onto two pages, but I am not sure
-% if it would work with US paper.
+%{
+ We really want this piece on 2 pages.
+
+ tweaks:  we use 19 iso. 20 pt staff space, and squeeze up the spacing a bit.
+
+ the few forced linebreaks were an earlier attempt to get the spacing
+ to match up.
+%}
+
+\include "paper19.ly"
+\version "1.5.65"
+
+
 
-\version "1.3.146"
 
-  
 dux =  \context Voice=two \notes \relative c''{
   \voiceTwo
   \clef violin
 
   r8 c16 b c8 g as c16 b c8 d |
   g, c16 b c8 d f,16 g as4 g16 f |
-  es c' b a g f! es d c8 es' d c |
+  es c' b a g f! es d c8 es' d c | \break 
   bes a bes c fis, g a fis |
 %%5
   g4 r16 c, d es f g as8~ as16 d, es f |
-  g a bes8 ~ bes16 es, f g as g f es d8 c'16 b! |
+  g a bes8 ~ bes16 es, f g as g f es d8 c'16 b! |  \break
           % forced accident!
   c4 r4 r8 f es d |
   r8 as g f g f16 es f8 d | 
@@ -63,13 +75,13 @@ dux =  \context Voice=two \notes \relative c''{
   d, g16 fis g8 a! c,16 d es4 d16 c |  % forced accident!
   bes8 r8 r16 d e fis g a bes8 ~ bes16 e, f g |
   a bes c8 ~ c16 fis,16 g a bes8 es,!16 d es8 g, |
+  \break 
   as f'16 es f8 a,8 bes g'16 f g8 b, |
 %%20
-  c16 f \translator Staff = bass
-  \stemBoth \stemUp
-     es d c bes! as g 
+  c16 f es d
+  \translator Staff = bass
+   c bes! as g 
   f8 \translator Staff = treble
-  \stemBoth \stemDown
   as' g f |
   es d es f b, c d b |
   c4 r8 e8 f f16 e f8 c |
@@ -89,6 +101,7 @@ dux =  \context Voice=two \notes \relative c''{
 
 comes =  \context Voice=one \notes \relative c'' {
   \voiceOne
+  \property Voice.MultiMeasureRest \override #'staff-position = #6 
   R1 |
   R1 |
   r8 g'16 fis g8 c, es g16 fis g8 a |
@@ -167,10 +180,9 @@ bassdux =  \context Voice=three \notes \relative c' {
   f,16 g as4 g16 f es4 r8 es' |
   d c g' g, 
 %%30
-  \context Staff=bass <
-    { \voiceOne c2 ~ | c1 ~ | c1 }
-    \context Voice=four { \voiceTwo  c,2 ~ | c1 ~ | c1 }
-  >
+  < {  c2 ~ | c1 ~ | c1 } \\
+    {   c,2 ~ | c1 ~ | c1 }
+  > 
 }
 
 \score {
@@ -179,7 +191,6 @@ bassdux =  \context Voice=three \notes \relative c' {
         \property Score.TimeSignature \override #'style = #'C
        \context Staff = treble <
            \key c \minor
-%      \key es \major
            \dux
            { \comes \bar "|." }
              \time 4/4
@@ -192,6 +203,10 @@ bassdux =  \context Voice=three \notes \relative c' {
 
     \paper {
         linewidth = 18.0 \cm
+       \translator { \ScoreContext
+       SpacingSpanner \override #'spacing-increment = #1.0
+       SpacingSpanner \override #'shortest-duration-space = #1.9       
+       }
     }
     \header{
        opus = "BWV 847"
index 8d9d722d548a217081b0efa15dc586b5e68a461e..f72a401b67884b8c46c480b4c372d55a73b79f5f 100644 (file)
     ((2 * * music 26) . "feta26")
     ((1 * * music 23) . "feta23")
     ((0 * * music 20) . "feta20")
-    ((-0.5 * * music 20) . "feta19")    
     ((-1 * * music 16) . "feta16")
     ((-2 * * music 13) . "feta13")
     ((-3 * * music 11) . "feta11")
     ((2 * * ancient 26) . "parmesan26")
     ((1 * * ancient 23) . "parmesan23")
     ((0 * * ancient 20) . "parmesan20")
-    ((-0.5 * * ancient 20) . "parmesan19")    
     ((-1 * * ancient 16) . "parmesan16")
     ((-2 * * ancient 13) . "parmesan13")
     ((-3 * * ancient 11) . "parmesan11")
   (cons (- (car font-desc) decrement) (cdr font-desc))
   )
 
+(define (change-rhs-size font-desc from to )
+  (cons (car font-desc)
+       (regexp-substitute/global #f from (cdr font-desc) 'pre to 'post))
+
+  )
+
+  
 ;; 
 (define (map-alist-keys func list)
   "map a  function FUNC over the keys of an alist LIST, leaving the vals. "
                  '((paper11 . -3)
                    (paper13 . -2)
                    (paper16 . -1)
-                   (paper19 . -0.5)    
                    (paper20 . 0)
                    (paper23 . 1)
                    (paper26 . 2)
                    ))
   )
 
+(set! font-list-alist
+      (cons
+       (cons
+       'paper19
+       (map (lambda (x) (change-rhs-size x "20" "19"))
+            paper20-style-sheet-alist))
+       font-list-alist))
 
 (define (make-style-sheet sym)
   `((fonts . ,(append paper-style-sheet-alist