From a065fe77d12f4c4ff0aba005a5b9a1fa9833a77d Mon Sep 17 00:00:00 2001 From: hanwen Date: Sun, 18 Jul 2004 15:04:09 +0000 Subject: [PATCH] * lily/beam-quanting.cc (score_forbidden_quants): remove interquant check. The penalty of 1000 is much too harsh, and the inter case should be caught by check-staff-line-in-gap check. * input/mutopia/W.A.Mozart/mozart-hrn-3.ly: remove texttagline. * lily/new-slur.cc: cleanup, split in functions. * lily/new-slur.cc (score_encompass): variable head-distance penalty. * lily/new-slur.cc (print): use debug-slur-quanting paper var. --- ChangeLog | 6 +++- input/mutopia/W.A.Mozart/mozart-hrn-3.ly | 2 +- input/regression/new-slur.ly | 9 +++-- lily/beam-quanting.cc | 19 ++-------- lily/new-slur.cc | 45 +++++++++++++++--------- ly/engraver-init.ly | 2 +- po/lilypond.pot | 35 +++++++++++++++--- 7 files changed, 74 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28254cb4b1..907a93b73f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ 2004-07-18 Han-Wen Nienhuys + * lily/beam-quanting.cc (score_forbidden_quants): remove + interquant check. The penalty of 1000 is much too harsh, and the + inter case should be caught by check-staff-line-in-gap check. + * lily/scm-option.cc: move debug-beam to \paper. * scripts/lilypond-book.py (Lilypond_snippet.write_ly): create - .txt files to appease makeinfobm. + .txt files to appease makeinfo. * input/mutopia/W.A.Mozart/mozart-hrn-3.ly: remove texttagline. diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly index 46184fe9c5..aa31630e4e 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly @@ -1,4 +1,4 @@ -5\header{ +\header{ title = "Konzert Nr. 3 Es dur" subtitle = "für Horn und Orchester" composer = "Wolfgang Amadeus Mozart (1756-1791)" diff --git a/input/regression/new-slur.ly b/input/regression/new-slur.ly index abffc02d03..cef25e3dc6 100644 --- a/input/regression/new-slur.ly +++ b/input/regression/new-slur.ly @@ -27,9 +27,12 @@ {r8 r r } >> s4 - - f'=''16( e) d( c) - s2. + + g='8[( a b b! ] c4 bes) + bes='8( f' des bes) as4( bes) + r8 d( f e d c b a) + cis=''4( d) f'=''16( e) d( c) + s4 c'=''2(~c8 d16 c b8 a) diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 6c9424d4cc..0cdba71128 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -451,28 +451,13 @@ Beam::score_forbidden_quants (Real yl, Real yr, Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]); - /* - Inside the staff, inter quants are forbidden. - */ - Real dem = 0.0; Direction d = LEFT; - do - { - if (fabs (y[d]) <= (radius + 0.5) && fabs (my_modf (y[d]) - 0.5) < BEAM_EPS) - dem += INTER_QUANT_PENALTY; - } - while ((flip (&d))!= LEFT); - - + Real dem = 0.0; + do { for (int j = 1; j <= beam_counts[d]; j++) { - /* - see if the outer staffline falls in a beam-gap - - This test is too weak; we should really check all lines. - */ Direction stem_dir = dirs[d]; /* diff --git a/lily/new-slur.cc b/lily/new-slur.cc index 883e19c006..828204a5cd 100644 --- a/lily/new-slur.cc +++ b/lily/new-slur.cc @@ -28,6 +28,7 @@ #include "stem.hh" #include "stencil.hh" #include "warn.hh" +#include "beam.hh" /* TODO: @@ -296,6 +297,11 @@ New_slur::get_encompass_info (Grob *me, && !stem->extent (stem, Y_AXIS).is_empty ()) { ei.stem_ = stem->extent (common[Y_AXIS], Y_AXIS)[dir]; + if (Grob * b = Stem::get_beam (stem)) + { + ei.stem_ += stem_dir * 0.5 *Beam::get_thickness (b); + } + } else ei.stem_ = ei.head_; @@ -630,7 +636,8 @@ New_slur::enumerate_attachments (Grob * me, Grob *common[], { if (extremes[d].stem_extent_[Y_AXIS].contains (os[d][Y_AXIS])) { - os[d][X_AXIS] -= d * extremes[d].slur_head_extent_.length (); + os[d][X_AXIS] = extremes[d].slur_head_extent_[-d] + - d * 0.3; } else if (dir *extremes[d].stem_extent_[Y_AXIS][dir] < dir * os[d][Y_AXIS]) { @@ -693,21 +700,24 @@ New_slur::score_encompass (Grob * me, Grob *common[], continue; Real y = bez.get_other_coordinate (X_AXIS, x); - Real head_dy = (y - infos[j].head_); - if (dir * head_dy < 0) - { - demerit += score_param->HEAD_ENCOMPASS_PENALTY; - } - else - { - Real hd = - (head_dy) ? (1/(fabs (head_dy) - 1/score_param->FREE_HEAD_DISTANCE)) - : score_param->HEAD_ENCOMPASS_PENALTY; - hd = (hd >? 0)HEAD_ENCOMPASS_PENALTY; - demerit += hd; - } - + if (j && j < infos.size () -1) + { + Real head_dy = (y - infos[j].head_); + if (dir * head_dy < 0) + { + demerit += score_param->HEAD_ENCOMPASS_PENALTY; + } + else + { + Real hd = + (head_dy) ? (1/fabs (head_dy) - 1/score_param->FREE_HEAD_DISTANCE) + : score_param->HEAD_ENCOMPASS_PENALTY; + hd = (hd >? 0)HEAD_ENCOMPASS_PENALTY; + + demerit += hd; + } + } if (dir * (y - infos[j].stem_) < 0) demerit += score_param->STEM_ENCOMPASS_PENALTY; else if (j && j < encompasses.size () - 1) @@ -803,7 +813,10 @@ New_slur::score_slopes (Grob * me, Grob *common[], Real demerit = 0.0; if (!has_beams) - demerit += score_param->STEEPER_SLOPE_FACTOR * (dir * (fabs (slur_dy) - fabs (dy)) >? 0); + /* + 0.2: account for staffline offset. + */ + demerit += score_param->STEEPER_SLOPE_FACTOR * (dir * (fabs (slur_dy) - fabs (dy + 0.2)) >? 0); demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) - score_param->MAX_SLOPE)>?0) * score_param->MAX_SLOPE_FACTOR; diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index a8b80d096a..4702d2c6de 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -534,7 +534,7 @@ AncientRemoveEmptyStaffContext = \context { ;; c&p from define-grobs.scm (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))) - (Voice Stem stem-shorten (0.4 0)) + (Voice Stem stem-shorten (0.4 0.4)) (Voice Stem font-size -3) (Voice NoteHead font-size -3) (Voice Dots font-size -3) diff --git a/po/lilypond.pot b/po/lilypond.pot index 5d230c1afb..73a00db5c5 100644 --- a/po/lilypond.pot +++ b/po/lilypond.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-07-18 15:06+0200\n" +"POT-Creation-Date: 2004-07-18 16:01+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,6 +151,8 @@ msgstr "" #. for --output-format. #. Bug in option parser: --output=foe is taken as an abbreviation #. for --output-format. +#. Bug in option parser: --output=foe is taken as an abbreviation +#. for --output-format. #: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:138 lily/main.cc:125 msgid "EXT" msgstr "" @@ -750,6 +752,7 @@ msgstr "" #. FIXME: broken sentence #. FIXME: broken sentence #. FIXME: broken sentence +#. FIXME: broken sentence #: all-font-metrics.cc:100 lily/all-font-metrics.cc:95 #, c-format msgid "checksum mismatch for font file: `%s'" @@ -807,15 +810,15 @@ msgstr "" msgid "barcheck failed at: %s" msgstr "" -#: beam.cc:151 lily/beam.cc:151 +#: beam.cc:151 lily/beam.cc:151 lily/beam.cc:149 msgid "beam has less than two visible stems" msgstr "" -#: beam.cc:156 lily/beam.cc:156 +#: beam.cc:156 lily/beam.cc:156 lily/beam.cc:154 msgid "removing beam with less than two stems" msgstr "" -#: beam.cc:1040 lily/beam.cc:1040 +#: beam.cc:1040 lily/beam.cc:1040 lily/beam.cc:1038 msgid "no viable initial configuration found: may not find good beam slope" msgstr "" @@ -922,6 +925,12 @@ msgstr "" #. #. last->translator_id_string () = get_change ()->change_to_id_string (); #. +#. +#. We could change the current translator's id, but that would make +#. errors hard to catch +#. +#. last->translator_id_string () = get_change ()->change_to_id_string (); +#. #: change-iterator.cc:93 lily/change-iterator.cc:93 msgid "I'm one myself" msgstr "" @@ -1275,6 +1284,7 @@ msgstr "" #. No version number or newline here. It confuses help2man. #. No version number or newline here. It confuses help2man. #. No version number or newline here. It confuses help2man. +#. No version number or newline here. It confuses help2man. #: main.cc:196 lily/main.cc:181 #, c-format msgid "Usage: %s [OPTIONS]... FILE..." @@ -1408,6 +1418,9 @@ msgstr "" #. #. music for the softenon children? #. +#. +#. music for the softenon children? +#. #: new-fingering-engraver.cc:155 lily/new-fingering-engraver.cc:153 msgid "music for the martians." msgstr "" @@ -1612,6 +1625,7 @@ msgstr "" #. this shouldn't happen, but let's continue anyway. #. this shouldn't happen, but let's continue anyway. #. this shouldn't happen, but let's continue anyway. +#. this shouldn't happen, but let's continue anyway. #: separation-item.cc:53 separation-item.cc:97 lily/separation-item.cc:53 #: lily/separation-item.cc:97 msgid "Separation_item: I've been drinking too much" @@ -1650,6 +1664,8 @@ msgstr "" #. eaten start event? #. How to shut up this warning, when Voice_devnull_engraver has #. eaten start event? +#. How to shut up this warning, when Voice_devnull_engraver has +#. eaten start event? #: slur-engraver.cc:139 lily/slur-engraver.cc:139 msgid "can't find start of slur" msgstr "" @@ -1751,6 +1767,8 @@ msgstr "" #. more of a programming error. #. Not using ngettext's plural feature here, as this message is #. more of a programming error. +#. Not using ngettext's plural feature here, as this message is +#. more of a programming error. #: tfm-reader.cc:108 lily/tfm-reader.cc:108 #, c-format msgid "TFM header of `%s' has only %u word (s)" @@ -1793,6 +1811,8 @@ msgstr "" #. (Here really with a warning!) #. If there is no such symbol, we default to the numbered style. #. (Here really with a warning!) +#. If there is no such symbol, we default to the numbered style. +#. (Here really with a warning!) #: time-signature.cc:95 lily/time-signature.cc:95 #, c-format msgid "time signature symbol `%s' not found; reverting to numbered style" @@ -1858,6 +1878,11 @@ msgstr "" #. #. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. #. +#. +#. Todo: should make typecheck? +#. +#. OTOH, Tristan Keuris writes 8/20 in his Intermezzi. +#. #: time-signature-engraver.cc:57 lily/time-signature-engraver.cc:57 #, c-format msgid "Found strange time signature %d/%d." @@ -2058,7 +2083,7 @@ msgid "Use help as SYMBOL to get online help." msgstr "" #: lily/scm-option.cc:133 lily/scm-option.cc:161 lily/scm-option.cc:136 -#: lily/scm-option.cc:164 +#: lily/scm-option.cc:164 lily/scm-option.cc:132 lily/scm-option.cc:160 #, c-format msgid "No such internal option: %s" msgstr "" -- 2.39.5