2 pitch.hh -- declare Pitch
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2005 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 used in diatonal western music
17 (24 quartertones in an octave), as opposed to a frequency in Hz or a
18 integer number of semitones.
20 Pitch is lexicographically ordered by (octave, notename,
26 - add indeterminate octaves, so it can be used as a key in keySigature
40 void transpose (Pitch);
47 int get_octave () const;
48 int get_notename () const;
49 int get_alteration () const;
51 Pitch (int octave, int notename, int accidental);
54 Pitch transposed (Pitch) const;
55 Pitch to_relative_octave (Pitch) const;
57 static int compare (Pitch const&, Pitch const&);
60 int semitone_pitch () const;
61 int quartertone_pitch () const;
62 String to_string () const;
64 DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
65 DECLARE_SIMPLE_SMOBS (Pitch, );
80 SCM ly_pitch_diff (SCM pitch, SCM root);
81 SCM ly_pitch_transpose (SCM p, SCM delta);
82 DECLARE_UNSMOB(Pitch, pitch);
84 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
86 int compare (Array<Pitch>*, Array<Pitch>*);
87 extern SCM pitch_less_proc;
88 Pitch pitch_interval (Pitch const & from , Pitch const & to );
90 #endif /* MUSICAL_PITCH_HH */