set_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
}
-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)
- {
- warning (_f ("Transposition by %s makes alteration larger than two",
- delta.to_string ()));
- }
-
- set_property ("pitch", np.smobbed_copy ());
-}
Pitch
Event::to_relative_octave (Pitch last)
new_pit = new_pit.to_relative_octave (last);
SCM check = get_property ("absolute-octave");
- if (ly_number_p (check) &&
- new_pit.get_octave () != ly_scm2int (check))
+ if (scm_is_number (check) &&
+ new_pit.get_octave () != scm_to_int (check))
{
- Pitch expected_pit (ly_scm2int (check),
+ Pitch expected_pit (scm_to_int (check),
new_pit.get_notename (),
new_pit.get_alteration ());
origin ()->warning (_f ("octave check failed; expected %s, found: %s",
SCM newlist = SCM_EOL;
Pitch *p = unsmob_pitch (pit);
- for (SCM s = l; ly_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
{
- SCM key = ly_caar (s);
- SCM alter = ly_cdar (s);
- if (ly_pair_p (key))
+ SCM key = scm_caar (s);
+ SCM alter = scm_cdar (s);
+ if (scm_is_pair (key))
{
- Pitch orig (ly_scm2int (ly_car (key)),
- ly_scm2int (ly_cdr (key)),
- ly_scm2int (alter));
+ Pitch orig (scm_to_int (scm_car (key)),
+ scm_to_int (scm_cdr (key)),
+ scm_to_int (alter));
orig =orig.transposed (*p);
newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
newlist);
}
- else if (ly_number_p (key))
+ else if (scm_is_number (key))
{
- Pitch orig (0, ly_scm2int (key), ly_scm2int (alter));
+ Pitch orig (0, scm_to_int (key), scm_to_int (alter));
orig = orig.transposed (*p);
key =scm_int2num (orig.get_notename ());
alist_equal_p (SCM a, SCM b)
{
for (SCM s = a;
- ly_pair_p (s); s = ly_cdr (s))
+ scm_is_pair (s); s = scm_cdr (s))
{
- SCM key = ly_caar (s);
- SCM val = ly_cdar (s);
+ SCM key = scm_caar (s);
+ SCM val = scm_cdar (s);
SCM l = scm_assoc (key, b);
if (l == SCM_BOOL_F
- || !ly_equal_p ( ly_cdr (l), val))
+ || !ly_c_equal_p ( scm_cdr (l), val))
return false;
}