2 inputmusic.hh -- part of LilyPond
4 (c) 1996 Han-Wen Nienhuys
15 struct Voice_list : public PointerList<Voice*> {
16 void translate_time(Moment dt);
19 /// ABC for input structures
21 virtual Voice_list convert()=0;
22 virtual Moment length()=0;
23 virtual void translate_time(Moment dt)=0;
24 virtual ~Input_music(){}
25 virtual void print() const =0;
26 // virtual void transpose(...) const =0;
29 virtual Input_music *clone() const = 0;
30 virtual Simple_music *simple() { return 0; }
34 Input_music is anything that can simply be regarded as/converted to
35 a set of voices "cooperating" or independant. It has some basic
36 characteristics that real music has too:
38 - it is rhythmic (it has a length, and can be translated horizontally)
39 - a pitch (it can be transposed)
44 /// Simple music consists of one voice
45 struct Simple_music : Input_music {
49 virtual Simple_music*simple() { return this; }
50 void add(Voice_element*);
51 virtual Moment length();
52 virtual Voice_list convert();
53 virtual void translate_time(Moment dt);
54 virtual void print() const;
55 virtual Input_music *clone() const {
56 return new Simple_music(*this);
61 /// Complex_music consists of multiple voices
62 struct Complex_music : Input_music {
63 IPointerList<Input_music*> elts;
65 void add(Input_music*);
67 Complex_music(Complex_music const &);
68 virtual void print() const ;
69 void concatenate(Complex_music*);
73 /// multiple stuff after each other
74 struct Music_voice : Complex_music {
79 virtual void translate_time(Moment dt);
80 virtual Voice_list convert();
81 void add_elt(Voice_element*);
82 virtual Input_music *clone() const {
83 return new Music_voice(*this);
85 virtual void print() const ;
90 different music forms which start after each other ( concatenated,
91 stacked "horizontally )
95 /// Multiple musicstuff stacked on top of each other
96 struct Music_general_chord : Complex_music {
97 IPointerList<Input_music*> chord_;
101 virtual Moment length();
102 virtual Voice_list convert();
103 virtual void translate_time(Moment dt);
104 void add_elt(Voice_element*);
105 virtual Input_music *clone() const {
106 return new Music_general_chord(*this);
109 virtual void print() const ;
114 - different music forms which start at the same time ( stacked "vertically" )
120 #endif // INPUTMUSIC_HH