]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/event.cc
2003 -> 2004
[lilypond.git] / lily / event.cc
index 75948dac04d13e376988b7d4b7b23346c2f1a83d..dc2ca4b32826201068be5322f549973e4139910b 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "event.hh"
@@ -61,6 +61,22 @@ Event::to_relative_octave (Pitch last)
     {
       Pitch new_pit = *old_pit;
       new_pit = new_pit.to_relative_octave (last);
+
+      SCM check = get_mus_property ("absolute-octave");
+      if (gh_number_p (check) &&
+         new_pit.get_octave () != gh_scm2int (check))
+       {
+         String s =_("Failed octave check, got: ");
+         s += new_pit.to_string ();
+         new_pit = Pitch (gh_scm2int (check),
+                          new_pit.get_notename (),
+                          new_pit.get_alteration ());
+
+         s += " expected ";
+         s += new_pit.to_string ();
+         origin ()->warning (s);
+       }
+      
       set_mus_property ("pitch", new_pit.smobbed_copy ());
   
       return new_pit;