X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frequest-chord.cc;h=322cf49e03ea563cd22ae24836d46b667b6b5244;hb=7cb049f7f3705e414c2a49c7cf14f43a51914c48;hp=50835d2946374b66a2cdfd18bbcaa79a7d335dae;hpb=f68bbd7a1ed1b0e7146bbbffcbcbb7f9c9bda3cc;p=lilypond.git diff --git a/lily/request-chord.cc b/lily/request-chord.cc index 50835d2946..322cf49e03 100644 --- a/lily/request-chord.cc +++ b/lily/request-chord.cc @@ -16,23 +16,32 @@ Request_chord::Request_chord () Request_chord_iterator::constructor_cxx_function); } - - Pitch Request_chord::to_relative_octave (Pitch last) { for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s)) { Music * mus = unsmob_music (ly_car (s)); - if (Melodic_req *m= dynamic_cast (mus)) + Melodic_req *m= dynamic_cast (mus); + + /* + kLudge: rests have pitches now as well. + */ + Rest_req *r = dynamic_cast (mus); + + if (r || m) { - Pitch pit = *unsmob_pitch (m->get_mus_property ("pitch")); + Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch")); + if (!old_pit) + continue; - pit.to_relative_octave (last); - m->set_mus_property ("pitch", pit.smobbed_copy ()); - - return pit; + Pitch new_pit = *old_pit; + new_pit.to_relative_octave (last); + mus->set_mus_property ("pitch", new_pit.smobbed_copy ()); + + return new_pit; } + } return last; } @@ -43,6 +52,4 @@ Request_chord::start_mom () const return Music::start_mom (); } - - ADD_MUSIC (Request_chord);