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);
22 Input_music is anything that can simply be regarded as/converted to
23 a set of voices "cooperating" or independant. It has some basic
24 characteristics that real music has too:
26 - it is rhythmic (it has a length, and can be translated horizontally)
27 - a pitch (it can be transposed)
31 virtual Voice_list convert()const=0;
32 virtual Moment length()const=0;
33 virtual void translate_time(Moment dt)=0;
34 virtual ~Input_music(){}
35 virtual void print() const =0;
36 virtual void set_default_group(String)=0;
37 // virtual void transpose(...) const =0;
40 virtual Input_music *clone() const = 0;
41 virtual Simple_music *simple() { return 0; }
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 void set_default_group(String g) { voice_.set_default_group(g); }
52 virtual Moment length()const;
53 virtual Voice_list convert()const;
54 virtual void translate_time(Moment dt);
55 virtual void print() const;
56 virtual Input_music *clone() const {
57 return new Simple_music(*this);
62 /// Complex_music consists of multiple voices
63 struct Complex_music : Input_music {
64 IPointerList<Input_music*> elts;
66 virtual void set_default_group(String g);
67 void add(Input_music*);
69 Complex_music(Complex_music const &);
70 virtual void print() const ;
71 void concatenate(Complex_music*);
77 A voice like list of music.
79 different music forms which start after each other ( concatenated,
80 stacked "horizontally )
84 struct Music_voice : Complex_music {
89 virtual void translate_time(Moment dt);
90 virtual Voice_list convert()const;
91 void add_elt(Voice_element*);
92 virtual Input_music *clone() const {
93 return new Music_voice(*this);
95 virtual void print() const ;
99 Multiple musicstuff stacked on top of each other
102 - different music forms which start at the same time ( stacked "vertically" )
105 struct Music_general_chord : Complex_music {
108 /* *************** */
110 virtual Moment length()const;
111 virtual Voice_list convert()const;
112 virtual void translate_time(Moment dt);
113 void add_elt(Voice_element*);
114 virtual Input_music *clone() const {
115 return new Music_general_chord(*this);
118 virtual void print() const ;
121 struct Multi_voice_chord : Music_general_chord {
122 void set_default_group(String);
123 virtual Input_music *clone() const {
124 return new Multi_voice_chord(*this);
127 struct Voice_group_chord : Music_general_chord {
129 virtual Input_music *clone() const {
130 return new Voice_group_chord(*this);
133 #endif // INPUTMUSIC_HH