From 035d9f63b1d296bc312e1b077b8633ed66b5e6fb Mon Sep 17 00:00:00 2001 From: hanwen Date: Fri, 7 Oct 2005 09:50:22 +0000 Subject: [PATCH] * Documentation/user/instrument-notation.itely (Figured bass): demonstrate extenders, update seealso links. * scm/titling.scm (marked-up-headfoot): change tagline handling. tagline = ##f will blank the tagline as well. --- ChangeLog | 5 ++ Documentation/user/instrument-notation.itely | 26 ++++++-- input/regression/figured-bass.ly | 63 +++++++++++--------- lily/figured-bass-continuation.cc | 54 ----------------- lily/horizontal-bracket.cc | 51 +++++++--------- lily/lyric-hyphen.cc | 18 ++++-- scm/define-context-properties.scm | 15 +++-- scm/define-grobs.scm | 2 +- scm/titling.scm | 2 +- 9 files changed, 111 insertions(+), 125 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e278a1f27..581aa1d5b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-10-07 Han-Wen Nienhuys + * lily/enclosing-bracket.cc (struct Enclosing_bracket): new file. + + * Documentation/user/instrument-notation.itely (Figured bass): + demonstrate extenders, update seealso links. + * scm/titling.scm (marked-up-headfoot): change tagline handling. tagline = ##f will blank the tagline as well. diff --git a/Documentation/user/instrument-notation.itely b/Documentation/user/instrument-notation.itely index 6ebcbd776d..c36fc98bc5 100644 --- a/Documentation/user/instrument-notation.itely +++ b/Documentation/user/instrument-notation.itely @@ -3986,7 +3986,7 @@ Program reference: @internalsref{Accidental_engraver} engraver and the @c TODO: musicological blurb about FB -LilyPond has limited support for figured bass +LilyPond has support for figured bass @lilypond[quote,raggedright,verbatim,fragment] << @@ -4037,12 +4037,23 @@ strings and text markups, see @ref{Overview of text markup commands}. \figuremode { < [4 6] 8 [_! 12] > < 5 \markup{ + \number 6 } > } @end lilypond +It is also possible to use continuation lines for repeated figures, + +@lilypond[verbatim,relative=1] +<< + \new Staff { c4 c } + \figures { + \set useBassFigureExtenders = ##t + <4 6> <3 6> <3 7> + } +>> +@end lilypond Although the support for figured bass may superficially resemble chord -support, it works much simpler. The @code{\figuremode} mode simply -stores the numbers and @internalsref{FiguredBass} context prints -them as entered. There is no conversion to pitches and no -realizations of the bass are played in the MIDI file. +support, it is much simpler. The @code{\figuremode} mode simply +stores the numbers and @internalsref{FiguredBass} context prints them +as entered. There is no conversion to pitches and no realizations of +the bass are played in the MIDI file. Internally, the code produces markup texts. You can use any of the markup text properties to override formatting. For example, the @@ -4050,7 +4061,10 @@ vertical spacing of the figures may be set with @code{baseline-skip}. @seealso -Program reference: @internalsref{BassFigure} object, +Program reference: @internalsref{NewBassFigure}, +@internalsref{BassFigureAlignment}, @internalsref{BassFigureLine}, +@internalsref{BassFigureBracket}, and +@internalsref{BassFigureContinuation} objects and @internalsref{FiguredBass} context. @refbugs diff --git a/input/regression/figured-bass.ly b/input/regression/figured-bass.ly index 85ba15eba0..5a4dd4aec0 100644 --- a/input/regression/figured-bass.ly +++ b/input/regression/figured-bass.ly @@ -1,34 +1,43 @@ -\version "2.6.0" +\version "2.7.12" + \header { - texidoc = " -Figured bass is created by the FiguredBass context which responds to -figured bass requests and rest-requests. You must enter these using -the special @code{\figuremode @{ @}} mode, which allows you to type -numbers, like @code{<4 6+>}. -You can also type letters by entering quoted strings, which is shown in the -last bass figure. -" } -\layout { raggedright = ##t } + texidoc = " Figured bass is created by the FiguredBass context which +responds to figured bass events and rest events. You must enter these +using the special @code{\figuremode @{ @}} mode, which allows you to +type numbers, like @code{<4 6+>}. + +You can also enter markup strings. The vertical alignment may also be +tuned. + +" + +} + + +\paper { raggedright = ##t } + + << - \figures { - <3 [5 7]> - \once \override BassFigure #'direction = #down - <3 [5 7]> - <3 [5] 7 [9 11]> - <3+ 5- 7!> - <3 _! 5 _- 7> - <3 _ 5 _ 7> - <"V7" ["bla" 6] \markup{ \musicglyph #"rests.2"} > - - } - \context Voice { - \clef bass - c 4 - c c c c c - g8 - } + \context Voice { + \clef bass + c 4 + c c c c c + g8 + } + \figures { + <3 [5 7]> + <3 [5] 7 [9 11]> + <3+ 5- 7!> + <3 _! 5 _- 7> + <3 _ 5 _ 7> + <"V7" ["bla" 6] \markup{ \musicglyph #"rests.2"} > + + \once \override BassFigureAlignment #'stacking-dir = #UP + <3 [5 7]> + + } >> diff --git a/lily/figured-bass-continuation.cc b/lily/figured-bass-continuation.cc index 766dc49818..1969cf30d5 100644 --- a/lily/figured-bass-continuation.cc +++ b/lily/figured-bass-continuation.cc @@ -19,60 +19,6 @@ #include "horizontal-bracket.hh" -struct Figured_bass_bracket -{ - static bool has_interface (Grob*); - -public: - DECLARE_SCHEME_CALLBACK(print, (SCM)); -}; - - -ADD_INTERFACE(Figured_bass_bracket, - "figured-bass-bracket-interface", - "Brackets alongside bass figures.", - - /* props */ - - /* ugh: should make bracket interface. */ - "bracket-flare " - "shorten-pair " - "edge-height " - "padding " - "thickness " - "elements " - ); - -MAKE_SCHEME_CALLBACK (Figured_bass_bracket, print, 1); -SCM -Figured_bass_bracket::print (SCM grob) -{ - Grob *me = unsmob_grob (grob); - extract_grob_set (me, "elements", elements); - if (elements.is_empty ()) - { - me->suicide (); - return SCM_EOL; - } - - Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); - Interval xext = Axis_group_interface::relative_group_extent (elements, common_x, X_AXIS); - - Stencil left_br = Horizontal_bracket::make_bracket (me, me, elements, - Y_AXIS, LEFT); - Stencil right_br = Horizontal_bracket::make_bracket (me, me, elements, - Y_AXIS, RIGHT); - - xext.widen (robust_scm2double (me->get_property ("padding"), 0.25)); - left_br.translate_axis (xext[LEFT], X_AXIS); - right_br.translate_axis (xext[RIGHT], X_AXIS); - - left_br.add_stencil (right_br); - left_br.translate_axis (-me->relative_coordinate (common_x, X_AXIS), X_AXIS); - return left_br.smobbed_copy (); -} - - struct Figured_bass_continuation { static bool has_interface (Grob*); diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 8c206bb729..f3abaa5e61 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -1,5 +1,5 @@ /* - horizontal-bracket.cc -- implement Horizontal_bracket + horizontal-bracket.cc -- implement Horizontal_bracket source file of the GNU LilyPond music typesetter @@ -12,27 +12,18 @@ #include "directional-element-interface.hh" #include "output-def.hh" #include "staff-symbol-referencer.hh" -#include "tuplet-bracket.hh" // ugh. -#include "horizontal-bracket.hh" // ugh. - -/* - TODO: - - This doesn't look very elegant: should support winged edges. - - Support texts on the brackets? -*/ +#include "tuplet-bracket.hh" +#include "horizontal-bracket.hh" +#include "axis-group-interface.hh" Stencil -Horizontal_bracket::make_bracket (Grob *me, Grob *common, - Link_array grobs, Axis a, Direction dir) +Horizontal_bracket::make_bracket (Grob *me, Grob *refpoint, + Link_array grobs, + Axis a, Direction dir) { Axis other = other_axis (a); - - Grob *cx = common_refpoint_of_array (grobs, common, a); - - Interval ext = grobs.top ()->extent (cx, a); - ext.unite (grobs[0]->extent (cx, a)); + Grob *common = common_refpoint_of_array (grobs, refpoint, a); + Interval ext = Axis_group_interface::relative_group_extent (grobs, common, a); Drul_array edge_height = robust_scm2interval (me->get_property ("edge-height"), Interval (1.0, 1.0)); @@ -47,22 +38,32 @@ Horizontal_bracket::make_bracket (Grob *me, Grob *common, Interval empty; Offset start; start[a] = ext.length (); + + /* + ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around. + */ Stencil b = Tuplet_bracket::make_bracket (me, other, start, edge_height, empty, flare, shorten); - b.translate_axis (ext[LEFT], a); + b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a) + , a); return b; } + +/* + TODO: + + Support texts on the brackets? +*/ + MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1); SCM Horizontal_bracket::print (SCM smob) { Grob *me = unsmob_grob (smob); - Spanner *sp = dynamic_cast (me); - extract_grob_set (me, "columns", gs); if (!gs.size ()) { @@ -70,13 +71,7 @@ Horizontal_bracket::print (SCM smob) return SCM_EOL; } - Grob *cx = me->common_refpoint (sp->get_bound (LEFT), X_AXIS); - cx = cx->common_refpoint (sp->get_bound (RIGHT), X_AXIS); - - Stencil b = make_bracket (me, cx, gs, X_AXIS, get_grob_direction (me)); - - b.translate_axis (- sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS); - + Stencil b = make_bracket (me, me, gs, X_AXIS, get_grob_direction (me)); return b.smobbed_copy (); } diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 8e78407d88..17fefa0923 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -14,8 +14,11 @@ #include "paper-column.hh" #include "moment.hh" -MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1) - SCM +/* + TODO: should extract hyphen from the font. + */ +MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1); +SCM Hyphen_spanner::print (SCM smob) { Spanner *me = unsmob_spanner (smob); @@ -128,6 +131,13 @@ Hyphen_spanner::set_spacing_rods (SCM smob) } ADD_INTERFACE (Hyphen_spanner, "lyric-hyphen-interface", - "A centred hyphen is a simple line between lyrics used to divide syllables", - "padding thickness height dash-period minimum-length length"); + "A centered hyphen is a simple line between lyrics used to divide syllables", + + /* props */ + "padding " + "thickness " + "height " + "dash-period " + "minimum-length " + "length"); diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index c7da88a649..1452221f3d 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -24,10 +24,7 @@ `( ;; TODO FIXME - (useBassFigureExtenders ,boolean? "") - (figuredBassAlterationDirection ,ly:dir? "") - (newFiguredBassFormatter ,procedure? "") - + (aDueText ,string? "Text to print at a unisono passage.") (alignBelowContext ,string? "Where to insert newly created context in vertiical alignment.") (alignAboveContext ,string? "Where to insert newly created context in vertiical alignment.") @@ -110,9 +107,13 @@ returns whether the corresponding bar number should be printed") for the down staff of PianoStaff. Used by @code{\\autochange}") (trebleStaffProperties ,list? "Alist of property settings to apply for the up staff of PianoStaff. Used by @code{\\autochange}") + + (newFiguredBassFormatter ,procedure? "Routine generating a markup +for a bass figure.") (bassFigureFormatFunction ,procedure? "Procedure that is called to produce the formatting for a @code{BassFigure} grob. It takes a list of @code{BassFigureEvent}s, a context, and the grob to format.") + (beatLength ,ly:moment? "The length of one beat in this time signature.") (beatGrouping ,list? "List of beatgroups, e.g., in 5/8 time @code{'(2 @@ -208,6 +209,8 @@ another non-natural.") "extra vertical extent, same format as @var{minimumVerticalExtent}") + (figuredBassAlterationDirection ,ly:dir? "Where to put +alterations relative to the main figure.") (followVoice ,boolean? "If set, note heads are tracked across staff switches by a thin line") @@ -411,6 +414,10 @@ context Voice \\times 2/3 @{ @@end lilypond @end example .") + + (useBassFigureExtenders ,boolean? "Whether to use extender lines +for repeated bass figures") + (verticalAlignmentChildCallback ,procedure? "What callback to add to children of a vertical alignment. It determines what procedure is used on the alignment itself.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index c15d080aa4..23c3322f1a 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -215,7 +215,7 @@ bass-figure-interface font-interface)))))) (BassFigureBracket - . ((print-function . ,Figured_bass_bracket::print) + . ((print-function . ,Enclosing_bracket::print) (edge-height . (0.2 . 0.2)) (meta . ((class . Item) (interfaces . (figured-bass-bracket-interface)) )) diff --git a/scm/titling.scm b/scm/titling.scm index ab429c85f9..3e7d556018 100644 --- a/scm/titling.scm +++ b/scm/titling.scm @@ -49,7 +49,7 @@ page:last?, page:page-number-string and page:page-number (list pgnum-alist) prefixed-alists (layout-extract-page-properties layout)))) - (display prefixed-alists) + (interpret-markup layout props potential-markup)) empty-stencil)) -- 2.39.5