]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/musical-pitch.cc
release: 1.3.38
[lilypond.git] / lily / musical-pitch.cc
index df668d2115609a3f97a1ef2fda1d651b24cd7c17..dfc0614e4a93d3a4c6d8049b3e2856298f142ef6 100644 (file)
@@ -3,26 +3,42 @@
   
   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
 }
 
@@ -100,7 +116,7 @@ Musical_pitch::str () const
     {
       int o = octave_i_ + 1;
       while (o--)
-       s += to_str ('\'');
+       s += "'";
     }
   else if (octave_i_ <0)
     {
@@ -108,11 +124,8 @@ Musical_pitch::str () const
       while (o--)
        s += to_str (',');
     }
-#if 0  
-  if (octave_i_)
-    s  += String ((octave_i_> 0)? "^": "_") + to_str (octave_i_);
-#endif
-  
+
+
   return s;
 }