X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fmusic.hh;h=87b4b93eda7b968552b51bf913ad8153c30d06ba;hb=764c49729f95f421d9d6cc8eee5386706039a2c7;hp=196f461eeb6bd290bdf9a62539f01488ab51e4f8;hpb=6dc4e4d14a67f65f337ec1a06466e748c68dcad5;p=lilypond.git diff --git a/lily/include/music.hh b/lily/include/music.hh index 196f461eeb..87b4b93eda 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--2002 Han-Wen Nienhuys */ @@ -12,35 +12,60 @@ #define MUSIC_HH #include "virtual-methods.hh" -#include "input.hh" #include "minterval.hh" #include "lily-proto.hh" #include "string.hh" +#include "smobs.hh" +#include "music-constructor.hh" -/** In Lily, everything that has a length and a pitch (which can be - transposed) is considered "music", + +#define get_mus_property(x) internal_get_mus_property(ly_symbol2scm(x)) +#define set_mus_property(x,y) internal_set_mus_property(ly_symbol2scm (x), y) + +/** Music is anything that has duration and supports both time compression and + transposition. + + In Lily, everything that can be thought to have a length and a pitch + (which has a duration which can be transposed) is considered "music", Music is hierarchical: - @seealso Music_list + @see Music_sequence + + + TODO: make a equalp function for general music. */ -class Music:public Input { +class Music { public: - Music_list * parent_music_l_; - - virtual MInterval time_int()const; - virtual ~Music(){} - void print() const; - virtual void transpose(Melodic_req const *); - virtual void translate(Moment dt); - VIRTUAL_COPY_CONS(Music,Music); - DECLARE_MY_RUNTIME_TYPEINFO; - Music(); + Input *origin () const; + void set_spot (Input); + + SCM internal_get_mus_property (SCM) const; + void internal_set_mus_property (SCM , SCM val); + + virtual Pitch to_relative_octave (Pitch); + + /// The duration of this piece of music + virtual Moment length_mom () const; + virtual Moment start_mom () const; + void print () const; + /// Transpose, with the interval central C to #p# + virtual void transpose (Pitch p); + + /// Scale the music in time by #factor#. + virtual void compress (Moment factor); + VIRTUAL_COPY_CONS (Music); + Music (); + Music (Music const &m); + Music (SCM); protected: - virtual void do_print() const; - + DECLARE_SMOBS (Music,); + SCM immutable_property_alist_; + SCM mutable_property_alist_; }; + +DECLARE_UNSMOB(Music,music); #endif // MUSIC_HH