Re: [frogs] Chord-name-engraver plus capo - pitches

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


 Next glitch - I'm trying to actually do the transpose ... and I don't
understand this Rational stuff :-(

The code is below:

      if (capo) {
        Pitch *p = unsmob_pitch (n->get_property ("pitch"));
        Pitch orig = p->transposed (Pitch (0, 0, -capo));
        capo_pitches = scm_cons ( orig.smobbed_copy (), capo_pitches);
      }

In my code, capo happens to be set to 3 at the moment. In other words, I
want to transpose down by three semitones. I've already discovered that
the first argument to Pitch( 0, 0, 0) takes it down three octaves. The
second takes it down three notenames. So I'm guessing that I need to
pass something in the third argument. The only problem is, what? capo is
an int and the above code simply bombs. I've found rational.hh, but my
C++fu isn't up to understanding what on earth is going on.

So, simply put, how do I describe 3 semitones as a rational, so I can
get my transposition to work?

Cheers,
Wol

---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/