]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/page-layout.scm (ly:optimal-page-breaks): use new parameters
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Sep 2004 13:39:56 +0000 (13:39 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Sep 2004 13:39:56 +0000 (13:39 +0000)
to get sane spaces for titles.

* scm/page-layout.scm (ly:optimal-page-breaks): add
betweensystempadding also to fixed distance for the spring.

* lily/beam-concave.cc: new file, with new routines for concave
decisions. There are now two types of concaveness: 1. a sharp
logic decision forcing a beam horizontal, and 2. a number that
measures how concave beams are that are not caught by 1.

This fixes: morgenlied.ly and input/regression/beam-concave.ly

input/mutopia/E.Satie/petite-ouverture-a-danser.ly
input/mutopia/F.Schubert/morgenlied.ly
input/mutopia/F.Schubert/standchen.ly
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
input/mutopia/J.S.Bach/bwv940.ly
input/mutopia/J.S.Bach/wtk1-fugue2.ly
input/mutopia/R.Schumann/romanze-op28-2.ly
input/mutopia/W.A.Mozart/mozart-hrn-3.ly
lily/beam-concave.cc

index bd446a7930171f9bc264a64ca43a8cfda99e41a3..0bba2900549925070bc39b4338f977cc7deb6f7f 100644 (file)
@@ -7,7 +7,7 @@
   copyright = "Public Domain"
 }
 
-\version "2.3.4"
+\version "2.3.16"
 
 \include "nederlands.ly"
 
index 652d79a3944b75a7e49292025e112a81a109a645..3c1a61456ddd99e3b36425bd7382ab3df0fa1e9d 100644 (file)
@@ -27,7 +27,7 @@ been lowered
 
 }
 
-\version "2.3.4"
+\version "2.3.16"
 manuscriptBreak = { \break }
 
 
@@ -39,6 +39,8 @@ manuscriptBreak = { \break }
     linewidth = #(* mm 160)
     indent = 8\mm
     interscoreline = 2.\mm
