From 108c107d70a3cc48efd9f734a153ff82aac8fbb4 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 16 Jan 2005 18:31:36 +0000 Subject: [PATCH] * lily/include/repeated-music.hh (class Repeated_music): change into "namespace" class. * lily/event.cc: remove Key_change_event. * lily/include/transposed-music.hh (class Transposed_music): remove. * lily/transposed-music.cc: remove * lily/include/relative-music.hh: remove. * lily/include/music-sequence.hh (struct Music_sequence): change into "namespace" class. * lily/untransposable-music.cc (Module): remove * lily/include/un-relativable-music.hh (Module): remove * lily/include/untransposable-music.hh (Module): remove * lily/un-relativable-music.cc: remove file. --- ChangeLog | 5 ++ lily/chord-tremolo-engraver.cc | 32 ++++----- lily/chord-tremolo-iterator.cc | 5 +- lily/event.cc | 12 ---- lily/folded-repeat-iterator.cc | 12 ++-- lily/include/event.hh | 15 ---- lily/include/music-sequence.hh | 1 + lily/include/music.hh | 5 +- lily/include/repeated-music.hh | 19 ++---- lily/key-performer.cc | 23 ++++--- lily/music.cc | 33 ++++++--- lily/percent-repeat-engraver.cc | 13 ++-- lily/percent-repeat-iterator.cc | 4 +- lily/relative-octave-music.cc | 2 +- lily/repeated-music.cc | 117 +++++++++++++++----------------- lily/slash-repeat-engraver.cc | 19 ++---- 16 files changed, 146 insertions(+), 171 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa7b5bbd83..ca13b974a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-01-16 Han-Wen Nienhuys + * lily/include/repeated-music.hh (class Repeated_music): change + into "namespace" class. + + * lily/event.cc: remove Key_change_event. + * lily/include/transposed-music.hh (class Transposed_music): remove. * lily/transposed-music.cc: remove diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index e2f5d9516f..382bf8a4c4 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -41,7 +41,7 @@ class Chord_tremolo_engraver : public Engraver void typeset_beam (); TRANSLATOR_DECLARATIONS (Chord_tremolo_engraver); protected: - Repeated_music * repeat_; + Music * repeat_; /// moment (global time) where beam started. Moment start_mom_; @@ -52,7 +52,7 @@ protected: /// location within measure where beam started. Moment beam_start_location_; - bool sequential_body_b_; + bool body_is_sequential_; Spanner * beam_; Spanner * finished_beam_; Item * stem_tremolo_; @@ -71,37 +71,37 @@ Chord_tremolo_engraver::Chord_tremolo_engraver () repeat_ = 0; flags_ = 0; stem_tremolo_ = 0; - sequential_body_b_ = false; + body_is_sequential_ = false; } bool Chord_tremolo_engraver::try_music (Music * m) { - Repeated_music * rp = dynamic_cast (m); - if (rp - && rp->get_property ("iterator-ctor") == Chord_tremolo_iterator::constructor_proc + if (m->is_mus_type ("repeated-music") + && m->get_property ("iterator-ctor") == Chord_tremolo_iterator::constructor_proc && !repeat_) { - Moment l = rp->get_length (); - repeat_ = rp; + Moment l = m->get_length (); + repeat_ = m; start_mom_ = now_mom (); stop_mom_ = start_mom_ + l; - - sequential_body_b_ = rp->body()->is_mus_type ("sequential-music"); - int elt_count = sequential_body_b_ ? scm_ilength (rp->body()->get_property ("elements")) : 1; + Music *body = Repeated_music::body (m); + body_is_sequential_ = body->is_mus_type ("sequential-music"); + + int elt_count = body_is_sequential_ ? scm_ilength (body->get_property ("elements")) : 1; - if (sequential_body_b_ && elt_count != 2) + if (body_is_sequential_ && elt_count != 2) { - rp->origin ()->warning (_f ("Chord tremolo with %d elements. Must have two elements.", elt_count)); + m->origin ()->warning (_f ("Chord tremolo with %d elements. Must have two elements.", elt_count)); } if (elt_count <= 0) elt_count = 1; Rational total_dur = l.main_part_; - Rational note_dur = total_dur / Rational (elt_count * repeat_->repeat_count ()); + Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_)); total_duration_flags_ = 0 >? (intlog2 (total_dur.den ()) - 2); @@ -116,7 +116,7 @@ Chord_tremolo_engraver::try_music (Music * m) void Chord_tremolo_engraver::process_music () { - if (repeat_ && sequential_body_b_ && !beam_) + if (repeat_ && body_is_sequential_ && !beam_) { beam_ = make_spanner ("Beam", repeat_->self_scm ()); beam_->set_property ("chord-tremolo", SCM_BOOL_T); @@ -173,7 +173,7 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info) } } else if (repeat_ && - flags_ && !sequential_body_b_ && Stem::has_interface (info.grob_)) + flags_ && !body_is_sequential_ && Stem::has_interface (info.grob_)) { stem_tremolo_ = make_item ("StemTremolo", repeat_->self_scm ()); stem_tremolo_->set_property ("flag-count", diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 36e8697426..e698183f40 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -21,9 +21,10 @@ void Chord_tremolo_iterator::construct_children () { - Repeated_music * rep = dynamic_cast (get_music ()); + Music *m = get_music(); + factor_ = Moment (Rational (1, 1)); - child_iter_ = unsmob_iterator (get_iterator (rep->body ())); + child_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (m))); } Chord_tremolo_iterator::Chord_tremolo_iterator () diff --git a/lily/event.cc b/lily/event.cc index c11c2b0ac7..848162fda6 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -35,17 +35,5 @@ Event::Event (SCM i) ADD_MUSIC (Event); -Key_change_ev::Key_change_ev (SCM x) - : Event (x) -{ -} -void -Key_change_ev::transpose (Pitch p) -{ - SCM pa = get_property ("pitch-alist"); - set_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy ())); - Event::transpose (p); -} -ADD_MUSIC (Key_change_ev); diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index eaa110c5a8..9f180c4b5e 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -46,8 +46,8 @@ Folded_repeat_iterator::pending_moment () const void Folded_repeat_iterator::construct_children () { - Repeated_music * mus = dynamic_cast (get_music ()); - main_iter_ = unsmob_iterator (get_iterator (mus->body ())); + Music *mus = get_music (); + main_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (mus))); if (!main_iter_->ok ()) { leave_body (); @@ -91,18 +91,18 @@ Folded_repeat_iterator::process (Moment m) void Folded_repeat_iterator::leave_body () { - Repeated_music * mus = dynamic_cast (get_music ()); + Music *mus = get_music (); main_iter_->quit (); main_iter_ = 0; - main_length_mom_ += mus->body ()->get_length (); + main_length_mom_ += Repeated_music::body (mus)->get_length (); } void Folded_repeat_iterator::enter_alternative () { - Repeated_music * mus = dynamic_cast (get_music ()); - if (mus->alternatives ()) + Music *mus = get_music (); + if (scm_is_pair (Repeated_music::alternatives (mus))) { /* ugh. diff --git a/lily/include/event.hh b/lily/include/event.hh index 2c3272552d..470fef4fec 100644 --- a/lily/include/event.hh +++ b/lily/include/event.hh @@ -26,21 +26,6 @@ public: }; -/** - Handle key changes. -*/ -class Key_change_ev : public Event -{ -public: - Key_change_ev (SCM); - SCM pitch_alist (); - -protected: - VIRTUAL_COPY_CONSTRUCTOR (Music, Key_change_ev); - void transpose (Pitch d); -}; - -SCM ly_transpose_key_alist (SCM,SCM); diff --git a/lily/include/music-sequence.hh b/lily/include/music-sequence.hh index 398c20297d..bff8922fbc 100644 --- a/lily/include/music-sequence.hh +++ b/lily/include/music-sequence.hh @@ -30,6 +30,7 @@ public: static Moment minimum_start (SCM list); }; +SCM ly_transpose_key_alist (SCM l, SCM pit); Pitch music_list_to_relative (SCM l,Pitch p, bool ret_first); void transpose_music_list (SCM , Pitch); void compress_music_list (SCM, Moment); diff --git a/lily/include/music.hh b/lily/include/music.hh index c8fec91cd5..4f66611355 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -28,12 +28,13 @@ public: SCM internal_get_property (SCM) const; void internal_set_property (SCM , SCM val); - SCM get_property_alist (bool mut) const; + SCM get_property_alist (bool mutble) const; bool internal_is_music_type (SCM) const; int duration_log () const; DECLARE_SCHEME_CALLBACK(relative_callback,(SCM,SCM)); - virtual Pitch to_relative_octave (Pitch); + Pitch to_relative_octave (Pitch); + Pitch generic_to_relative_octave (Pitch); String name () const; Moment get_length () const; Moment start_mom () const; diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index 7d8141dc4f..bd6e7aea9d 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -46,24 +46,19 @@ the first alternative is assumed to be repeated. */ -class Repeated_music : public Music +class Repeated_music { public: - Repeated_music (SCM); - VIRTUAL_COPY_CONSTRUCTOR (Music, Repeated_music); - - Music *body () const; - SCM alternatives () const; + static Music *body (Music*); + static SCM alternatives (Music*); /* How often do we repeat? */ - int repeat_count () const; + static int repeat_count (Music*); DECLARE_SCHEME_CALLBACK(relative_callback,(SCM,SCM)); - virtual Pitch to_relative_octave (Pitch); - - Moment body_get_length () const; - Moment alternatives_get_length (bool fold) const; - Moment alternatives_volta_get_length () const; + static Moment body_get_length (Music*); + static Moment alternatives_get_length (Music *, bool fold); + static Moment alternatives_volta_get_length (Music *); DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM)); DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM)); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 92f8f16f66..f77c1dfce3 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -6,6 +6,7 @@ (c) 1997--2004 Jan Nieuwenhuizen */ +#include "music-sequence.hh" #include "audio-item.hh" #include "performer.hh" #include "warn.hh" @@ -17,18 +18,18 @@ public: ~Key_performer (); protected: - virtual bool try_music (Music* req); + virtual bool try_music (Music* ev); virtual void create_audio_elements (); virtual void stop_translation_timestep (); private: - Key_change_ev* key_req_; + Event* key_ev_; Audio_key* audio_; }; Key_performer::Key_performer () { - key_req_ = 0; + key_ev_ = 0; audio_ = 0; } @@ -39,9 +40,9 @@ Key_performer::~Key_performer () void Key_performer::create_audio_elements () { - if (key_req_) + if (key_ev_) { - SCM pitchlist = key_req_->get_property ("pitch-alist"); + SCM pitchlist = key_ev_->get_property ("pitch-alist"); SCM proc = ly_lily_module_constant ("alterations-in-key"); SCM acc = scm_call_1 (proc, pitchlist); @@ -62,9 +63,9 @@ Key_performer::create_audio_elements () audio_ = new Audio_key (scm_to_int (acc), SCM_BOOL_T != scm_equal_p (minor, c_pitchlist)); - Audio_element_info info (audio_, key_req_); + Audio_element_info info (audio_, key_ev_); announce_element (info); - key_req_ = 0; + key_ev_ = 0; } } @@ -79,14 +80,14 @@ Key_performer::stop_translation_timestep () } bool -Key_performer::try_music (Music* req) +Key_performer::try_music (Music* ev) { - if (Key_change_ev *kc = dynamic_cast (req)) + if (Event *kc = dynamic_cast (ev)) { - if (key_req_) + if (key_ev_) warning (_ ("FIXME: key change merge")); - key_req_ = kc; + key_ev_ = kc; return true; } diff --git a/lily/music.cc b/lily/music.cc index 04ab151b25..13ca15e542 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -157,15 +157,8 @@ Music::print_smob (SCM s, SCM p, scm_print_state*) } Pitch -Music::to_relative_octave (Pitch last) +Music::generic_to_relative_octave (Pitch last) { - SCM callback = get_property ("to-relative-callback"); - if (ly_c_procedure_p (callback)) - { - Pitch * p = unsmob_pitch (scm_call_2 (callback, self_scm(), last.smobbed_copy ())); - return *p; - } - SCM elt = get_property ("element"); Pitch *old_pit = unsmob_pitch (get_property ("pitch")); if (old_pit) @@ -191,7 +184,6 @@ Music::to_relative_octave (Pitch last) last = new_pit; } - if (Music *m = unsmob_music (elt)) last = m->to_relative_octave (last); @@ -199,6 +191,19 @@ Music::to_relative_octave (Pitch last) return last; } +Pitch +Music::to_relative_octave (Pitch last) +{ + SCM callback = get_property ("to-relative-callback"); + if (ly_c_procedure_p (callback)) + { + Pitch * p = unsmob_pitch (scm_call_2 (callback, self_scm(), last.smobbed_copy ())); + return *p; + } + + return generic_to_relative_octave (last); +} + void Music::compress (Moment factor) { @@ -243,6 +248,16 @@ Music::transpose (Pitch delta) m->transpose (delta); transpose_music_list (get_property ("elements"), delta); + + /* + UGH - how do this more generically? + */ + SCM pa = get_property ("pitch-alist"); + if (scm_is_pair (pa)) + { + set_property ("pitch-alist", ly_transpose_key_alist (pa, delta.smobbed_copy ())); + } + } IMPLEMENT_TYPE_P (Music, "ly:music?"); diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc index 118d59100f..5806360308 100644 --- a/lily/percent-repeat-engraver.cc +++ b/lily/percent-repeat-engraver.cc @@ -34,7 +34,7 @@ class Percent_repeat_engraver : public Engraver public: TRANSLATOR_DECLARATIONS (Percent_repeat_engraver); protected: - Repeated_music * repeat_; + Music *repeat_; /// moment (global time) where beam started. Moment start_mom_; @@ -74,14 +74,13 @@ Percent_repeat_engraver::Percent_repeat_engraver () bool Percent_repeat_engraver::try_music (Music * m) { - Repeated_music * rp = dynamic_cast (m); - if (rp - && rp->get_property ("iterator-ctor") + if (m->is_mus_type ("repeated-music") + && m->get_property ("iterator-ctor") == Percent_repeat_iterator::constructor_proc && !repeat_) { - body_length_ = rp->body_get_length (); - int count = rp->repeat_count (); + body_length_ = Repeated_music::body_get_length (m); + int count = Repeated_music::repeat_count (m); Moment now = now_mom (); start_mom_ = now; @@ -102,7 +101,7 @@ Percent_repeat_engraver::try_music (Music * m) return false; } - repeat_ = rp; + repeat_ = m; Global_context *global = get_global_context (); diff --git a/lily/percent-repeat-iterator.cc b/lily/percent-repeat-iterator.cc index 56b477b45e..107e1dd63d 100644 --- a/lily/percent-repeat-iterator.cc +++ b/lily/percent-repeat-iterator.cc @@ -36,9 +36,9 @@ Percent_repeat_iterator::ok () const void Percent_repeat_iterator::construct_children () { - Repeated_music * mus = dynamic_cast (get_music ()); + Music *mus = get_music (); finish_mom_ = mus->get_length (); - child_iter_ = unsmob_iterator (get_iterator (mus->body ())); + child_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (mus))); } diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index 3732808d09..ef090a9ef7 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -38,7 +38,7 @@ Relative_octave_music::relative_callback (SCM music, SCM pitch) lily_1_8_compatibility_used = true; /* last-pitch should be junked some time, when we ditch 1.8 compat too. -cvs- + When you do, B should start where A left off. \relative { A \relative { ...} B } */ diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 3773567913..3a527c151a 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -14,61 +14,68 @@ #include "scm-option.hh" Music * -Repeated_music::body ()const +Repeated_music::body (Music *me) { - return unsmob_music (get_property ("element")); + return unsmob_music (me->get_property ("element")); } SCM -Repeated_music::alternatives ()const +Repeated_music::alternatives (Music *me) { - return get_property ("elements"); + return me->get_property ("elements"); } -Pitch -Repeated_music::to_relative_octave (Pitch p) +MAKE_SCHEME_CALLBACK(Repeated_music,relative_callback, 2); +SCM +Repeated_music::relative_callback (SCM music, SCM pitch) { + Pitch p = *unsmob_pitch (pitch); + Music *me = unsmob_music (music); if (lily_1_8_relative) { - if (body ()) - p = body ()->to_relative_octave (p); + Music *body = unsmob_music (me->get_property ("element")); + if (body) + p = body->to_relative_octave (p); - Pitch last = p ; - if (alternatives ()) - { - lily_1_8_compatibility_used = true; + Pitch last = p ; + SCM alternatives = me->get_property ("elements"); - for (SCM s = alternatives (); scm_is_pair (s); s = scm_cdr (s)) - unsmob_music (scm_car (s))->to_relative_octave (p); - } + for (SCM s = alternatives; scm_is_pair (s); s = scm_cdr (s)) + { + lily_1_8_compatibility_used = true; + unsmob_music (scm_car (s))->to_relative_octave (p); + } - return last; + return last.smobbed_copy (); } else { - return Music::to_relative_octave (p); + return me->generic_to_relative_octave (p).smobbed_copy (); } } Moment -Repeated_music::alternatives_get_length (bool fold) const +Repeated_music::alternatives_get_length (Music *me, bool fold) { - if (!alternatives ()) + SCM alternative_list = alternatives (me); + int len = scm_ilength (alternative_list); + if (len <= 0) return 0; if (fold) - return Music_sequence::maximum_length (alternatives ()); + return Music_sequence::maximum_length (alternative_list); Moment m = 0; int done = 0; + int count = robust_scm2int (me->get_property ("repeat-count"), 0); - SCM p = alternatives (); - while (scm_is_pair (p) && done < repeat_count ()) + SCM p = alternative_list; + while (scm_is_pair (p) && done < count) { m = m + unsmob_music (scm_car (p))->get_length (); done ++; - if (repeat_count () - done < scm_ilength (alternatives ())) + if (count - done < len) p = scm_cdr (p); } return m; @@ -79,19 +86,9 @@ Repeated_music::alternatives_get_length (bool fold) const of volta repeats, where the alternatives are iterated just as they were entered. */ Moment -Repeated_music::alternatives_volta_get_length () const +Repeated_music::alternatives_volta_get_length (Music *me) { - if (!alternatives ()) - return 0; - - Moment m; - SCM p = alternatives (); - while (scm_is_pair (p)) - { - m = m + unsmob_music (scm_car (p))->get_length (); - p = scm_cdr (p); - } - return m; + return Music_sequence::cumulative_length (alternatives (me)); } @@ -99,67 +96,59 @@ Repeated_music::alternatives_volta_get_length () const Length of the body in THIS. Disregards REPEAT-COUNT. */ Moment -Repeated_music::body_get_length () const +Repeated_music::body_get_length (Music *me) { Moment m = 0; - if (body ()) + if (Music *body = unsmob_music (me->get_property ("element"))) { - m = body ()->get_length (); + m = body->get_length (); } return m; } -int -Repeated_music::repeat_count () const -{ - return scm_to_int (get_property ("repeat-count")); -} - MAKE_SCHEME_CALLBACK (Repeated_music,unfolded_music_length, 1); -MAKE_SCHEME_CALLBACK (Repeated_music,folded_music_length, 1); -MAKE_SCHEME_CALLBACK (Repeated_music,volta_music_length, 1); SCM Repeated_music::unfolded_music_length (SCM m) { - Repeated_music* r = dynamic_cast (unsmob_music (m)); - - Moment l = Moment (r->repeat_count ()) * r->body_get_length () + r->alternatives_get_length (false); + Music *me = unsmob_music (m); + + Moment l = Moment (repeat_count (me)) * body_get_length (me) + alternatives_get_length (me, false); return l.smobbed_copy (); } +MAKE_SCHEME_CALLBACK (Repeated_music,folded_music_length, 1); SCM Repeated_music::folded_music_length (SCM m) { - Repeated_music* r = dynamic_cast (unsmob_music (m)); - - Moment l = r->body_get_length () + r->alternatives_get_length (true); + Music *me = unsmob_music (m); + + Moment l = body_get_length (me) + alternatives_get_length (me, true); return l.smobbed_copy (); } -SCM -Repeated_music::volta_music_length (SCM m) +int +Repeated_music::repeat_count (Music *me) { - Repeated_music* r = dynamic_cast (unsmob_music (m)); - Moment l = r->body_get_length () + r->alternatives_volta_get_length (); - return l.smobbed_copy (); + return scm_to_int (me->get_property ("repeat-count")); } -ADD_MUSIC (Repeated_music); - -Repeated_music::Repeated_music (SCM x) - : Music (x) +MAKE_SCHEME_CALLBACK (Repeated_music,volta_music_length, 1); +SCM +Repeated_music::volta_music_length (SCM m) { + Music *me = unsmob_music (m); + Moment l = body_get_length (me) + alternatives_volta_get_length (me); + return l.smobbed_copy (); } - MAKE_SCHEME_CALLBACK (Repeated_music,minimum_start, 1); SCM Repeated_music::minimum_start (SCM m) { - Music * me = unsmob_music (m); - Music * body = unsmob_music (me->get_property ("element")); + Music *me = unsmob_music (m); + Music *body = unsmob_music (me->get_property ("element")); if (body) return body->start_mom ().smobbed_copy (); diff --git a/lily/slash-repeat-engraver.cc b/lily/slash-repeat-engraver.cc index 7020be066f..3f1614f6cd 100644 --- a/lily/slash-repeat-engraver.cc +++ b/lily/slash-repeat-engraver.cc @@ -33,7 +33,7 @@ class Slash_repeat_engraver : public Engraver public: TRANSLATOR_DECLARATIONS (Slash_repeat_engraver); protected: - Repeated_music * repeat_; + Music *repeat_; /// moment (global time) where beam started. Moment start_mom_; @@ -62,30 +62,25 @@ Slash_repeat_engraver::Slash_repeat_engraver () bool Slash_repeat_engraver::try_music (Music * m) { - Repeated_music * rp = dynamic_cast (m); - if (rp + if (m->is_mus_type ("repeated-music") && !repeat_ - && rp->get_property ("iterator-ctor") + && m->get_property ("iterator-ctor") == Percent_repeat_iterator::constructor_proc) { - body_length_ = rp->body_get_length (); - int count = rp->repeat_count (); + body_length_ = Repeated_music::body_get_length (m); + int count = Repeated_music::repeat_count (m); Moment now = now_mom (); start_mom_ = now; stop_mom_ = start_mom_ + Moment (count) * body_length_; next_moment_ = start_mom_ + body_length_; - SCM m = get_property ("measureLength"); - Moment meas_len; - if (Moment *mp = unsmob_moment (m)) - meas_len = *mp; - + Moment meas_len = robust_scm2moment (m->get_property ("measureLength"), Moment (0)); if (body_length_ < meas_len && meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (Rational (0,0))) { - repeat_ = rp; + repeat_ = m; } else return false; -- 2.39.5