2 pitch.hh -- declare Pitch
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef MUSICAL_PITCH_HH
11 #define MUSICAL_PITCH_HH
13 #include "lily-proto.hh"
16 /** A "tonal" pitch. This is a pitch as it figures in diatonal western
17 music (12 semitones in an octave), as opposed to a frequence in Hz
18 or a integer number of semitones.
25 TODO: use SCM -- (make private?)
31 /// 0 natural, 1 sharp, etc
39 void transpose (Pitch);
45 int octave_i () const;
46 int notename_i () const;
47 int alteration_i () const;
51 Pitch is lexicographically ordered by (octave, notename,
54 Pitch (int octave, int notename,int accidental);
57 Pitch to_relative_octave (Pitch);
59 static int compare (Pitch const&,Pitch const&);
60 /// return large part of interval from central c
62 /// return pitch from central c (in halfnotes)
63 int semitone_pitch () const;
66 static SCM transpose (SCM p, SCM delta);
68 SCM smobbed_copy () const;
69 DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
70 DECLARE_SIMPLE_SMOBS (Pitch,);
75 DECLARE_UNSMOB(Pitch,pitch);
78 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
80 int compare (Array<Pitch>*, Array<Pitch>*);
82 #endif /* MUSICAL_PITCH_HH */