+    betweensystemspace = 15\mm
+    raggedbottom = ##t 
     }
 
 modernAccidentals = {
@@ -80,7 +82,7 @@ ignoreMelisma =       \set ignoreMelismata = ##t
 ignoreMelismaOff = \unset ignoreMelismata 
 
 
-firstVerse = \lyrics {
+firstVerse = \lyricmode {
     \set stanza = "1."
     
     Sü -- ßes Licht! Aus
@@ -95,7 +97,7 @@ firstVerse = \lyrics {
     dei -- ne Ro -- sen -- pracht, grüß __ ich __ dei -- ne Ro -- sen -- pracht. 
     }
 
-secondVerse = \lyrics {
+secondVerse = \lyricmode {
     \set stanza = "2."
     Ach, der Lie -- be sanf
     -- tes We -- hen schwellt mir |
@@ -110,7 +112,7 @@ pianoRH =  \relative c''' \repeat volta 2 {
     <g e>8( <es fis a> <d f b> <c e c'>) r8 r | 
     r8 c'( e,) f r a |
     \once \override DynamicLineSpanner   #'padding =#3
-    r8_\> << { s8 s8-\! }  << { fis( g)
+    r8 << { s8 s8 }  << { fis(\> g)\!
                            } \\ { c,4 } >> >> r8 <e c g> <e c g> |
     <d c a>4. r8 \clef bass  <d b f> <d b f> |
     e,16_" "_\markup { \bold\italic cresc. } g c g e g d gis b gis d gis |
@@ -148,47 +150,48 @@ pianoLH =  \relative c'' \repeat volta 2 {
     <c g e c>8 <c e g> <c e g>     <c e g> <c e g> <c e g> |
     <c e g> r r <c, c,>8 r r\fermata \clef treble
     }
+
 \book {
-  \score {
-    << \time 6/8
-     \new Staff <<
-        \context Staff #(set-accidental-style 'modern)
-        \melody >>
-        \lyricsto "singer" \new Lyrics \firstVerse
-        \lyricsto "singer" \new Lyrics \secondVerse
-     \new PianoStaff << 
-        \set PianoStaff.instrument = \markup {
-            \bold
-            \bigger\bigger\bigger\bigger \huge "2.  " }
-        \new Staff \pianoRH
-        \new Staff \pianoLH
-       >> 
-    >>
-
-    \paper {
-       \context {
-           \Lyrics
-           minimumVerticalExtent = #'(-1.0 . 0)
-       }
-       \context {
-           \Score
-           \override Beam #'thickness = #0.55
-           \override SpacingSpanner #'spacing-increment = #1.0
-           \override Slur #'height-limit = #1.5
-       }
-       \context {
-           \PianoStaff
-           \override VerticalAlignment #'forced-distance = #10
+    \score {
+       << \time 6/8
+          \new Staff <<
+              \context Staff #(set-accidental-style 'modern)
+              \melody >>
+          \lyricsto "singer" \new Lyrics \firstVerse
+          \lyricsto "singer" \new Lyrics \secondVerse
+          \new PianoStaff << 
+              \set PianoStaff.instrument = \markup {
+                  \bold
+                  \bigger\bigger\bigger\bigger \huge "2.  " }
+              \new Staff \pianoRH
+              \new Staff \pianoLH
+          >> 
+       >>
+
+       \paper {
+           \context {
+               \Lyrics
+               minimumVerticalExtent = #'(-1.0 . 0)
+           }
+           \context {
+               \Score
+               \override Beam #'thickness = #0.55
+               \override SpacingSpanner #'spacing-increment = #1.0
+               \override Slur #'height-limit = #1.5
+           }
+           \context {
+               \PianoStaff
+               \override VerticalAlignment #'forced-distance = #10
+           }
+           \context {
+               \Staff
+               minimumVerticalExtent = #'(-3. . 6)
+           }
+           inputencoding = "latin1"
        }
-       \context {
-           \Staff
-           minimumVerticalExtent = #'(-3. . 6)
+       \midi {
+           \tempo 4 = 70
        }
-       inputencoding = "latin1"
     }
-    \midi {
-       \tempo 4 = 70
-       }
-}
 }
 
index 774fe7bbdde2fd2e7920ceb8c2866373c7ea47d5..07ce77bc62705ede2b101b37012322ea4b6018ac 100644 (file)
@@ -42,7 +42,7 @@ instrument = "Piano"
  footer = "Mutopia-2001/04/27-xx"
 } 
 
-\version "2.3.4"
+\version "2.3.16"
 
 dynamicUp = \override DynamicLineSpanner  #'direction = #1
 dynamicRevert = \revert DynamicLineSpanner #'direction
@@ -115,7 +115,7 @@ vocalThrough = \relative c{
        e2 r4 |
 }
 
-lyricVerseOne = \lyrics {
+lyricVerseOne = \lyricmode {
        Lei -- se fle -- hen mei -- ne Lie -- der
        durch die Nacht zu dir;
        in den stil -- len Hain her nie -- der,
@@ -130,7 +130,7 @@ lyricVerseOne = \lyrics {
        fürch -- te, Hol -- de, nicht.
 }
        
-lyricVerseTwo = \lyrics{
+lyricVerseTwo = \lyricmode{
        Hörst die Nach -- ti -- gal -- len schla -- gen?
        ach! sie fle -- hen dich, 
        mit der Tö -- ne sü -- "\ss en" Kla -- gen
@@ -145,7 +145,7 @@ lyricVerseTwo = \lyrics{
        jed -- es wei -- che Herz.
 }
 
-lyricThrough = \lyrics{
+lyricThrough = \lyricmode{
        La\ss auch dir die Brust be -- we -- gen 
        Lieb -- chen, hö -- re mich! 
        be -- bend harr' ich dir ent -- ge -- gen! 
index 13624007984ccb39cf4f6937150c617955831fc5..9455ccd652b84baade90294ad97df9c2039d53bb 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.3.4"
+\version "2.3.16"
 
 % #(ly:set-point-and-click 'line-column)
 
index 3d1a92a43a31df227a0503d273de3f19e861b31d..3bdc0a11850f966b3dc28571fd8f55689613998a 100644 (file)
@@ -1,5 +1,5 @@
 #(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.3.16"
 
 %{
  Header for Petites Preludes.
index 4543041380952b70d6528c091ab035c461fe3aae..26e46c959ebde9855694557b048edeee919424c9 100644 (file)
@@ -44,7 +44,7 @@
 %}
 
 
-\version "2.3.4"
+\version "2.3.16"
 
 
 
index 4caf07f3734fd496a3a5bbd62e9b9573c61b51fc..c6272a397891e9dd79389c32aa3cb993092c83ab 100644 (file)
@@ -5,7 +5,7 @@
 
 #(set-global-staff-size 16)
 
-\version "2.3.4"
+\version "2.3.16"
 
 \header {
   title = "Romanzen"
index 7a7813503dc57de190c98cba66e0e8e37b0df5be..59f5d18d2b13d0400427444c9abdf0baf8f22453 100644 (file)
@@ -41,7 +41,7 @@ virtuoso that taught in Geneva.
 
 %}
 
-\version "2.3.4"
+\version "2.3.16"
 
 \include "mozart-hrn3-defs.ily"
 \include "mozart-hrn3-allegro.ily"
index e46786a7da6a85e52bfe04d9914c259668654553..22cfbb945c14698d7fed4dd54a3e3521a7711c44 100644 (file)
@@ -13,7 +13,7 @@
 #include "staff-symbol-referencer.hh"
 
 bool
-is_concave_single_notes (Array<int> positions, Direction beam_dir)
+is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
 {
   Interval covering;
   covering.add_point (positions[0]);
@@ -60,6 +60,29 @@ is_concave_single_notes (Array<int> positions, Direction beam_dir)
   return concave;
 }
 
+Real
+calc_concaveness (Array<int> const &positions, Direction beam_dir)
+{
+  Real dy = positions.top () - positions[0];
+  Real slope = dy / Real (positions.size() - 1);
+  Real concaveness = 0.0;
+  for (int i = 1; i < positions.size() - 1; i++)
+    {
+      Real line_y = slope * i + positions[0];
+
+      concaveness += (beam_dir * (positions[i] - line_y)) >? 0.0;
+    }
+
+  concaveness /= positions.size () ;
+
+  /*
+    Normalize. For dy = 0, the slope ends up as 0 anyway, so the
+    scaling of concaveness doesn't matter much.
+  */
+  if (dy)
+    concaveness /= dy;
+  return concaveness;
+}
 
 MAKE_SCHEME_CALLBACK (Beam, check_concave, 1);
 SCM
@@ -89,7 +112,8 @@ Beam::check_concave (SCM smob)
     return SCM_UNSPECIFIED;
 
 
-  Array<int> positions;
+  Array<int> close_positions;
+  Array<int> far_positions;
   for (int i= 0; i < stems.size (); i++)
     {
       /*
@@ -100,12 +124,13 @@ Beam::check_concave (SCM smob)
        the beam.
        
        */
-      Real pos = Stem::head_positions (stems[i])[-beam_dir];
+      Interval posns = Stem::head_positions (stems[i]);
       
-      positions.push ((int) rint (pos));
+      close_positions.push ((int) rint (posns[beam_dir]));
+      far_positions.push ((int) rint (posns[-beam_dir]));
     }
 
-  if (is_concave_single_notes (positions, beam_dir)) 
+  if (is_concave_single_notes (far_positions, beam_dir)) 
     {
       Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
       Real r = linear_combination (pos, 0.0);
@@ -116,24 +141,9 @@ Beam::check_concave (SCM smob)
     }
   else
     {
-      Real dy = positions.top () - positions[0];
-      Real slope = dy / Real (positions.size() - 1);
-      Real concaveness = 0.0;
-      for (int i = 1; i < positions.size() - 1; i++)
-       {
-         Real line_y = slope * i + positions[0];
-
-         concaveness += (beam_dir * (positions[i] - line_y)) >? 0.0;
-       }
-
-      concaveness /= positions.size () ;
-
-      /*
-       Normalize. For dy = 0, the slope ends up as 0 anyway, so the
-       scaling of concaveness doesn't matter much.
-       */
-      if (dy)
-       concaveness /= dy; 
+      Real concaveness = (calc_concaveness (far_positions, beam_dir)
+                         + calc_concaveness (close_positions, beam_dir))/2;
+      
 
       me->set_property ("concaveness", scm_from_double (concaveness));
     }