2 pitch.hh -- declare Pitch
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #ifndef MUSICAL_PITCH_HH
10 #define MUSICAL_PITCH_HH
12 #include "lily-proto.hh"
15 /** A "tonal" pitch. This is a pitch used in diatonal western music
16 (24 quartertones in an octave), as opposed to a frequency in Hz or a
17 integer number of semitones.
19 Pitch is lexicographically ordered by (octave, notename,
25 - add indeterminate octaves, so it can be used as a key in keySigature
38 void transpose (Pitch);
45 int get_octave () const;
46 int get_notename () const;
47 int get_alteration () const;
49 Pitch (int octave, int notename, int accidental);
52 Pitch transposed (Pitch) const;
53 Pitch to_relative_octave (Pitch) const;
55 static int compare (Pitch const &, Pitch const &);
58 int semitone_pitch () const;
59 int quartertone_pitch () const;
60 String to_string () const;
62 DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
63 DECLARE_SIMPLE_SMOBS (Pitch,);
79 SCM ly_pitch_diff (SCM pitch, SCM root);
80 SCM ly_pitch_transpose (SCM p, SCM delta);
81 DECLARE_UNSMOB (Pitch, pitch);
83 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
85 int compare (Array<Pitch> *, Array<Pitch> *);
86 extern SCM pitch_less_proc;
87 Pitch pitch_interval (Pitch const &from, Pitch const &to);
89 #endif /* MUSICAL_PITCH_HH */