]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
* input/regression/quote-cyclic.ly (Module): new file.
[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--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef MUSIC_HH
10 #define MUSIC_HH
11
12 #include "virtual-methods.hh"
13 #include "minterval.hh"
14 #include "lily-proto.hh"
15 #include "string.hh"
16 #include "smobs.hh"
17 #include "music-constructor.hh"
18
19 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
20
21 /** Music is anything that has duration and supports both time compression and
22   transposition.
23   
24   In Lily, everything that can be thought to have a length and a pitch
25  (which has a duration which can be transposed) is considered "music",
26
27   Music is hierarchical: 
28
29   @see Music_sequence
30
31
32   TODO: make a equalp function for general music. 
33   */
34 class Music
35 {
36 public:
37   Music ();
38   Music (Music const &m);
39   VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
40
41   Input *origin () const; 
42   void set_spot (Input);  
43
44   SCM internal_get_property (SCM) const;
45   void internal_set_property (SCM , SCM val);
46   SCM get_property_alist (bool mut) const;
47   bool internal_is_music_type (SCM) const;
48   int duration_log () const;
49   
50   virtual Pitch to_relative_octave (Pitch);
51   String name () const;
52   /// The duration of this piece of music
53   virtual Moment get_length () const;
54   virtual Moment start_mom () const;
55   void print () const;
56   /// Transpose, with the interval central C to #p#
57   virtual void transpose (Pitch p);
58
59   /// Scale the music in time by #factor#.
60   virtual void compress (Moment factor);
61   
62 protected:
63   DECLARE_SMOBS (Music,);
64   SCM immutable_property_alist_;
65   SCM mutable_property_alist_;
66   friend SCM ly_extended_make_music(SCM,SCM);
67 };
68
69 DECLARE_TYPE_P(Music);
70 DECLARE_UNSMOB(Music,music);
71
72 Music* make_music_by_name (SCM sym);
73 SCM ly_deep_mus_copy (SCM);
74 SCM ly_music_scorify (SCM, SCM);
75
76 #endif /* MUSIC_HH */