2 inputmusic.hh -- part of LilyPond
4 (c) 1996 Han-Wen Nienhuys
14 struct Voice_list : public PointerList<Voice*> {
15 void translate_time(Real dt);
18 /// ABC for input structures
20 virtual Voice_list convert()=0;
21 virtual Real length()=0;
22 virtual void translate_time(Real dt)=0;
23 virtual ~Input_music(){}
24 virtual void print() const =0;
25 // virtual void transpose(...) const =0;
28 virtual Input_music *clone() const = 0;
29 virtual Simple_music *simple() { return 0; }
33 Input_music is anything that can simply be regarded as/converted to
34 a set of voices "cooperating" or independant. It has some basic
35 characteristics that real music has too:
37 - it is rhythmic (it has a length, and can be translated horizontally)
38 - a pitch (it can be transposed)
43 /// Simple music consists of one voice
44 struct Simple_music : Input_music {
48 virtual Simple_music*simple() { return this; }
49 void add(Voice_element*);
50 virtual Real length();
51 virtual Voice_list convert();
52 virtual void translate_time(Real dt);
53 virtual void print() const;
54 virtual Input_music *clone() const {
55 return new Simple_music(*this);
60 /// Complex_music consists of multiple voices
61 struct Complex_music : Input_music {
62 IPointerList<Input_music*> elts;
64 void add(Input_music*);
66 Complex_music(Complex_music const &);
67 virtual void print() const ;
68 void concatenate(Complex_music*);
72 /// multiple stuff after each other
73 struct Music_voice : Complex_music {
78 virtual void translate_time(Real dt);
79 virtual Voice_list convert();
80 void add_elt(Voice_element*);
81 virtual Input_music *clone() const {
82 return new Music_voice(*this);
84 virtual void print() const ;
89 different music forms which start after each other ( concatenated,
90 stacked "horizontally )
94 /// Multiple musicstuff stacked on top of each other
95 struct Music_general_chord : Complex_music {
96 IPointerList<Input_music*> chord_;
100 virtual Real length();
101 virtual Voice_list convert();
102 virtual void translate_time(Real dt);
103 void add_elt(Voice_element*);
104 virtual Input_music *clone() const {
105 return new Music_general_chord(*this);
108 virtual void print() const ;
113 - different music forms which start at the same time ( stacked "vertically" )
119 #endif // INPUTMUSIC_HH