demonstrate extenders, update seealso links.
* scm/titling.scm (marked-up-headfoot): change tagline
handling. tagline = ##f will blank the tagline as well.
2005-10-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * 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.
@c TODO: musicological blurb about FB
-LilyPond has limited support for figured bass
+LilyPond has support for figured bass
@lilypond[quote,raggedright,verbatim,fragment]
<<
\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
@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
-\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]>
+
+ }
>>
#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*);
/*
- horizontal-bracket.cc -- implement Horizontal_bracket
+ horizontal-bracket.cc -- implement Horizontal_bracket
source file of the GNU LilyPond music typesetter
#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<Grob> grobs, Axis a, Direction dir)
+Horizontal_bracket::make_bracket (Grob *me, Grob *refpoint,
+ Link_array<Grob> 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<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
Interval (1.0, 1.0));
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<Spanner *> (me);
-
extract_grob_set (me, "columns", gs);
if (!gs.size ())
{
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 ();
}
#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);
}
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");
`(
;; 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.")
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
"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")
@@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.")
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)) ))
(list pgnum-alist)
prefixed-alists
(layout-extract-page-properties layout))))
- (display prefixed-alists)
+
(interpret-markup layout props potential-markup))
empty-stencil))