Also use rationals for figured bass accidentals.
--- /dev/null
+
+\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+ >
+ }
+ >>
+}
+
%type <book> book_body
%type <i> bare_unsigned
%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
%type <i> dots
%type <i> exclamations
%type <i> optional_rest
;
figured_bass_alteration:
;
figured_bass_alteration:
- '-' { $$ = -2; }
- | '+' { $$ = 2; }
- | '!' { $$ = 0; }
+ '-' { $$ = ly_rational2scm (FLAT_ALTERATION); }
+ | '+' { $$ = ly_rational2scm (SHARP_ALTERATION); }
+ | '!' { $$ = scm_from_int (0); }
}
| bass_figure figured_bass_alteration {
Music *m = unsmob_music ($1);
}
| bass_figure figured_bass_alteration {
Music *m = unsmob_music ($1);
+ if (scm_to_double ($2)) {
SCM salter = m->get_property ("alteration");
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",
m->set_property ("alteration",
- scm_from_int (alter + $2));
} else {
m->set_property ("alteration", scm_from_int (0));
}
} else {
m->set_property ("alteration", scm_from_int (0));
}
;; TODO: make into markup.
;;
(define-public (alteration->text-accidental-markup alteration)
;; TODO: make into markup.
;;
(define-public (alteration->text-accidental-markup alteration)
(make-smaller-markup
(make-raise-markup
(if (= alteration FLAT)
(make-smaller-markup
(make-raise-markup
(if (= alteration FLAT)