2 inputmusic.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
15 struct Voice_list : public PointerList<Voice*> {
16 void translate_time(Moment dt);
21 Input_music is anything that can simply be regarded as/converted to
22 a set of voices "cooperating" or independant. It has some basic
23 characteristics that real music has too:
25 - it is rhythmic (it has a length, and can be translated horizontally)
26 - a pitch (it can be transposed)
32 virtual Voice_list convert()const=0;
33 virtual Moment length()const=0;
34 virtual void translate_time(Moment dt)=0;
35 virtual ~Input_music(){}
36 virtual void print() const =0;
37 virtual void set_default_group(String)=0;
38 // virtual void transpose(...) const =0;
41 virtual Input_music *clone() const = 0;
42 virtual Simple_music *simple() { return 0; }
45 /// Simple music consists of one voice
46 struct Simple_music : Input_music {
50 virtual Simple_music*simple() { return this; }
51 void add(Voice_element*);
52 virtual void set_default_group(String g) { voice_.set_default_group(g); }
53 virtual Moment length()const;
54 virtual Voice_list convert()const;
55 virtual void translate_time(Moment dt);
56 virtual void print() const;
57 virtual Input_music *clone() const {
58 return new Simple_music(*this);
63 /// Complex_music consists of multiple voices
64 struct Complex_music : Input_music {
65 IPointerList<Input_music*> elts;
67 virtual void set_default_group(String g);
68 void add(Input_music*);
70 Complex_music(Complex_music const &);
71 virtual void print() const ;
72 void concatenate(Complex_music*);
80 different music forms which start after each other ( concatenated,
81 stacked "horizontally )
85 struct Music_voice : Complex_music {
90 virtual void translate_time(Moment dt);
91 virtual Voice_list convert()const;
92 void add_elt(Voice_element*);
93 virtual Input_music *clone() const {
94 return new Music_voice(*this);
96 virtual void print() const ;
100 Multiple musicstuff stacked on top of each other
103 - different music forms which start at the same time ( stacked "vertically" )
106 struct Music_general_chord : Complex_music {
109 /* *************** */
111 virtual Moment length()const;
112 virtual Voice_list convert()const;
113 virtual void translate_time(Moment dt);
114 void add_elt(Voice_element*);
115 virtual Input_music *clone() const {
116 return new Music_general_chord(*this);
119 virtual void print() const ;
122 struct Multi_voice_chord : Music_general_chord {
123 void set_default_group(String);
124 virtual Input_music *clone() const {
125 return new Multi_voice_chord(*this);
128 struct Voice_group_chord : Music_general_chord {
130 virtual Input_music *clone() const {
131 return new Voice_group_chord(*this);
134 #endif // INPUTMUSIC_HH