2 pitch.hh -- declare Pitch
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2002 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
17 music (12 semitones in an octave), as opposed to a frequency in Hz
18 or a 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
28 - abstract out the representation of alteration_, so we can
29 put micropitches (quartertones, etc.) in the Pitch object
41 /// 0 natural, 1 sharp, etc
47 void transpose (Pitch);
54 int get_octave () const;
55 int get_notename () const;
56 int get_alteration () const;
58 Pitch (int octave, int notename,int accidental);
61 Pitch transposed (Pitch) const;
62 Pitch to_relative_octave (Pitch) const;
64 static int compare (Pitch const&,Pitch const&);
65 /// return large part of interval from central c
67 /// return pitch from central c (in halfnotes)
68 int semitone_pitch () const;
69 String string () const;
71 SCM smobbed_copy () const;
72 DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
73 DECLARE_SIMPLE_SMOBS (Pitch,);
76 SCM ly_pitch_transpose (SCM p, SCM delta);
77 DECLARE_UNSMOB(Pitch,pitch);
80 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
82 int compare (Array<Pitch>*, Array<Pitch>*);
83 extern SCM pitch_less_proc;
84 Pitch interval (Pitch const & from , Pitch const & to );
86 #endif /* MUSICAL_PITCH_HH */