On Thursday 11 October 2007 02:14, D. Michael McIntyre wrote:
> So that leads to Key I guess?  (Why aren't Key et al. in separate files?
> NotationTypes seems like a throwback.)

Yes, it is rather.  The complete restructuring we did a while back only really 
covered the gui/ directory -- only a few hand-picked changes happened in base 
and sound.  I did split up a few files (e.g. Quantizer), but not others 
(NotationTypes, AnalysisTypes, Instrument etc).

One problem in principle with splitting up NotationTypes on a 
one-class-per-header basis is that it contains quite a few things that aren't 
actually classes.  I'm not sure whether we ought to care about that or not.  
Probably not.

> int Key::transposeFrom(int pitch, const Key &previousKey) const
> {
>     int delta = getTonicPitch() - previousKey.getTonicPitch();
>     if (delta >  6) delta -= 12;
>     if (delta < -6) delta += 12;
>     return pitch + delta;
> }

I guess this just aims to move the pitch as short a distance as possible.  I'm 
not sure that I see how anything else this function could do (on its own, 
with the data it has available at the moment) would be any more "right".

In the situation you had, you were explicitly trying to transpose in a 
particular direction, not just from one key to another key (described purely 
by key names).  That is, you didn't just want to transpose from Eb to Bb 
major, you wanted to transpose _upwards_ from Eb to Bb major.  An instrument 
playing at +5 would have wanted the results you actually got, right?

So the transpose function would need to have more information.  Whether to go 
up or down would probably be enough in practice... wouldn't it?

Bear in mind of course (as always -- as if you could forget) that I'm hopeless 
on transposing instruments.


Chris

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to