2 relative-octave-check.cc -- implement Relative_octave_check
4 source file of the GNU LilyPond music typesetter
6 (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "relative-octave-check.hh"
16 Relative_octave_check::to_relative_octave (Pitch p)
18 Pitch * check_p = unsmob_pitch (get_property ("pitch"));
24 check_p->get_notename (),
25 check_p->get_alteration ());
27 Pitch result = no_octave.to_relative_octave (p);
29 if (result != *check_p)
31 String s = _("Failed octave check, got: ");
32 s += result.to_string ();
34 origin ()->warning (s);
36 delta_oct = check_p->get_octave () - result.get_octave ();
40 return Pitch (p.get_octave () + delta_oct,
41 p.get_notename (), p.get_alteration ());
45 Relative_octave_check::Relative_octave_check (SCM x)
50 ADD_MUSIC (Relative_octave_check);