- {
- if (accidentals_[i].done_)
- continue;
- accidentals_[i].done_ = true;
-
- Stream_event *note = accidentals_[i].melodic_;
- Context *origin = accidentals_[i].origin_;
-
- Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
- if (!pitch)
- continue;
-
- Accidental_result acc = check_pitch_against_rules (*pitch, origin,
- accidental_rules, barnum);
- Accidental_result caut = check_pitch_against_rules (*pitch, origin,
- cautionary_rules, barnum);
-
- bool cautionary = to_boolean (note->get_property ("cautionary"));
- if (caut.score () > acc.score ())
- {
- acc.need_acc |= caut.need_acc;
- acc.need_restore |= caut.need_restore;
-
- cautionary = true;
- }
-
- bool forced = to_boolean (note->get_property ("force-accidental"));
- if (!acc.need_acc && forced)
- acc.need_acc = true;
-
- /* Cannot look for ties: it's not guaranteed that they reach
- us before the notes. */
- if (!note->in_event_class ("trill-span-event"))
- {
- if (acc.need_acc)
- create_accidental (&accidentals_[i], acc.need_restore, cautionary);
-
- if (forced || cautionary)
- accidentals_[i].accidental_->set_property ("forced", SCM_BOOL_T);
- }
- }
+ {
+ if (accidentals_[i].done_)
+ continue;
+ accidentals_[i].done_ = true;
+
+ Stream_event *note = accidentals_[i].melodic_;
+ Context *origin = accidentals_[i].origin_;
+
+ Pitch *pitch = unsmob<Pitch> (note->get_property ("pitch"));
+ if (!pitch)
+ continue;
+
+ Accidental_result acc = check_pitch_against_rules (*pitch, origin, accidental_rules,
+ barnum, measure_position);
+ Accidental_result caut = check_pitch_against_rules (*pitch, origin, cautionary_rules,
+ barnum, measure_position);
+
+ bool cautionary = to_boolean (note->get_property ("cautionary"));
+ if (caut.score () > acc.score ())
+ {
+ acc.need_acc |= caut.need_acc;
+ acc.need_restore |= caut.need_restore;
+
+ cautionary = true;
+ }
+
+ bool forced = to_boolean (note->get_property ("force-accidental"));
+ if (!acc.need_acc && forced)
+ acc.need_acc = true;
+
+ /*
+ Cannot look for ties: it's not guaranteed that they reach
+ us before the notes.
+ */
+ if (!note->in_event_class ("trill-span-event"))
+ {
+ if (acc.need_acc)
+ create_accidental (&accidentals_[i], acc.need_restore, cautionary);
+
+ if (forced || cautionary)
+ accidentals_[i].accidental_->set_property ("forced", SCM_BOOL_T);
+ }
+ }