]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
release: 1.5.19
[lilypond.git] / lily / include / music.hh
1 /*
2   music.hh -- declare Music
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10
11 #ifndef MUSIC_HH
12 #define MUSIC_HH
13
14 #include "virtual-methods.hh"
15 #include "minterval.hh"
16 #include "lily-proto.hh"
17 #include "string.hh"
18 #include "smobs.hh"
19 #include "music-constructor.hh"
20
21
22 #define get_mus_property(x) internal_get_mus_property(ly_symbol2scm(x))
23 #define set_mus_property(x,y) internal_set_mus_property(ly_symbol2scm (x), y)
24
25 /** Music is anything that has duration and supports both time compression and
26   transposition.
27   
28   In Lily, everything that can be thought to have a length and a pitch
29  (which has a duration which can be transposed) is considered "music",
30
31   Music is hierarchical: 
32
33   @see Music_sequence
34
35
36   TODO: make a equalp function for general music. 
37   */
38 class Music {
39 public:
40   Input *origin () const; 
41   void set_spot (Input);  
42
43   SCM internal_get_mus_property (SCM) const;
44   void internal_set_mus_property (SCM , SCM val);
45 #if 0
46   void set_immutable_mus_property (const char * , SCM val);
47   void set_immutable_mus_property (SCM key, SCM val);
48
49   SCM remove_mus_property (const char* nm);
50 #endif
51
52
53   virtual Pitch to_relative_octave (Pitch);
54
55   /// The duration of this piece of music
56   virtual Moment length_mom () const;
57   virtual Moment start_mom () const;
58   void print () const;
59   /// Transpose, with the interval central C to #p#
60   virtual void transpose (Pitch p);
61
62   /// Scale the music in time by #factor#.
63   virtual void compress (Moment factor);
64   VIRTUAL_COPY_CONS (Music);
65   Music ();
66   Music (Music const &m);
67   Music (SCM);
68 protected:
69   DECLARE_SMOBS (Music,);
70   SCM immutable_property_alist_;
71   SCM mutable_property_alist_;
72 };
73
74
75 DECLARE_UNSMOB(Music,music);
76 #endif // MUSIC_HH
77
78
79