summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2005-10-09 15:28:35 +0000
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2005-10-09 15:28:35 +0000
commit4a4b9008d4e571eb5714314661f5eaf35b117ef0 (patch)
tree3418ca98521085bce40f12caf706696025d0323b
parenta007fbad33b01c27c615041d08753e21b78ccf00 (diff)
* scm/parser-ly-from-scheme.scm: rename from ly-from-scheme.scm
* scm/parser-clef.scm (supported-clefs): rename from clef.scm * scm/layout-slur.scm: rename from slur.scm * scm/layout-page-layout.scm: rename from page-layout.scm * scm/layout-beam.scm: rename from beam.scm * scm/define-grob-interfaces.scm (bass-figure-interface): add bass-figure-interface * lily/new-figured-bass-engraver.cc (process_music): add implicitBassFigures property. * scm/define-markup-commands.scm (pad-x): new markup. * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): set minimumVerticalExtent on FiguredBass context. * lily/figured-bass-continuation.cc (center_on_figures): kludge in case the continuation crosses a line break.
-rw-r--r--ChangeLog28
-rw-r--r--VERSION2
-rw-r--r--input/regression/figured-bass-implicit.ly33
-rw-r--r--lily/figured-bass-continuation.cc12
-rw-r--r--lily/new-figured-bass-engraver.cc29
-rw-r--r--ly/engraver-init.ly4
-rw-r--r--scm/bass-figure.scm101
-rw-r--r--scm/define-context-properties.scm4
-rw-r--r--scm/define-grob-interfaces.scm5
-rw-r--r--scm/define-grob-properties.scm2
-rw-r--r--scm/define-markup-commands.scm30
-rw-r--r--scm/layout-beam.scm (renamed from scm/beam.scm)0
-rw-r--r--scm/layout-page-layout.scm (renamed from scm/page-layout.scm)0
-rw-r--r--scm/layout-slur.scm (renamed from scm/slur.scm)0
-rw-r--r--scm/lily.scm11
-rw-r--r--scm/parser-clef.scm (renamed from scm/clef.scm)0
-rw-r--r--scm/parser-ly-from-scheme.scm (renamed from scm/ly-from-scheme.scm)0
-rw-r--r--scm/translation-functions.scm51
18 files changed, 190 insertions, 122 deletions
diff --git a/ChangeLog b/ChangeLog
index f2e57bce55..3f170d6554 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2005-10-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/parser-ly-from-scheme.scm: rename from ly-from-scheme.scm
+
+ * scm/parser-clef.scm (supported-clefs): rename from clef.scm
+
+ * scm/layout-slur.scm: rename from slur.scm
+
+ * scm/layout-page-layout.scm: rename from page-layout.scm
+
+ * scm/layout-beam.scm: rename from beam.scm
+
+ * scm/define-grob-interfaces.scm (bass-figure-interface): add
+ bass-figure-interface
+
+ * lily/new-figured-bass-engraver.cc (process_music): add
+ implicitBassFigures property.
+
+ * scm/define-markup-commands.scm (pad-x): new markup.
+
+ * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): set
+ minimumVerticalExtent on FiguredBass context.
+
+ * lily/figured-bass-continuation.cc (center_on_figures): kludge in
+ case the continuation crosses a line break.
+
2005-10-09 Jan Nieuwenhuizen <janneke@gnu.org>
* flower/file-name.cc (dos_to_posix)[__CYGWIN__]: Return
@@ -6,6 +32,8 @@
2005-10-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * VERSION (PACKAGE_NAME): release 2.7.12
+
* input/regression/figured-bass-continuation-center.ly: new file.
* input/regression/beam-outside-beamlets.ly: new file.
diff --git a/VERSION b/VERSION
index 59cd04e448..38bfbcfef3 100644
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=7
-PATCH_LEVEL=12
+PATCH_LEVEL=13
MY_PATCH_LEVEL=
diff --git a/input/regression/figured-bass-implicit.ly b/input/regression/figured-bass-implicit.ly
new file mode 100644
index 0000000000..92eeed066b
--- /dev/null
+++ b/input/regression/figured-bass-implicit.ly
@@ -0,0 +1,33 @@
+
+\header
+{
+
+ texidoc = "Implicit bass figures are not printed, but they do get extenders."
+}
+
+
+\version "2.7.13"
+\paper
+{
+ raggedright = ##t
+}
+
+<<
+ \relative c'' \new Voice {
+ c^"normal" c c c^"extenders" c c c_"implicit" c
+ }
+ \figures {
+ <3 6!>
+ <3 4+>
+ r
+ \set useBassFigureExtenders = ##t
+ <3 6!>
+ <3 4+>
+ r
+ \set useBassFigureExtenders = ##t
+ \set implicitBassFigures = #'(3)
+ <3 6!>
+ <3 4+>
+ }
+>>
+
diff --git a/lily/figured-bass-continuation.cc b/lily/figured-bass-continuation.cc
index 1969cf30d5..4001dc5f26 100644
--- a/lily/figured-bass-continuation.cc
+++ b/lily/figured-bass-continuation.cc
@@ -36,10 +36,13 @@ Figured_bass_continuation::center_on_figures (SCM grob, SCM axis)
(void) axis;
extract_grob_set (me, "figures", figures);
+ if (figures.is_empty ())
+ return scm_from_double (0.0);
Grob *common = common_refpoint_of_array (figures, me, Y_AXIS);
Interval ext = Axis_group_interface::relative_group_extent (figures, common, Y_AXIS);
-
+ if (ext.is_empty ())
+ return scm_from_double (0.0);
return scm_from_double (ext.center () - me->relative_coordinate (common, Y_AXIS));
}
@@ -59,8 +62,13 @@ Figured_bass_continuation::print (SCM grob)
X_AXIS);
do
{
+ Item *bound = me->get_bound (d);
+ Direction extdir =
+ (d == LEFT && to_boolean (bound->get_property ("implicit")))
+ ? LEFT : RIGHT;
+
spanned[d]
- = robust_relative_extent (me->get_bound (d), common, X_AXIS)[RIGHT]
+ = robust_relative_extent (bound, common, X_AXIS)[extdir]
- me->relative_coordinate (common, X_AXIS);
}
while (flip (&d) != LEFT);
diff --git a/lily/new-figured-bass-engraver.cc b/lily/new-figured-bass-engraver.cc
index be5a78cc08..a68a9c18a5 100644
--- a/lily/new-figured-bass-engraver.cc
+++ b/lily/new-figured-bass-engraver.cc
@@ -266,6 +266,7 @@ New_figured_bass_engraver::process_music ()
if (!new_music_found_)
return ;
+
new_music_found_ = false;
/*
@@ -287,7 +288,6 @@ New_figured_bass_engraver::process_music ()
{
clear_spanners ();
}
-
int k = 0;
for (int i = 0; i < new_musics_.size (); i++)
@@ -321,26 +321,28 @@ New_figured_bass_engraver::process_music ()
Array<int> junk_continuations;
for (int i = 0; i < groups_.size(); i++)
{
- if (groups_[i].is_continuation ())
+ Figure_group &group = groups_[i];
+
+ if (group.is_continuation ())
{
- if (!groups_[i].continuation_line_)
+ if (!group.continuation_line_)
{
Spanner * line = make_spanner ("BassFigureContinuation", SCM_EOL);
- Item * item = groups_[i].figure_item_;
- groups_[i].continuation_line_ = line;
+ Item * item = group.figure_item_;
+ group.continuation_line_ = line;
line->set_bound (LEFT, item);
/*
Don't add as child. This will cache the wrong
(pre-break) stencil when callbacks are triggered.
*/
- line->set_parent (groups_[i].group_, Y_AXIS);
+ line->set_parent (group.group_, Y_AXIS);
Pointer_group_interface::add_grob (line, ly_symbol2scm ("figures"), item);
-
- groups_[i].figure_item_ = 0;
+
+ group.figure_item_ = 0;
}
}
- else if (groups_[i].continuation_line_)
+ else if (group.continuation_line_)
junk_continuations.push (i);
}
@@ -391,6 +393,7 @@ New_figured_bass_engraver::create_grobs ()
= make_item ("NewBassFigure",
group.current_music_->self_scm ());
+
SCM fig = group.current_music_->get_property ("figure");
if (!group.group_)
{
@@ -401,6 +404,11 @@ New_figured_bass_engraver::create_grobs ()
Align_interface::alignment_callback_proc);
}
+ if (scm_memq (fig, get_property ("implicitBassFigures")) != SCM_BOOL_F)
+ {
+ item->set_property ("transparent", SCM_BOOL_T);
+ item->set_property ("implicit", SCM_BOOL_T);
+ }
group.number_ = fig;
group.alteration_ = group.current_music_->get_property ("alteration");
@@ -450,6 +458,9 @@ ADD_TRANSLATOR (New_figured_bass_engraver,
"bass-figure-event rest-event",
/* read */
+ "implicitBassFigures "
+ "newFiguredBassFormatter "
+ "figuredBassAlterationDirection "
"useBassFigureExtenders",
/* write */
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 1fec13a6af..5282fc5104 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -551,7 +551,6 @@ AncientRemoveEmptyStaffContext = \context {
tablatureFormat = #fret-number-tablature-format
%%
- bassFigureFormatFunction = #format-bass-figure
newFiguredBassFormatter = #format-new-bass-figure
metronomeMarkFormatter = #format-metronome-markup
graceSettings = #`(
@@ -594,7 +593,7 @@ AncientRemoveEmptyStaffContext = \context {
\context {
\type "Engraver_group"
- \name FiguredBass
+ \name "FiguredBass"
%% \consists "Figured_bass_engraver"
\consists "New_figured_bass_engraver"
@@ -603,6 +602,7 @@ AncientRemoveEmptyStaffContext = \context {
\consists "Separating_line_group_engraver"
\consists "Hara_kiri_engraver"
\override RemoveEmptyVerticalGroup #'remove-first = ##t
+ minimumVerticalExtent = #'(-0.5 . 2.5)
}
\context {
diff --git a/scm/bass-figure.scm b/scm/bass-figure.scm
deleted file mode 100644
index dd71afdb6e..0000000000
--- a/scm/bass-figure.scm
+++ /dev/null
@@ -1,101 +0,0 @@
-;;;; bass-figure.scm -- implement Scheme output routines for TeX
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-
-(ly:add-interface
- 'bass-figure-interface
- "A bass figure, including bracket"
- '())
-
-
-(define-public (format-new-bass-figure figure event context)
- (let* ((fig (ly:music-property event 'figure))
- (fig-markup (if (number? figure)
- (markup #:number (number->string figure 10))
- #f
- ))
-
- (alt (ly:music-property event 'alteration))
- (alt-markup
- (if (number? alt)
- (markup
- #:general-align Y DOWN #:smaller #:smaller
- (alteration->text-accidental-markup alt))
-
- #f))
- (alt-dir (ly:context-property context 'figuredBassAlterationDirection))
- )
-
- (if (and (not fig-markup) alt-markup)
- (begin
- (set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
- (set! alt-markup #f)))
-
-
- ;; hmm, how to get figures centered between note, and
- ;; lone accidentals too?
-
- ;; (if (markup? fig-markup)
- ;; (set!
- ;; fig-markup (markup #:translate (cons 1.0 0)
- ;; #:hcenter fig-markup)))
-
- (if alt-markup
- (set! fig-markup
- (markup #:put-adjacent
- fig-markup X
- (if (number? alt-dir)
- alt-dir
- LEFT)
- #:pad-around 0.2 alt-markup
- )))
-
- (if (markup? fig-markup)
- fig-markup
- empty-markup)))
-
-(define-public (format-bass-figure figures context grob)
- ;; TODO: support slashed numerals here.
- (define (fig-to-markup fig-music)
- (let* ((align-accs
- (eq? #t (ly:context-property context 'alignBassFigureAccidentals)))
- (fig (ly:music-property fig-music 'figure))
- (acc (ly:music-property fig-music 'alteration))
- (acc-markup #f)
- (fig-markup
- (if (markup? fig)
- fig
- (if align-accs (make-simple-markup " ")
- (if (not (eq? acc '()))
- (make-simple-markup "")
- (make-strut-markup))))))
-
- (if (number? acc)
- (make-line-markup (list fig-markup
- (alteration->text-accidental-markup acc)))
- fig-markup)))
-
- (define (filter-brackets i figs acc)
- (cond
- ((null? figs) acc)
- (else
- (filter-brackets (1+ i) (cdr figs)
-
- (append
- (if (eq? (ly:music-property (car figs) 'bracket-start) #t)
- (list i)
- '())
- (if (eq? (ly:music-property (car figs) 'bracket-stop) #t)
- (list i)
- '())
-
- acc)))))
-
- (set! (ly:grob-property grob 'text)
- (make-bracketed-y-column-markup
- (sort (filter-brackets 0 figures '()) <)
- (map fig-to-markup figures))))
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 1452221f3d..73c6b0d630 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -239,6 +239,10 @@ selector for tab notation.")
(ignoreBarChecks ,boolean? "Ignore bar checks")
(ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics} line.")
+
+ (implicitBassFigures ,list? "List of bass figures that are not
+printed as numbers, but only as extender lines.")
+
(instr ,markup? "See @code{instrument}")
(instrument ,markup? "The name to print left of a staff. The
diff --git a/scm/define-grob-interfaces.scm b/scm/define-grob-interfaces.scm
index 9d5f7b9ddb..210b4552a0 100644
--- a/scm/define-grob-interfaces.scm
+++ b/scm/define-grob-interfaces.scm
@@ -106,6 +106,11 @@ are interesting enough to maintain a hara-kiri staff."
"A stanza number, to be put in from of a lyrics line"
'())
+(ly:add-interface
+ 'bass-figure-interface
+ "A bass figure text"
+ '(implicit))
+
;;; todo: this is not typesetting info. Move to interpretation.
(ly:add-interface
'tablature-interface
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index 02d96c137b..fe7c4f39ce 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -281,7 +281,7 @@ Choices are @code{around}, @code{inside}, @code{outside}. If unset, script
and slur ignore eachother.")
(inspect-quants ,number-pair? "If debugging is set,
set beam quant to this position, and print the respective scores.")
-
+ (implicit ,boolean? "Is this an implicit bass figure?")
(keep-inside-line ,boolean? "If set, this column cannot have
things sticking into the margin.")
(kern ,ly:dimension? "Amount of extra white space to add. For
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index 484a1c3d88..ccb03a499a 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -643,6 +643,23 @@ alignment accordingly."
(interval-widen x amount)
(interval-widen y amount))
))
+
+
+(def-markup-command (pad-x layout props amount arg) (number? markup?)
+
+ "Add padding @var{amount} around @var{arg} in the X-direction. "
+ (let*
+ ((m (interpret-markup layout props arg))
+ (x (ly:stencil-extent m X))
+ (y (ly:stencil-extent m Y)))
+
+
+ (ly:make-stencil (ly:stencil-expr m)
+ (interval-widen x amount)
+ y)
+ ))
+
+
(def-markup-command (put-adjacent layout props arg1 axis dir arg2) (markup? integer? ly:dir? markup?)
"Put @var{arg2} next to @var{arg1}, without moving @var{arg1}. "
@@ -653,6 +670,19 @@ alignment accordingly."
(ly:stencil-combine-at-edge m1 axis dir m2 0.0 0.0)
))
+(def-markup-command (transparent layout props arg) (markup?)
+ "Make the argument transparent"
+ (let*
+ ((m (interpret-markup layout props arg))
+ (x (ly:stencil-extent m X))
+ (y (ly:stencil-extent m Y)))
+
+
+
+ (ly:make-stencil ""
+ x y)))
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; property
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/scm/beam.scm b/scm/layout-beam.scm
index e92edc0e84..e92edc0e84 100644
--- a/scm/beam.scm
+++ b/scm/layout-beam.scm
diff --git a/scm/page-layout.scm b/scm/layout-page-layout.scm
index 64259c0263..64259c0263 100644
--- a/scm/page-layout.scm
+++ b/scm/layout-page-layout.scm
diff --git a/scm/slur.scm b/scm/layout-slur.scm
index 777b4a86dd..777b4a86dd 100644
--- a/scm/slur.scm
+++ b/scm/layout-slur.scm
diff --git a/scm/lily.scm b/scm/lily.scm
index cc899a67b3..593daa2cac 100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -224,7 +224,6 @@ The syntax is the same as `define*-public'."
"chord-generic-names.scm"
"stencil.scm"
"markup.scm"
- "bass-figure.scm"
"music-functions.scm"
"part-combiner.scm"
"autochange.scm"
@@ -232,15 +231,15 @@ The syntax is the same as `define*-public'."
"auto-beam.scm"
"chord-name.scm"
- "ly-from-scheme.scm"
+ "parser-ly-from-scheme.scm"
"define-context-properties.scm"
"translation-functions.scm"
"script.scm"
"midi.scm"
- "beam.scm"
- "clef.scm"
- "slur.scm"
+ "layout-beam.scm"
+ "parser-clef.scm"
+ "layout-slur.scm"
"font.scm"
"encoding.scm"
@@ -250,7 +249,7 @@ The syntax is the same as `define*-public'."
"define-grobs.scm"
"define-grob-interfaces.scm"
"define-stencil-commands.scm"
- "page-layout.scm"
+ "layout-page-layout.scm"
"titling.scm"
"paper.scm"
diff --git a/scm/clef.scm b/scm/parser-clef.scm
index aeb34db579..aeb34db579 100644
--- a/scm/clef.scm
+++ b/scm/parser-clef.scm
diff --git a/scm/ly-from-scheme.scm b/scm/parser-ly-from-scheme.scm
index 79267499bd..79267499bd 100644
--- a/scm/ly-from-scheme.scm
+++ b/scm/parser-ly-from-scheme.scm
diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index 571e6c964c..5c8fe4bf0b 100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -52,3 +52,54 @@
(define-public (format-mark-box-barnumbers mark context)
(make-bold-markup (make-box-markup
(number->string (ly:context-property context 'currentBarNumber)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Bass figures.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define-public (format-new-bass-figure figure event context)
+ (let* ((fig (ly:music-property event 'figure))
+ (fig-markup (if (number? figure)
+ (markup #:number (number->string figure 10))
+ #f
+ ))
+ (alt (ly:music-property event 'alteration))
+ (alt-markup
+ (if (number? alt)
+ (markup
+ #:general-align Y DOWN #:smaller #:smaller
+ (alteration->text-accidental-markup alt))
+
+ #f))
+ (alt-dir (ly:context-property context 'figuredBassAlterationDirection))
+ )
+
+ (if (and (not fig-markup) alt-markup)
+ (begin
+ (set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
+ (set! alt-markup #f)))
+
+
+ ;; hmm, how to get figures centered between note, and
+ ;; lone accidentals too?
+
+ ;; (if (markup? fig-markup)
+ ;; (set!
+ ;; fig-markup (markup #:translate (cons 1.0 0)
+ ;; #:hcenter fig-markup)))
+
+ (if alt-markup
+ (set! fig-markup
+ (markup #:put-adjacent
+ fig-markup X
+ (if (number? alt-dir)
+ alt-dir
+ LEFT)
+ #:pad-x 0.2 alt-markup
+ )))
+
+ (if (markup? fig-markup)
+ fig-markup
+ empty-markup)))
+