+LY_DEFINE (ly_make_music_relative_x, "ly:make-music-relative!",
+ 2, 0, 0, (SCM music, SCM pitch),
+ "Make @var{music} relative to @var{pitch},"
+ " return final pitch.")
+{
+ LY_ASSERT_TYPE (unsmob_music, music, 1);
+ LY_ASSERT_TYPE (unsmob_pitch, pitch, 2);
+
+ Pitch start = *unsmob_pitch (pitch);
+ Music *m = unsmob_music (music);
+ Pitch last = m->to_relative_octave (start);
+
+ return last.smobbed_copy ();
+}
+