]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/event.cc
* lily/spacing-engraver.cc (finalize): robustifications.
[lilypond.git] / lily / event.cc
index 85a94725917cbec2baadb4f806305a481e270355..ed0a826c697c235ddf4567fcf0f79099ec59e8fd 100644 (file)
@@ -44,7 +44,7 @@ Event::transpose (Pitch delta)
 
   Pitch np = p->transposed (delta);
   
-  if (abs (np.get_alteration ()) > 2)
+  if (abs (np.get_alteration ()) > DOUBLE_SHARP)
     {
        warning (_f ("Transposition by %s makes alteration larger than two",
          delta.to_string ()));
@@ -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;