* input/mutopia/F.Schubert/standchen.ly (trebleThrough): fixes
[lilypond.git] / lily / simultaneous-music.cc
blob77c3d89d0670a2a1bd575b61a9f6d04872ffb524
1 #include "input.hh"
2 #include "moment.hh"
3 #include "pitch.hh"
4 #include "music-list.hh"
6 Moment
7 Simultaneous_music::get_length () const
9 return Music_sequence::maximum_length (get_mus_property ("elements"));
12 Moment
13 Simultaneous_music::start_mom () const
15 return Music_sequence::minimum_start (get_mus_property ("elements"));
18 Simultaneous_music::Simultaneous_music()
24 Cut & paste from Music_sequence, (ugh) , but we must add an error
25 message.
27 Pitch
28 Simultaneous_music::to_relative_octave (Pitch p)
30 Pitch first;
31 int count=0;
33 Pitch last = p;
34 for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s))
36 if (Music *m = unsmob_music (ly_car (s)))
38 last = m->to_relative_octave (last);
39 if (!count ++)
40 first = last;
44 if (count && first != last)
46 String str = _("Changing relative definition may cause octave change.");
47 str += "\nWas: " + first.to_string ()
48 + " -- now returning: " + last.to_string () + "\n";
50 origin()->warning (str);
53 return last;
56 ADD_MUSIC (Simultaneous_music);
58 Pitch
59 Event_chord::to_relative_octave (Pitch p)
61 return do_relative_octave (p, true);
63 ADD_MUSIC(Event_chord);