+ {
+ SCM bass = SCM_EOL;
+ SCM inversion = SCM_EOL;
+ SCM pitches = SCM_EOL;
+
+ Stream_event *inversion_event = 0;
+ for (vsize i = 0; i < notes_.size (); i++)
+ {
+ Stream_event *n = notes_[i];
+ SCM p = n->get_property ("pitch");
+ if (!unsmob_pitch (p))
+ continue;
+
+ if (n->get_property ("inversion") == SCM_BOOL_T)
+ {
+ inversion_event = n;
+ inversion = p;
+ }
+ else if (n->get_property ("bass") == SCM_BOOL_T)
+ bass = p;
+ else
+ pitches = scm_cons (p, pitches);
+ }
+
+ if (inversion_event)
+ {
+ SCM oct = inversion_event->get_property ("octavation");
+ if (scm_is_number (oct))
+ {
+ Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
+ int octavation = scm_to_int (oct);
+ Pitch orig = p->transposed (Pitch (-octavation, 0, 0));
+
+ pitches = scm_cons (orig.smobbed_copy (), pitches);
+ }
+ else
+ programming_error ("inversion does not have original pitch");
+ }
+
+ pitches = scm_sort_list (pitches, Pitch::less_p_proc);
+
+ SCM name_proc = get_property ("chordNameFunction");
+ if (make_markup)
+ markup = scm_call_4 (name_proc, pitches, bass, inversion,
+ context ()->self_scm ());
+ }
+ /*
+ Ugh.
+ */
+ if (make_markup)
+ chord_name_->set_property ("text", markup);
+ else if (Text_interface::is_markup (maybe_markup))
+ markup = maybe_markup;
+
+ SCM chord_changes = get_property ("chordChanges");
+ if (to_boolean (chord_changes) && scm_is_pair (last_chord_)
+ && ly_is_equal (markup, last_chord_))
+ chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
+
+ last_chord_ = markup;