From 88e4c845630eaa9462729321a13c060f718a1975 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 4 Jul 2004 12:15:09 +0000 Subject: [PATCH] * scm/define-context-properties.scm (all-user-translation-properties): change voltaOnThisStaff definition. Backport? * lily/volta-engraver.cc (stop_translation_timestep): set bounds if necessary. * lily/volta-bracket.cc (print): handle volta brackets without bars. --- ChangeLog | 12 ++++++ Documentation/topdocs/NEWS.texi | 6 ++- Documentation/user/advanced.itely | 2 +- Documentation/user/notation.itely | 49 +++++++++++---------- lily/volta-bracket.cc | 12 ++---- lily/volta-engraver.cc | 72 +++++++++++++++++++------------ ly/engraver-init.ly | 3 ++ scm/define-context-properties.scm | 4 +- 8 files changed, 94 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ee0a70f0e..a9fa5fee63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-07-04 Han-Wen Nienhuys + + * scm/define-context-properties.scm + (all-user-translation-properties): change voltaOnThisStaff + definition. Backport? + + * lily/volta-engraver.cc (stop_translation_timestep): set bounds + if necessary. + + * lily/volta-bracket.cc (print): handle volta brackets without + bars. + 2004-07-01 Jan Nieuwenhuizen * scripts/abc2ly.py (try_parse_chord_delims): Bugfix: update to diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 2285843080..5eb687ea8c 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -26,7 +26,11 @@ following code may be used. @end example @item A new block, @code{\bookpaper} has been introduced to -hold settings for paper size and output scaling. +hold settings for paper size and output scaling. Further options +include @code{raggedbottom} (if set, systems are not vertically filled +to reach the bottom of the page), and @code{raggedlastbottom}. + + @item Support for fret diagrams has been contributed by Carl D. Sorensen. @file{input/test/fret-diagram.ly} contains an example. diff --git a/Documentation/user/advanced.itely b/Documentation/user/advanced.itely index 339ca90fce..385ad001fd 100644 --- a/Documentation/user/advanced.itely +++ b/Documentation/user/advanced.itely @@ -87,7 +87,7 @@ interactions between different modules of LilyPond. LilyPond includes an interpreter for the programming language Scheme, a member of the LISP family. This interpreter, -@uref{GUILE,http://www.gnu.org/software/guile/}, +@uref{http://www.gnu.org/software/guile/,GUILE}, forms the basis of the **************************************************************** diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index bc6f0bdd45..48dda9a530 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -2546,6 +2546,13 @@ c1 } @end lilypond +@seealso + +Brackets for the repeat are normally only printed over the topmost +staff. This can be adjusted by setting the @code{voltaOnThisStaff} +property @inputfileref{input/regression,volta-multi-staff.ly}, +@inputfileref{input/regression,volta-chord-names.ly} + @refbugs A nested repeat like @@ -2563,6 +2570,16 @@ having the @code{\alternative} belong to the inner @code{\repeat}. For clarity, it is advisable to use braces in such situations. @cindex ambiguity + + +Timing information is not remembered at the start of an alternative, +so after a repeat timing information must be reset by hand, for +example by setting @code{Score.measurePosition} or entering +@code{\partial}. Similarly, slurs or ties are also not repeated. + + + + @node Repeats and MIDI @subsection Repeats and MIDI @@ -2572,13 +2589,6 @@ For instructions on how to expand repeats for MIDI output, see the example file @inputfileref{input/test,unfold-all-repeats.ly}. -@refbugs - -Timing information is not remembered at the start of an alternative, -so after a repeat timing information must be reset by hand, for -example by setting @code{Score.measurePosition} or entering -@code{\partial}. Similarly, slurs or ties are also not repeated. - @node Manual repeat commands @subsection Manual repeat commands @@ -3670,24 +3680,6 @@ Program reference: Layout objects @internalsref{LyricText} and @internalsref{VocalName}. Music expressions @internalsref{LyricEvent}. -@refbugs - -@cindex ambiguity - -Input for lyrics introduces a syntactical ambiguity - -@example -foo = bar -@end example - -@noindent -is interpreted as assigning a string identifier @code{\foo} such that -it contains @code{"bar"}. However, it could also be interpreted as -making or a music identifier @code{\foo} containing the syllable -`bar'. The force the latter interpretation, use -@example -foo = \lyrics bar4 -@end example @node Ambitus @@ -4362,6 +4354,9 @@ names, for example } @end lilypond +For longer instrument names, it may be useful to increase the +@code{indent} setting in the @code{\paper} block. + @seealso Program reference: @internalsref{InstrumentName}. @@ -7594,6 +7589,10 @@ The MIDI output allocates a channel for each Staff, and one for global settings. Hence, the MIDI file should not have more than 15 staves (or 14 if you do not use drums). Other staves will remain silent. +Not all MIDI players correctly handle tempo change in the MIDI +output. Players that are known to work include +@uref{timidity,http://timidity.sourceforge.net/} + @menu * MIDI block:: diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 9f4d8a505f..0d2d93a491 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -37,12 +37,6 @@ SCM Volta_bracket_interface::print (SCM smob) { Grob *me = unsmob_grob (smob); - Link_array bars - = Pointer_group_interface__extract_grobs (me, (Item*)0, "bars"); - - if (!bars.size ()) - return SCM_EOL; - Spanner *orig_span = dynamic_cast (me->original_); bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner*)me); @@ -52,14 +46,14 @@ Volta_bracket_interface::print (SCM smob) bool no_vertical_start = orig_span && !broken_first_bracket; bool no_vertical_end = orig_span && !broken_last_bracket; SCM s = me->get_property ("bars"); - Grob * endbar = unsmob_grob (ly_car (s)); - SCM glyph = endbar->get_property ("glyph"); + Grob * endbar = ly_c_pair_p (s) ? unsmob_grob (ly_car (s)) : 0; + SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL; String str; if (ly_c_string_p (glyph)) str = ly_scm2string (glyph); else - return SCM_EOL; + str = "|"; const char* cs = str.to_str0 (); no_vertical_end |= diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 6215489426..15fe9e9c0c 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -60,41 +60,42 @@ Volta_engraver::Volta_engraver () bool Volta_engraver::staff_eligible () { - /* - UGH. - */ - if (!unsmob_grob (staff_)) - return true; - - if (!to_boolean (get_property ("voltaOnThisStaff"))) + SCM doit =get_property ("voltaOnThisStaff"); + if (ly_c_boolean_p (doit)) { - /* - TODO: this does weird things when you open a piece with a - volta spanner. - - */ - SCM staffs = get_property ("stavesFound"); + return to_boolean (doit); + } - /* - only put a volta on the top staff. + + if (!unsmob_grob (staff_)) + return false; + + /* + TODO: this does weird things when you open a piece with a + volta spanner. + */ + SCM staffs = get_property ("stavesFound"); + + /* + only put a volta on the top staff. - May be this is a bit convoluted, and we should have a single - volta engraver in score context or somesuch. + May be this is a bit convoluted, and we should have a single + volta engraver in score context or somesuch. - */ - if (!ly_c_pair_p (staffs)) - { - programming_error ("Huh? Volta engraver can't find staffs?"); - return false; - } - else if (ly_car (scm_last_pair (staffs)) != staff_) - { - return false; - } + */ + if (!ly_c_pair_p (staffs)) + { + programming_error ("Huh? Volta engraver can't find staffs?"); + return false; + } + else if (ly_car (scm_last_pair (staffs)) != staff_) + { + return false; } return true; } + void Volta_engraver::process_music () { @@ -227,7 +228,22 @@ Volta_engraver::stop_translation_timestep () volta_span_ = 0; } + if (end_volta_span_ && !end_volta_span_->get_bound (RIGHT)) + { + Grob * cc = unsmob_grob (get_property ("currentCommandColumn")); + Item * ci = dynamic_cast (cc); + end_volta_span_->set_bound (RIGHT, ci); + } + end_volta_span_ =0; + + if (volta_span_ && !volta_span_->get_bound (LEFT)) + { + Grob * cc = unsmob_grob (get_property ("currentCommandColumn")); + Item * ci = dynamic_cast (cc); + volta_span_->set_bound (LEFT, ci); + } + } /* @@ -235,7 +251,7 @@ Volta_engraver::stop_translation_timestep () */ ENTER_DESCRIPTION (Volta_engraver, -/* descr */ "Make volta brackets", +/* descr */ "Make volta brackets.", /* creats*/ "VoltaBracket", /* accepts */ "", /* acks */ "bar-line-interface staff-symbol-interface note-column-interface", diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 0b2a447902..a8b80d096a 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -352,6 +352,8 @@ printing of a single line of lyrics. " \type "Engraver_group_engraver" \name ChordNames \description "Typesets chord names." + + \consists "Volta_engraver" \consists "Rest_swallow_translator" \consists "Output_property_engraver" @@ -360,6 +362,7 @@ printing of a single line of lyrics. " \consists "Skip_event_swallow_translator" \consistsend "Hara_kiri_engraver" + voltaOnThisStaff = ##f minimumVerticalExtent = #'(0 . 2.5) extraVerticalExtent = ##f \override SeparatingGroupSpanner #'padding = #0.8 diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 85e926711a..18382269dd 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -393,8 +393,8 @@ vertical group.") (voltaOnThisStaff ,boolean? "Normally, volta brackets are put only on the -topmost staff. Setting this variable will create a bracket on -this staff as well.") +topmost staff. This variable overrides this behavior, when set to +@code{#t} or @code{#f}.") (voltaSpannerDuration ,ly:moment? "This specifies the maximum duration to use for the brackets printed for @code{\\alternative}. This can be -- 2.39.2