2 inputmusic.hh -- part of LilyPond
4 (c) 1996 Han-Wen Nienhuys
13 struct Voice_list : public PointerList<Voice*> {
14 void translate_time(Real dt);
15 /// delete stuff; not in destructor!
19 /// ABC for input structures
21 virtual Voice_list convert()=0;
22 virtual Real length()=0;
23 virtual void translate_time(Real dt)=0;
24 virtual ~Input_music();
25 virtual void print() const =0;
26 // virtual void transpose(...) const =0;
30 Input_music is anything that can simply be regarded as/converted to
31 a set of voices "cooperating" or independant. It has some basic
32 characteristics that real music has too:
34 - it is rhythmic (it has a length, and can be translated horizontally)
35 - a pitch (it can be transposed)
42 struct Vertical_music : Input_music {
43 virtual Vertical_music *clone() const = 0;
45 /// check if it is a simple voice
46 virtual Vertical_simple *simple() { return 0;}
51 - different music forms which start at the same time ( stacked "vertically" )
53 This class really doesn't do very much, but it enables you to say
55 a Music_voice is a List<Vertical_music>
60 struct Horizontal_music : Input_music {
61 virtual Voice_list convert()=0;
62 virtual Horizontal_music *clone() const = 0;
67 different music forms which start after each other ( concatenated,
68 stacked "horizontally )
70 This class really doesn't do very much, but it enables you to say
72 a Chord is a List<Horizontal_music>
76 /// the most basic element of a chord: a simple voice
77 struct Vertical_simple : Vertical_music {
78 Voice * voice_; // should be a real member
81 Vertical_simple(Vertical_simple const&);
84 void add(Voice_element*);
85 virtual Vertical_simple*simple() { return this; }
86 virtual Real length();
87 virtual Voice_list convert();
88 virtual void translate_time(Real dt);
89 virtual Vertical_music *clone() const {
90 return new Vertical_simple(*this);
92 virtual void print() const ;
95 /// the only child of Horizontal_music
96 struct Music_voice : Horizontal_music {
97 IPointerList<Vertical_music*> voice_ ;
101 Music_voice(Music_voice const&);
103 void add(Vertical_music*);
104 void add(Voice_element*);
105 virtual Voice_list convert();
106 virtual void translate_time(Real dt);
107 virtual Horizontal_music *clone() const {
108 return new Music_voice(*this);
110 void concatenate(Music_voice*);
111 virtual void print() const ;
114 struct Music_general_chord : Vertical_music {
115 IPointerList<Horizontal_music*> chord_;
118 Music_general_chord() {}
119 Music_general_chord(Music_general_chord const&s);
120 void add(Horizontal_music*);
121 virtual Real length();
122 virtual Voice_list convert();
123 virtual void translate_time(Real dt);
124 virtual Vertical_music *clone() const {
125 return new Music_general_chord(*this);
127 void concatenate(Music_general_chord*);
128 virtual void print() const ;
132 #endif // INPUTMUSIC_HH