From 4becc03c916b6e0ac4e59554d3588286502c8e53 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 10 Mar 2004 11:06:06 +0000 Subject: [PATCH] * lily/piano-pedal-engraver.cc (finalize): attach unfinished bracket to last command column. * lily/piano-pedal-bracket.cc (print): only flatten bracket if it continues on next/prev system. * input/regression/pedal-end.ly: new file. --- ChangeLog | 12 ++++++++++++ Documentation/topdocs/NEWS.texi | 17 ++++------------- Documentation/user/notation.itely | 23 +++++++++++------------ input/regression/pedal-end.ly | 15 +++++++++++++++ lily/piano-pedal-bracket.cc | 12 ++++++++++-- lily/piano-pedal-engraver.cc | 30 ++++++++++++++++++++++-------- scripts/GNUmakefile | 2 +- 7 files changed, 75 insertions(+), 36 deletions(-) create mode 100644 input/regression/pedal-end.ly diff --git a/ChangeLog b/ChangeLog index 4af78bd08d..10000605ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-03-10 Han-Wen Nienhuys + + * lily/piano-pedal-engraver.cc (finalize): attach unfinished + bracket to last command column. + + * lily/piano-pedal-bracket.cc (print): only flatten bracket if it + continues on next/prev system. + + * input/regression/pedal-end.ly: new file. + 2004-03-10 Werner Lemberg * make/lilypond.redhat.spec.in, make/lilypond.suse.spec.in: @@ -21,6 +31,8 @@ 2004-03-10 Han-Wen Nienhuys + * lily/input-file-results.cc (do_one_file): use new Paper_book() + * lily/score.cc (default_rendering): clean protection. * lily/paper-book.cc (mark_smob): implement smob marking. diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index c6de4acd6a..5a87cbd95b 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -7,15 +7,6 @@ @chapter New features in 2.1 since 2.0 -@ignore -Unreleased: - -@itemize -@end itemize - -Version 2.1.13 -@end ignore - @itemize @bullet @item Context definitions now use the word @code{\context} instead of @code{\translator}. @@ -48,15 +39,15 @@ instrument. For example, @end verbatim @item The transposition of an instrument can be specified using the -@code{\transposition} command. The following command specifies an -E-flat alto saxophone: +@code{\transposition} command. An +E-flat alto saxophone is specified as @example \transposition es' @end example @item The naming of exported Scheme functions now follows Scheme conventions. -Changes be applied to Scheme files with convert-ly: +Changes be applied to Scheme files with @example convert-ly -e -n --from=2.1.24 --to=2.1.26 *.scm @@ -64,7 +55,7 @@ Changes be applied to Scheme files with convert-ly: @item Notes can be excluded from auto-beaming, by marking them with -@code{\noBeam}: +@code{\noBeam} @example c8 c \noBeam c c @end example diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index f97d8025ef..a9f32c78b5 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -3048,30 +3048,30 @@ information. Pedals can also be indicated by a sequence of brackets, by setting the @code{pedalSustainStyle} property to @code{bracket} objects: -@lilypond[fragment,verbatim] +@lilypond[fragment,verbatim,relative=2] \set Staff.pedalSustainStyle = #'bracket - c''4\sustainDown d''4 e''4 - a'4\sustainUp\sustainDown - f'4 g'4 a'4\sustainUp + c\sustainDown d e + b\sustainUp\sustainDown + b g \sustainUp a \sustainDown \bar "|." @end lilypond A third style of pedal notation is a mixture of text and brackets, obtained by setting the @code{pedalSustainStyle} style property to @code{mixed}: -@lilypond[fragment,verbatim] +@lilypond[fragment,verbatim,relative=2] \set Staff.pedalSustainStyle = #'mixed -c''4\sustainDown d''4 e''4 -c'4\sustainUp\sustainDown - f'4 g'4 a'4\sustainUp + c\sustainDown d e + b\sustainUp\sustainDown + b g \sustainUp a \sustainDown \bar "|." @end lilypond The default `*Ped.' style for sustain and damper pedals corresponds to style @code{#'text}. The sostenuto pedal uses @code{mixed} style by default. -@lilypond[fragment,verbatim] -c''4\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4\sostenutoUp +@lilypond[fragment,verbatim,relative=2] + c\sostenutoDown d e c, f g a\sostenutoUp @end lilypond For fine-tuning of the appearance of a pedal bracket, the properties @@ -3083,8 +3083,7 @@ bracket may be extended to the end of the note head: @lilypond[fragment,verbatim] \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0) -c''4\sostenutoDown d''4 e''4 c'4 -f'4 g'4 a'4\sostenutoUp + c\sostenutoDown d e c, f g a\sostenutoUp @end lilypond @node Arpeggio diff --git a/input/regression/pedal-end.ly b/input/regression/pedal-end.ly new file mode 100644 index 0000000000..7a4471116c --- /dev/null +++ b/input/regression/pedal-end.ly @@ -0,0 +1,15 @@ +\version "2.1.29" +\header { + + texidoc = "Unterminated piano pedal brackets run to the end of the piece. " + +} + +\score { + \notes { + \set Staff.pedalSustainStyle = #'bracket + c4 \sustainDown + \bar "|." + } + \paper { raggedright = ##t } +} diff --git a/lily/piano-pedal-bracket.cc b/lily/piano-pedal-bracket.cc index 52afd47c53..74e09979fd 100644 --- a/lily/piano-pedal-bracket.cc +++ b/lily/piano-pedal-bracket.cc @@ -24,6 +24,7 @@ SCM Piano_pedal_bracket::print (SCM smob) { Spanner *me = dynamic_cast (unsmob_grob (smob)); + Spanner *orig = dynamic_cast (me->original_); Drul_array broken (false,false); Drul_array height = robust_scm2drul @@ -47,8 +48,15 @@ Piano_pedal_bracket::print (SCM smob) Item *b = me->get_bound (d); broken[d] = b->break_status_dir () != CENTER; if (broken[d]) - height[d] = 0.0; - + { + if (orig + && ((d == RIGHT && me->get_break_index () != orig->broken_intos_.size()-1) + || (d == LEFT && me->get_break_index ()))) + height[d] = 0.0; + else + flare[d] = 0.0; + } + Interval ext = b->extent (common, X_AXIS); span_points[d] = ext [broken[d] ? RIGHT : LEFT]; } diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index b26d280600..f04f31c413 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -444,20 +444,31 @@ Piano_pedal_engraver::finalize () && !p->line_spanner_->live ()) p->line_spanner_ = 0; - if (p->line_spanner_) - { - p->finished_line_spanner_ = p->line_spanner_; - typeset_all (); - } if (p->bracket_ && !p->bracket_->live ()) p->bracket_ = 0; if (p->bracket_) { - p->current_bracket_ev_->origin ()->warning (_ ("unterminated pedal bracket")); - p->bracket_->suicide (); + SCM cc = get_property ("currentCommandColumn"); + Item *c = unsmob_item (cc); + if (p->line_spanner_) + { + p->line_spanner_->set_bound (RIGHT, c); + } + p->bracket_ ->set_bound (RIGHT, c); + + p->finished_bracket_ = p->bracket_; p->bracket_ = 0; + p->finished_line_spanner_ = p->line_spanner_; + p->line_spanner_ = 0; + typeset_all (); + } + + if (p->line_spanner_) + { + p->finished_line_spanner_ = p->line_spanner_; + typeset_all (); } } } @@ -557,5 +568,8 @@ ENTER_DESCRIPTION (Piano_pedal_engraver, /* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner", /* accepts */ "pedal-event", /* acks */ "note-column-interface", -/* reads */ "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings pedalSostenutoStyle pedalSustainStyle pedalUnaCordaStyle", +/* reads */ "currentCommandColumn " + "pedalSostenutoStrings pedalSustainStrings " + "pedalUnaCordaStrings pedalSostenutoStyle " + "pedalSustainStyle pedalUnaCordaStyle", /* write */ ""); diff --git a/scripts/GNUmakefile b/scripts/GNUmakefile index 72a36b0153..2c0ad847fe 100644 --- a/scripts/GNUmakefile +++ b/scripts/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SEXECUTABLES=convert-ly lilypond-book lilypond abc2ly etf2ly musedata2ly mup2ly midi2ly +SEXECUTABLES=convert-ly lilypond-book lilypond abc2ly etf2ly musedata2ly mup2ly midi2ly STEPMAKE_TEMPLATES=script help2man po LOCALSTEPMAKE_TEMPLATES = lilypond HELP2MAN_EXECS = $(SEXECUTABLES) -- 2.39.2