2 #include "inputmusic.hh"
5 Vertical_simple::Vertical_simple()
9 Vertical_simple::Vertical_simple(Vertical_simple const&s)
11 voice_ = new Voice(*s.voice_);
14 Vertical_simple::add(Voice_element*v)
20 Vertical_simple::length()
22 return voice_->last();
25 Vertical_simple::translate_time(Real t)
31 Vertical_simple::convert()
34 l.bottom().add(new Voice(*voice_));
38 Vertical_simple::~Vertical_simple()
44 Vertical_simple::print() const
46 mtor << "Vertical_simple {";
53 Music_voice::print() const
55 mtor << "Music_voice {";
56 for (PCursor<Vertical_music*> i(voice_); i.ok(); i++)
62 Music_voice::concatenate(Music_voice*h)
64 for (PCursor<Vertical_music*> i(h->voice_); i.ok(); i++)
69 Music_voice::Music_voice(Music_voice const&s)
71 for (PCursor<Vertical_music*> i(s.voice_); i.ok(); i++)
76 Music_voice::add(Voice_element*v)
78 PCursor<Vertical_music*> c(voice_.bottom());
79 if (!c.ok() || !c->simple()) {
80 Vertical_simple*vs = new Vertical_simple;
86 Vertical_simple *s = c->simple();
91 Music_voice::add(Vertical_music*v)
93 voice_.bottom().add(v);
101 for (PCursor<Vertical_music*> i(voice_); i.ok(); i++)
108 Music_voice::convert()
113 for (PCursor<Vertical_music*> i(voice_); i.ok(); i++) {
114 Real len = i->length();
115 Voice_list k(i->convert());
116 k.translate_time(here);
125 Music_voice::translate_time(Real t)
127 for (PCursor<Vertical_music*> i(voice_); i.ok(); i++)
128 i->translate_time(t);
135 Music_general_chord::print() const
137 mtor << "Music_general_chord {";
138 for (PCursor<Horizontal_music*> i(chord_); i.ok(); i++)
144 Music_general_chord::concatenate(Music_general_chord*v)
146 for (PCursor<Horizontal_music*> i(v->chord_); i.ok(); i++)
151 Music_general_chord::translate_time(Real t)
153 for (PCursor<Horizontal_music*> i(chord_); i.ok(); i++)
154 i->translate_time(t);
160 Music_general_chord::length()
164 for (PCursor<Horizontal_music*> i(chord_); i.ok(); i++)
165 l = MAX(l, i->length());
170 Music_general_chord::add(Horizontal_music*h)
172 chord_.bottom().add(h);
176 Music_general_chord::convert()
179 for (PCursor<Horizontal_music*> i(chord_); i.ok(); i++) {
180 Voice_list k(i->convert());
187 Music_general_chord::Music_general_chord(
188 Music_general_chord const & s)
190 for (PCursor<Horizontal_music*> i(s.chord_); i.ok(); i++) {
198 Voice_list::translate_time(Real x)
200 for (PCursor<Voice*> i(*this); i.ok(); i++)
207 for (PCursor<Voice*> i(*this); i.ok(); i++)