normalise ();
}
+/* FIXME: why is octave == 0 and default not middleC ? */
Pitch::Pitch ()
{
notename_ = 0;
}
/* Should add optional args. */
-LY_DEFINE (make_pitch, "ly:make-pitch",
+LY_DEFINE (ly_make_pitch, "ly:make-pitch",
3, 0, 0, (SCM octave, SCM note, SCM alter),
"@var{octave} is specified by an integer, "
"zero for the octave containing middle C. "
SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
- Pitch p (ly_scm2int (octave), ly_scm2int (note), ly_scm2int (alter));
+ Pitch p (scm_to_int (octave), scm_to_int (note), scm_to_int (alter));
return p.smobbed_copy ();
}
-LY_DEFINE (pitch_steps, "ly:pitch-steps", 1, 0, 0,
+LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
(SCM p),
"Number of steps counted from middle C of the pitch @var{p}.")
{
return scm_int2num (pp->steps ());
}
-LY_DEFINE (pitch_octave, "ly:pitch-octave",
+LY_DEFINE (ly_pitch_octave, "ly:pitch-octave",
1, 0, 0, (SCM pp),
"Extract the octave from pitch @var{p}.")
{
return scm_int2num (q);
}
-LY_DEFINE (pitch_alteration, "ly:pitch-alteration",
+LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration",
1, 0, 0, (SCM pp),
"Extract the alteration from pitch @var{p}.")
{
return scm_int2num (q);
}
-LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
+LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
1, 0, 0, (SCM pp),
"Calculate the number of quarter tones of @var{p} from middle C.")
{
return scm_int2num (q);
}
-LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
+LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
1, 0, 0, (SCM pp),
"calculate the number of semitones of @var{p} from middle C.")
{
return scm_int2num (q);
}
-LY_DEFINE (pitch_less, "ly:pitch<?",
+LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} lexicographically smaller than @var{p2}?")
{
return interval (*r, *p).smobbed_copy ();
}
-
int
-Pitch::get_octave ()const
+Pitch::get_octave () const
{
return octave_;
}