lilypond-devel
[Top][All Lists]
Advanced

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

Re: Chromatic transposition -- a very small starting step


From: Joseph Wakeling
Subject: Re: Chromatic transposition -- a very small starting step
Date: Fri, 09 Jul 2010 22:02:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5

Neil -- thanks ever so much for the detailed explanations.

> Take a look at lily/music.cc to see where the transposition takes place.

The transpose_mutable() function seems to be where it's at ... :-)

I note the following lines which are surely responsible for cleaning up
anything larger than a double flat:

  if (transposed.get_alteration ().abs () > Rational (1,1))
    {
      string delta_str;
      if (delta.get_alteration ().abs () > Rational (1, 1))
        delta_str = (delta.normalized ().to_string ()
                         + " " + _ ("(normalized pitch)"));
      else
        delta_str = delta.to_string ();

      warning (_f ("Transposing %s by %s makes alteration
                   larger than double",
                   p->to_string (), delta_str));
      transposed = transposed.normalized ();
    }

So, thinking about the way to implement the various chromatic
transpositions, what seems natural is that once new_val has been
generated in the transpose_mutable() function, to run through one of the
naturalize-pitch Scheme functions (or perhaps a C++ version of it).

Anyway, first port of call, I'm going to try and implement those toohigh
and toolow options for the naturalize-pitch Scheme function...



reply via email to

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