From: Han-Wen Nienhuys Date: Sun, 12 Sep 2004 13:39:56 +0000 (+0000) Subject: * scm/page-layout.scm (ly:optimal-page-breaks): use new parameters X-Git-Tag: release/2.3.17~48 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cbce93a817737a5c42e5cc5c7e93e72274286ebf;p=lilypond.git * scm/page-layout.scm (ly:optimal-page-breaks): use new parameters 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 --- diff --git a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly index bd446a7930..0bba290054 100644 --- a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly +++ b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly @@ -7,7 +7,7 @@ copyright = "Public Domain" } -\version "2.3.4" +\version "2.3.16" \include "nederlands.ly" diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly index 652d79a394..3c1a61456d 100644 --- a/input/mutopia/F.Schubert/morgenlied.ly +++ b/input/mutopia/F.Schubert/morgenlied.ly @@ -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 { 8( ) 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 | 4. r8 \clef bass | 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 { 8 | r r 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 - } -} } diff --git a/input/mutopia/F.Schubert/standchen.ly b/input/mutopia/F.Schubert/standchen.ly index 774fe7bbdd..07ce77bc62 100644 --- a/input/mutopia/F.Schubert/standchen.ly +++ b/input/mutopia/F.Schubert/standchen.ly @@ -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! diff --git a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly index 1362400798..9455ccd652 100644 --- a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly +++ b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly @@ -1,4 +1,4 @@ -\version "2.3.4" +\version "2.3.16" % #(ly:set-point-and-click 'line-column) diff --git a/input/mutopia/J.S.Bach/bwv940.ly b/input/mutopia/J.S.Bach/bwv940.ly index 3d1a92a43a..3bdc0a1185 100644 --- a/input/mutopia/J.S.Bach/bwv940.ly +++ b/input/mutopia/J.S.Bach/bwv940.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.3.4" +\version "2.3.16" %{ Header for Petites Preludes. diff --git a/input/mutopia/J.S.Bach/wtk1-fugue2.ly b/input/mutopia/J.S.Bach/wtk1-fugue2.ly index 4543041380..26e46c959e 100644 --- a/input/mutopia/J.S.Bach/wtk1-fugue2.ly +++ b/input/mutopia/J.S.Bach/wtk1-fugue2.ly @@ -44,7 +44,7 @@ %} -\version "2.3.4" +\version "2.3.16" diff --git a/input/mutopia/R.Schumann/romanze-op28-2.ly b/input/mutopia/R.Schumann/romanze-op28-2.ly index 4caf07f373..c6272a3978 100644 --- a/input/mutopia/R.Schumann/romanze-op28-2.ly +++ b/input/mutopia/R.Schumann/romanze-op28-2.ly @@ -5,7 +5,7 @@ #(set-global-staff-size 16) -\version "2.3.4" +\version "2.3.16" \header { title = "Romanzen" diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly index 7a7813503d..59f5d18d2b 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly @@ -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" diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc index e46786a7da..22cfbb945c 100644 --- a/lily/beam-concave.cc +++ b/lily/beam-concave.cc @@ -13,7 +13,7 @@ #include "staff-symbol-referencer.hh" bool -is_concave_single_notes (Array positions, Direction beam_dir) +is_concave_single_notes (Array const &positions, Direction beam_dir) { Interval covering; covering.add_point (positions[0]); @@ -60,6 +60,29 @@ is_concave_single_notes (Array positions, Direction beam_dir) return concave; } +Real +calc_concaveness (Array 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 positions; + Array close_positions; + Array 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 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)); }