X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpitch-scheme.cc;h=7b4d1e39296572210efc4cf65738e2f5780b18c2;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=a1f58ae63bc0f7dfa57025cf27b52fe22287dbf6;hpb=5a3cea00a530d2f80cfce66e58dbeadbfe373bb6;p=lilypond.git diff --git a/lily/pitch-scheme.cc b/lily/pitch-scheme.cc index a1f58ae63b..7b4d1e3929 100644 --- a/lily/pitch-scheme.cc +++ b/lily/pitch-scheme.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2012 Han-Wen Nienhuys + Copyright (C) 2005--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,18 +27,18 @@ LY_DEFINE (ly_pitch_transpose, "ly:pitch-transpose", LY_ASSERT_SMOB (Pitch, p, 1); LY_ASSERT_SMOB (Pitch, delta, 2); - Pitch *t = unsmob_pitch (p); - Pitch *d = unsmob_pitch (delta); + Pitch *t = unsmob (p); + Pitch *d = unsmob (delta); return t->transposed (*d).smobbed_copy (); } LY_DEFINE (ly_make_pitch, "ly:make-pitch", 2, 1, 0, (SCM octave, SCM note, SCM alter), "@var{octave} is specified by an integer, zero for the octave" - " containing middle@tie{}C. @var{note} is a number indexing the" + " containing middle@tie{}C. @var{note} is a number indexing the" " global default scale, with 0 corresponding to pitch@tie{}C" - " and 6 usually corresponding to pitch@tie{}B. " - " Optional @var{alter} is" + " and 6 usually corresponding to pitch@tie{}B." + " Optional @var{alter} is" " a rational number of 200-cent whole tones for alteration.") { @@ -59,7 +59,7 @@ LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0, "Negate @var{p}.") { LY_ASSERT_SMOB (Pitch, p, 1); - Pitch *pp = unsmob_pitch (p); + Pitch *pp = unsmob (p); return pp->negated ().smobbed_copy (); } @@ -69,7 +69,7 @@ LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0, " pitch@tie{}@var{p}.") { LY_ASSERT_SMOB (Pitch, p, 1); - Pitch *pp = unsmob_pitch (p); + Pitch *pp = unsmob (p); return scm_from_int (pp->steps ()); } @@ -78,7 +78,7 @@ LY_DEFINE (ly_pitch_octave, "ly:pitch-octave", "Extract the octave from pitch@tie{}@var{pp}.") { LY_ASSERT_SMOB (Pitch, pp, 1); - Pitch *p = unsmob_pitch (pp); + Pitch *p = unsmob (pp); int q = p->get_octave (); return scm_from_int (q); } @@ -88,7 +88,7 @@ LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration", "Extract the alteration from pitch@tie{}@var{pp}.") { LY_ASSERT_SMOB (Pitch, pp, 1); - Pitch *p = unsmob_pitch (pp); + Pitch *p = unsmob (pp); Rational q = p->get_alteration (); return ly_rational2scm (q); @@ -99,28 +99,27 @@ LY_DEFINE (ly_pitch_notename, "ly:pitch-notename", "Extract the note name from pitch @var{pp}.") { LY_ASSERT_SMOB (Pitch, pp, 1); - Pitch *p = unsmob_pitch (pp); + Pitch *p = unsmob (pp); int q = p->get_notename (); return scm_from_int (q); } LY_DEFINE (ly_pitch_tones, "ly:pitch-tones", - 1, 0, 0, (SCM pp), + 1, 0, 0, (SCM pp), "Calculate the number of tones of@tie{}@var{pp} from" " middle@tie{}C as a rational number.") { LY_ASSERT_SMOB (Pitch, pp, 1); - return ly_rational2scm (unsmob_pitch (pp)->tone_pitch ()); + return ly_rational2scm (unsmob (pp)->tone_pitch ()); } - LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones", 1, 0, 0, (SCM pp), "Calculate the number of quarter tones of@tie{}@var{pp} from" " middle@tie{}C.") { LY_ASSERT_SMOB (Pitch, pp, 1); - Pitch *p = unsmob_pitch (pp); + Pitch *p = unsmob (pp); int q = p->rounded_quartertone_pitch (); return scm_from_int (q); } @@ -131,7 +130,7 @@ LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones", " middle@tie{}C.") { LY_ASSERT_SMOB (Pitch, pp, 1); - Pitch *p = unsmob_pitch (pp); + Pitch *p = unsmob (pp); int q = p->rounded_semitone_pitch (); return scm_from_int (q); } @@ -143,8 +142,8 @@ LY_DEFINE (ly_pitch_less_p, "ly:pitch (p1); + Pitch *b = unsmob (p2); if (Pitch::compare (*a, *b) < 0) return SCM_BOOL_T; @@ -154,15 +153,15 @@ LY_DEFINE (ly_pitch_less_p, "ly:pitch (pitch); + Pitch *r = unsmob (root); return pitch_interval (*r, *p).smobbed_copy (); } @@ -173,11 +172,11 @@ LY_DEFINE (ly_set_middle_C_x, "ly:set-middle-C!", 1, 0, 0, (SCM context), "Set the @code{middleCPosition} variable in @var{context}" " based on the variables @code{middleCClefPosition} and" - " middleCOffset.") + " @code{middleCOffset}.") { LY_ASSERT_SMOB (Context, context, 1); - Context *c = unsmob_context (context); + Context *c = unsmob (context); int clef_pos = robust_scm2int (c->get_property ("middleCClefPosition"), 0); int offset = robust_scm2int (c->get_property ("middleCOffset"), 0); /* middleCCuePosition overrides the clef! */