2 musical-pitch.hh -- declare Musical_pitch
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef MUSICAL_PITCH_HH
11 #define MUSICAL_PITCH_HH
13 #include "lily-proto.hh"
15 #include "lily-guile.hh" // we need SCM
17 /** A "tonal" pitch. This is a pitch as it figures in diatonal western
18 music (12 semitones in an octave), as opposed to a frequence in Hz
19 or a integer number of semitones.
21 It is not Music because, it has no duration associated.
23 struct Musical_pitch : public Input
25 Musical_pitch (int notename=0, int accidental=0, int octave=0);
29 /// 0 natural, 1 sharp, etc
34 Musical_pitch to_relative_octave (Musical_pitch);
35 void transpose (Musical_pitch);
36 static int compare (Musical_pitch const&,Musical_pitch const&);
37 /// return large part of interval from central c
39 /// return pitch from central c (in halfnotes)
40 int semitone_pitch() const;
47 SCM to_scm (Musical_pitch p);
48 void scm_to (SCM s, Musical_pitch* p);
51 INSTANTIATE_COMPARE(Musical_pitch, Musical_pitch::compare);
53 #endif /* MUSICAL_PITCH_HH */