/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "music.hh"
#include "duration.hh"
+#include "program-option.hh"
#include "warn.hh"
LY_DEFINE (ly_music_length, "ly:music-length",
LY_DEFINE (ly_event_p, "ly:event?",
1, 0, 0, (SCM obj),
- "Is @var{obj} an event object?")
+ "Is @var{obj} a proper (non-rhythmic) event object?")
{
if (Music *m = unsmob_music (obj))
{
- return scm_from_bool (m->is_mus_type ("event"));
+ return scm_from_bool (m->is_mus_type ("post-event"));
}
return SCM_BOOL_F;
}
return sc->self_scm ();
}
+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);
+ if (lily_1_8_relative)
+ m->set_property ("last-pitch", last.smobbed_copy ());
+
+ return last.smobbed_copy ();
+}
+
LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0,
(SCM mus),
"Extract the duration field from @var{mus} and return the"