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;
50 Pitch is lexicographically ordered by (octave, notename,
53 Pitch (int octave, int notename,int accidental);
56 Pitch to_relative_octave (Pitch);
58 static int compare (Pitch const&,Pitch const&);
59 /// return large part of interval from central c
61 /// return pitch from central c (in halfnotes)
62 int semitone_pitch() const;
65 static SCM transpose (SCM p, SCM delta);
67 SCM smobbed_copy () const;
68 DECLARE_SCHEME_CALLBACK(less_p, (SCM a, SCM b));
69 DECLARE_SIMPLE_SMOBS(Pitch,);
74 Pitch* unsmob_pitch (SCM);
77 INSTANTIATE_COMPARE(Pitch, Pitch::compare);
79 int compare (Array<Pitch>*, Array<Pitch>*);
81 #endif /* MUSICAL_PITCH_HH */