From 8f12661909716e71ffb7cc57fb68df0e8839d6d0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 11 Sep 2004 22:12:48 +0000 Subject: [PATCH] (stop_translation_timestep): new property: add-stem-support --- ChangeLog | 8 ++++++++ Documentation/topdocs/NEWS.texi | 21 ++++++++++--------- input/les-nereides.ly | 29 +++++++-------------------- input/regression/slur-broken-trend.ly | 5 ++++- lily/new-fingering-engraver.cc | 19 ++++++++++++------ lily/script-interface.cc | 8 ++++++-- lily/slur-engraver.cc | 2 +- lily/slur-scoring.cc | 12 ++++++++++- scm/define-grob-properties.scm | 3 +++ 9 files changed, 64 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 201d760b23..9e885e83df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ +2004-09-12 Han-Wen Nienhuys + + * lily/new-fingering-engraver.cc (stop_translation_timestep): new + property: add-stem-support + 2004-09-11 Han-Wen Nienhuys + * lily/slur-scoring.cc (get_bound_info): only do + broken trend at the end of the line. + * VERSION (PACKAGE_NAME): release 2.3.16. * input/regression/phrasing-slur.ly (Module): remove (duplicate diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index c18aea855b..d238b0d003 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -169,9 +169,10 @@ This is handled by the function defined in @code{toplevel-book-handler}. By changing these variables, different results can be obtained. -This required a small change in the syntax. Mode changing commands, -such as @code{\chords} and @code{\figures} now be directly followed by -delimeters. The following example demonstrates the new behavior, +@item Mode changing commands, +such as @code{\chords} and @code{\figures} must now be directly +followed by delimiters. The following example demonstrates the new +behavior, @verbatim \figures \context Figures { .. } % wrong @@ -179,11 +180,11 @@ delimeters. The following example demonstrates the new behavior, @end verbatim -@item Start pitch for @code{relative} music is optional for music lists. +@item The starting pitch for @code{relative} music is optional for music lists. The default value is middle C. @c update-me? formal definition of newaddlyrics, once it works -@item Combining lyrics with music can be done with @code{\newlyrics} +@item Combining lyrics with music can be done with @code{\addlyrics} @example \relative @{ @@ -198,7 +199,7 @@ The default value is middle C. @} @end example -Syntactically, @code{\newlyrics} acts like an infix operator. +Syntactically, @code{\addlyrics} acts like an infix operator. @item The parser is encapsulated in a Scheme function @code{ly:parse-file}, so the following fragment processes two files @@ -229,10 +230,10 @@ entity. For example, two scores are combined in one book with @} @end example -Titling and page breaks are handled by LilyPond. For automatic page -breaking, two algorithms are available, the classic ragged pages (the -default), and optimal page breaking. -Page breaks may be inserted manually with + +@item +Titling and page breaks are handled by LilyPond. Page breaks may be +inserted manually with @example \pageBreak @end example diff --git a/input/les-nereides.ly b/input/les-nereides.ly index c6c0806058..d2588c03fa 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -63,11 +63,9 @@ treble = \new Voice \relative c''{ cis''''4^\markup { \small \italic "m.g." }\arpeggio~ \grace { cis8 - \slurBoth % Tweak + \override Stem #'direction = #CENTER - \override Stem #'direction = #0 - - a16[-5( fis dis] + a16[-5_( fis dis] #(set-octavation 0) cis32[ a-1 fis-4 dis] cis[ a fis)-2] @@ -86,7 +84,7 @@ treble = \new Voice \relative c''{ \override Fingering #'direction = #1 % Manual fix for collision with slur - \override Fingering #'extra-offset = #'(0 . 1) %tweak + \override Fingering #'inside-slur = ##f e)-1-4-5 r | %6 @@ -102,7 +100,6 @@ trebleTwo = \new Voice \relative c''{ \slurDown % \fingerDown \override Fingering #'direction = #-1 - \override Fingering #'extra-offset = #'(0 . 1.2) s2 | %1 s1*2 @@ -112,11 +109,11 @@ trebleTwo = \new Voice \relative c''{ 2 | %5 s8 cis4. d4 - %%8[( - 8[( -3-1 + \override Fingering #'add-stem-support = ##t + \override Fingering #'padding = #0.1 + 8[( | %6 - %%)] cis4. d4 - )]-2-1 cis4. d4 + )] cis'4. d4 8[( | %7 )] @@ -126,11 +123,7 @@ bass = \new Voice \relative c{ \partial 2 \key a \major - % Allow ugly (highly blown-up) slurs - \override Slur #'beautiful = #5.0 %tweak - \override Slur #'attachment-offset = #'((0 . 3) . (0 . -4)) %tweak \slurDown - \dynamicUp r8. e,16(\f_2 8[ ] @@ -140,17 +133,11 @@ bass = \new Voice \relative c{ 4\sustainDown \change Staff=treble \stemDown - \override Slur #'attachment = #'(stem . stem) %tweak 4)\arpeggio - \revert Slur #'attachment %tweak \change Staff=bass \stemBoth - \revert Slur #'y-free %tweak - \override Slur #'y-free = #0.1 %tweak - \revert Slur #'attachment-offset %tweak - \override Slur #'attachment-offset = #'((0 . 3) . (0 . 8)) %tweak r8. cis,,16(\sustainUp 8 | %3 @@ -167,8 +154,6 @@ bass = \new Voice \relative c{ r2 | %4 - \revert Slur #'beautiful %tweak - \revert Slur #'attachment-offset %tweak \stemDown 4 \clef treble diff --git a/input/regression/slur-broken-trend.ly b/input/regression/slur-broken-trend.ly index 5c5ac839a6..0668b048a8 100644 --- a/input/regression/slur-broken-trend.ly +++ b/input/regression/slur-broken-trend.ly @@ -28,7 +28,10 @@ in unbroken state. >> \break c4) f='2.(\break - a4) + a2.) + \stemUp + 8( \break + ) } diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 713f84fd02..843cae76d2 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -286,24 +286,31 @@ New_fingering_engraver::stop_translation_timestep () { if (fingerings_.size ()) { + for (int i = 0; i < fingerings_.size(); i++) + if (stem_ && to_boolean (fingerings_[i].script_->get_property ("add-stem-support"))) + Side_position_interface::add_support (fingerings_[i].script_, stem_); position_scripts (); fingerings_.clear (); } for (int i = articulations_.size (); i--;) { - Grob *sc = articulations_[i].script_; + Grob *script = articulations_[i].script_; for (int j = heads_.size () ; j--;) - Side_position_interface::add_support (sc, heads_[j]); + Side_position_interface::add_support (script, heads_[j]); - if (stem_ && to_dir (sc->get_property ("side-relative-direction"))) - sc->set_property ("direction-source", stem_->self_scm ()); + if (stem_ && to_dir (script->get_property ("side-relative-direction"))) + script->set_property ("direction-source", stem_->self_scm ()); + + + if (stem_ && to_boolean (script->get_property ("add-stem-support"))) + Side_position_interface::add_support (script, stem_); if (articulations_[i].follow_into_staff_) { - sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS); - sc->set_property ("staff-padding" , SCM_EOL); + script->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS); + script->set_property ("staff-padding" , SCM_EOL); } } diff --git a/lily/script-interface.cc b/lily/script-interface.cc index 279b265a96..2d5a386c10 100644 --- a/lily/script-interface.cc +++ b/lily/script-interface.cc @@ -92,9 +92,13 @@ struct Text_script ADD_INTERFACE (Text_script,"text-script-interface", "An object that is put above or below a note", - "slur script-priority inside-slur"); + "add-stem-support slur script-priority inside-slur"); + +/* + Hmm. Where should we put add-stem-support ? + */ ADD_INTERFACE (Script_interface, "script-interface", "An object that is put above or below a note", - "slur script-priority script-stencil inside-slur"); + "add-stem-support slur script-priority script-stencil inside-slur"); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index e963ad68b1..80bd9bbf81 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -163,6 +163,6 @@ ENTER_DESCRIPTION (Slur_engraver, /* descr */ "Build slurs grobs from slur events", /* creats*/ "Slur", /* accepts */ "slur-event", - /* acks */ "note-column-interface accidental-interface fingering-interface script-interface tie-interface", + /* acks */ "note-column-interface accidental-interface fingering-interface script-interface tie-interface text-script-interface", /* reads */ "slurMelismaBusy doubleSlurs", /* write */ ""); diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 56c6306e3d..6d1047ac05 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -443,8 +443,18 @@ get_bound_info (Spanner* me, Grob **common) extremes[d].staff_space_ = Staff_symbol_referencer ::staff_space (extremes[d].stem_); } - else + else if (d == RIGHT) + /* + right side anticipates on the next note. + */ extremes[d].neighbor_y_ = broken_trend_y (me, common, d); + + else + { + Link_array columns + = Pointer_group_interface__extract_grobs (me, (Grob *) 0, "note-columns"); + extremes[d].neighbor_y_ = columns[0]->extent (common[Y_AXIS], Y_AXIS)[dir]; + } } while (flip (&d) != LEFT); return extremes; diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 832bc727bb..8f46f38bf5 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -42,6 +42,7 @@ called first. The functions take a grob and axis argument. ") (Y-offset-callbacks ,list? "see @code{X-offset-callbacks}.") (accidentals ,list? "List of alteration numbers.") + (add-stem-support ,boolean? "If set, the Stem object is included in this script's support") (align-dir ,ly:dir? "Which side to align? @code{-1}: left side, @code{0}: around center of width, @code{1}: right side.") @@ -437,6 +438,8 @@ of flags/beams.") stems that are placed in tight configurations. For opposite directions, this amount is the correction for two normal sized stems that overlap completely.") + + (string-count ,integer? "The number of strings in a fret diagram.") (stroke-style ,string? "set to \"grace\" to turn stroke through flag on.") -- 2.39.2