lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Wols Lists
Subject: Re: [frogs] Chord-name-engraver plus capo - pitches
Date: Fri, 27 Aug 2010 00:42:43 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100727 Thunderbird/3.1.1

 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]