- SCM f = get_property ("forgetAccidentals",0);
- bool forget = to_boolean (f);
- for (int i=0; i < mel_l_arr_.size(); i++)
+ SCM localsig = get_property ("localKeySignature");
+
+ for (int i=0; i < mel_l_arr_.size(); i++)
+ {
+ Grob * support_l = support_l_arr_[i];
+ Note_req * note_l = mel_l_arr_[i];
+
+ int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
+ int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
+ int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
+
+ /* see if there's a tie that "changes" the accidental */
+ /* works because if there's a tie, the note to the left
+ is of the same pitch as the actual note */
+
+ SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), localsig);
+ if (prev == SCM_BOOL_F)
+ prev = scm_assoc (gh_int2scm (n), localsig);
+ SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm(0) : gh_cdr (prev);
+ bool different = !gh_equal_p(prev_acc , gh_int2scm(a));
+ int p = gh_number_p(prev_acc) ? gh_scm2int(prev_acc) : 0;
+
+ bool tie_changes = tied_l_arr_.find_l (support_l) && different;
+ if ((to_boolean (note_l->get_mus_property ("force-accidental"))
+ || different) && !tie_changes)