- Atom a =paper()->lookup_l ()->accidental (acc[i]);
- a.translate ((c_position + pitch[i]) * inter, Y_AXIS);
- Molecule m (a);
- output->add_at_edge (X_AXIS, RIGHT, m);
+ for (int i =0; i < old_pitch_arr_.size(); i++)
+ {
+ for (j =0; (j < pitch_arr_.size())
+ && (old_pitch_arr_[i] != pitch_arr_[j]); j++)
+ ;
+
+ if (j == pitch_arr_.size()
+ || (old_pitch_arr_[i] == pitch_arr_[j]
+ && old_acc_arr_[i] != acc_arr_[j]))
+ {
+ Molecule m =lookup_l ()->afm_find ("accidentals-0");
+
+ m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS);
+ mol.add_at_edge (X_AXIS, RIGHT, m,0);
+ }
+ }
+
+ /*
+ Add half a space between cancellation and key sig.
+
+ As suggested by [Ross], p.148.
+ */
+ Interval x(0, inter);
+ Interval y(0,0);
+
+ mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0);