From: Han-Wen Nienhuys Date: Tue, 9 Jan 2007 13:57:00 +0000 (+0100) Subject: Fix #229. X-Git-Tag: release/2.11.11-1~41 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=70f310c7a1ec759017b830e5d4fd781c700b3b9d;p=lilypond.git Fix #229. Also use rationals for figured bass accidentals. --- 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_body %type bare_unsigned -%type figured_bass_alteration +%type figured_bass_alteration %type dots %type exclamations %type 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)