summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2007-01-09 14:57:00 +0100
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2007-01-09 14:57:00 +0100
commit70f310c7a1ec759017b830e5d4fd781c700b3b9d (patch)
treedb872b26a7355a5fb43f2201a923cb2946dad555
parent503b1eec87f558ef35120899421c5fb25a09ed6b (diff)
Fix #229.
Also use rationals for figured bass accidentals.
-rw-r--r--input/regression/figured-bass-alteration.ly22
-rw-r--r--lily/parser.yy14
-rw-r--r--scm/chord-name.scm1
3 files changed, 30 insertions, 7 deletions
diff --git a/input/regression/figured-bass-alteration.ly b/input/regression/figured-bass-alteration.ly
new file mode 100644
index 0000000000..bc910f76fd
--- /dev/null
+++ b/input/regression/figured-bass-alteration.ly
@@ -0,0 +1,22 @@
+
+\header {
+ texidoc = "Bass figures can carry alterations."
+}
+
+\version "2.11.10"
+
+\layout {
+ ragged-right= ##t
+}
+
+\relative c'' {
+ \new Voice
+ <<
+ { c4 c c }
+ \figures
+ {
+ <3- > <3! > <3+ >
+ }
+ >>
+}
+
diff --git a/lily/parser.yy b/lily/parser.yy
index d1095308d5..02f03dea92 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -300,7 +300,7 @@ If we give names, Bison complains.
%type <book> book_body
%type <i> bare_unsigned
-%type <i> figured_bass_alteration
+%type <scm> figured_bass_alteration
%type <i> dots
%type <i> exclamations
%type <i> optional_rest
@@ -1824,9 +1824,9 @@ bass_number:
;
figured_bass_alteration:
- '-' { $$ = -2; }
- | '+' { $$ = 2; }
- | '!' { $$ = 0; }
+ '-' { $$ = ly_rational2scm (FLAT_ALTERATION); }
+ | '+' { $$ = ly_rational2scm (SHARP_ALTERATION); }
+ | '!' { $$ = scm_from_int (0); }
;
bass_figure:
@@ -1851,11 +1851,11 @@ bass_figure:
}
| bass_figure figured_bass_alteration {
Music *m = unsmob_music ($1);
- if ($2) {
+ if (scm_to_double ($2)) {
SCM salter = m->get_property ("alteration");
- int alter = scm_is_number (salter) ? scm_to_int (salter) : 0;
+ SCM alter = scm_is_number (salter) ? salter : scm_from_int (0);
m->set_property ("alteration",
- scm_from_int (alter + $2));
+ scm_sum (alter, $2));
} else {
m->set_property ("alteration", scm_from_int (0));
}
diff --git a/scm/chord-name.scm b/scm/chord-name.scm
index c941d50bda..939ae7b91e 100644
--- a/scm/chord-name.scm
+++ b/scm/chord-name.scm
@@ -15,6 +15,7 @@
;; TODO: make into markup.
;;
(define-public (alteration->text-accidental-markup alteration)
+
(make-smaller-markup
(make-raise-markup
(if (= alteration FLAT)