- SCM nm = m->get_property ("name");
- if (ly_c_symbol_p (nm) || ly_c_string_p (nm))
- scm_display (nm, p);
- else
- scm_puts (classname (m),p);
+Pitch
+Music::generic_to_relative_octave (Pitch last)
+{
+ SCM elt = get_property ("element");
+ Pitch *old_pit = unsmob_pitch (get_property ("pitch"));
+ if (old_pit)
+ {
+ Pitch new_pit = *old_pit;
+ new_pit = new_pit.to_relative_octave (last);
+
+ SCM check = get_property ("absolute-octave");
+ if (scm_is_number (check)
+ && new_pit.get_octave () != scm_to_int (check))
+ {
+ Pitch expected_pit (scm_to_int (check),
+ new_pit.get_notename (),
+ new_pit.get_alteration ());
+ origin ()->warning (_f ("octave check failed; expected \"%s\", found: \"%s\"",
+ expected_pit.to_string (),
+ new_pit.to_string ()));
+ new_pit = expected_pit;
+ }
+
+ set_property ("pitch", new_pit.smobbed_copy ());
+
+ last = new_pit;
+ }