source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "musical-pitch.hh"
#include "debug.hh"
#include "main.hh"
-Musical_pitch::Musical_pitch (int n, int a, int o, bool c)
+SCM
+Musical_pitch::to_scm ()const
+{
+ return gh_list (gh_int2scm (notename_i_),
+ gh_int2scm (accidental_i_),
+ gh_int2scm (octave_i_),
+ SCM_UNDEFINED);
+}
+
+
+Musical_pitch::Musical_pitch (SCM s)
+{
+ notename_i_ = gh_scm2int (gh_car (s));
+ accidental_i_ = gh_scm2int (gh_cadr (s));
+ octave_i_ = gh_scm2int (gh_caddr (s));
+}
+
+Musical_pitch::Musical_pitch (int n, int a, int o)
{
notename_i_ = n;
accidental_i_ = a;
octave_i_ = o;
- cautionary_b_ = c;
}
void
Musical_pitch::print () const
{
#ifndef NPRINT
- DOUT << str ();
+ DEBUG_OUT << str ();
#endif
}
{
int o = octave_i_ + 1;
while (o--)
- s += to_str ('\'');
+ s += "'";
}
else if (octave_i_ <0)
{
while (o--)
s += to_str (',');
}
-#if 0
- if (octave_i_)
- s += String ((octave_i_> 0)? "^": "_") + to_str (octave_i_);
-#endif
-
+
+
return s;
}