+2004-09-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/auto-beam-engraver.cc (test_moment): robustify.
+
2004-09-28 Werner Lemberg <wl@gnu.org>
* scm/framework-tex.scm (font-load-command): Define proper font
function = scm_list_n (ly_symbol2scm ("begin"), SCM_UNDEFINED);
else
function = scm_list_n (ly_symbol2scm ("end"), SCM_UNDEFINED);
-
- Moment one_beat = *unsmob_moment (get_property ("beatLength"));
- int num = int ((*unsmob_moment (get_property ("measureLength")) / one_beat).main_part_);
- int den = one_beat.den ();
+
+ Moment beat_length (1,4);
+ if (Moment * m = unsmob_moment (get_property ("beatLength")))
+ {
+ beat_length = *m;
+ }
+ Moment measure_length (1,1);
+ int num = 4;
+ if (Moment* m = unsmob_moment (get_property ("measureLength")))
+ {
+ num = int ((*m / beat_length).main_part_);
+ }
+
+ int den = beat_length.den ();
SCM time = scm_list_n (scm_int2num (num), scm_int2num (den), SCM_UNDEFINED);
SCM type = scm_list_n (scm_int2num (test_mom.num ()),
We may have to fix this elsewhere (timing translator)
r = unsmob_moment (get_property ("measurePosition"))->mod_rat (moment);
*/
- Moment pos = * unsmob_moment (get_property ("measurePosition"));
+ Moment pos (0);
+ if (Moment *m = unsmob_moment (get_property ("measurePosition")))
+ {
+ pos = *m;
+ }
+
if (pos < Moment (0))
{
- Moment length = * unsmob_moment (get_property ("measureLength"));
+ Moment length(1);
+
+ if ( Moment *m = unsmob_moment (get_property ("measureLength")))
+ {
+ length = *m;
+ }
pos = length - pos;
}
r = pos.main_part_.mod_rat (moment.main_part_);
void
Event::transpose (Pitch delta)
{
- /*
- TODO: should change music representation such that
- _all_ pitch values are transposed automatically.
- */
-
- Pitch *p = unsmob_pitch (get_property ("pitch"));
- if (!p)
- return ;
-
- Pitch np = p->transposed (delta);
-
- if (abs (np.get_alteration ()) > DOUBLE_SHARP)
+ for (SCM s = this->get_property_alist (true); scm_is_pair (s); s = ly_cdr (s))
{
- warning (_f ("Transposition by %s makes alteration larger than two",
- delta.to_string ()));
- }
+ SCM entry = ly_car (s);
+ SCM val = ly_cdr (entry);
- set_property ("pitch", np.smobbed_copy ());
+ if (Pitch * p = unsmob_pitch (val))
+ {
+ Pitch transposed = p->transposed (delta);
+ scm_set_cdr_x (entry, transposed.smobbed_copy ());
+
+ if (abs (transposed.get_alteration ()) > DOUBLE_SHARP)
+ {
+ warning (_f ("Transposition by %s makes alteration larger than two",
+ delta.to_string ()));
+ }
+ }
+ }
}
Pitch