]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pitch-scheme.cc
ly:format, a custom routine for formatting output.
[lilypond.git] / lily / pitch-scheme.cc
index 16b78e9420348422935fb6cba17ed3a505389de2..440df366ebe68a7175b412bbfc09a010426e0326 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "pitch.hh"
@@ -40,6 +40,15 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
   return p.smobbed_copy ();
 }
 
+LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0,
+          (SCM p),
+          "Negate @var{p}.")
+{
+  Pitch *pp = unsmob_pitch (p);
+  SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
+  return pp->negated ().smobbed_copy ();
+}
+
 LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
           (SCM p),
           "Number of steps counted from middle C of the pitch @var{p}.")