- SCM localsig = trans_->get_property ("localKeySignature");
- if (tie_changes)
- {
- /*
- Remember an alteration that is different both from
- that of the tied note and of the key signature.
- */
- localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
- }
- else
- {
- /*
- not really really correct if there are more than one
- noteheads with the same notename.
- */
- localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (gh_int2scm (a), barnum));
- }
- trans_->set_property ("localKeySignature", localsig);
- trans_ = trans_->daddy_trans_l_;
+ /*
+ We construct the accidentals at the originating Voice
+ level, so that we get the property settings for
+ Accidental from the respective Voice.
+ */
+ Grob *a
+ = make_item_from_properties (accidentals_[i].origin_trans_,
+ ly_symbol2scm ("Accidental"),
+ note->self_scm (),
+ "Accidental");
+ a->set_parent (support, Y_AXIS);
+
+ if (!accidental_placement_)
+ accidental_placement_ = make_item ("AccidentalPlacement",
+ a->self_scm ());
+ Accidental_placement::add_accidental (accidental_placement_, a);
+ SCM accs = scm_cons (scm_int2num (pitch->get_alteration ()),
+ SCM_EOL);
+ if (num == 2 && extra_natural_b)
+ accs = scm_cons (scm_int2num (0), accs);
+
+ /* TODO: add cautionary option in accidental. */
+
+ if (cautionary)
+ a->set_property ("cautionary", SCM_BOOL_T);
+
+ support->set_property ("accidental-grob", a->self_scm ());
+
+ a->set_property ("accidentals", accs);
+ accidentals_[i].accidental_ = a;
+
+ /*
+ We add the accidentals to the support of the arpeggio,
+ so it is put left of the accidentals.
+ */
+ for (int i = 0; i < left_objects_.size (); i++)
+ Side_position_interface::add_support (left_objects_[i], a);
+ for (int i = 0; i < right_objects_.size (); i++)
+ Side_position_interface::add_support (a, right_objects_[i]);