On Friday 01 November 2013 08:46:22 D. Michael McIntyre wrote:
> 
> It's about half likely you just solved a problem I've been chasing for a
> long time.  I'll be very amused if that proves to be the case.

It seems to me the problem is in SegmentSyncCommand in lines 77 and 78:

int oldHeight = Pitch(segment.getTranspose()).getHeightOnStaff(....);
int newHeight = Pitch(newTranspose).getHeightOnStaff(...);

Both segment.getTranspose() and newTranspose might be less then zero yielding 
an invalid pitch. Simple solution, use an offset for both, like:

int oldHeight = Pitch(60+segment.getTranspose()).getHeightOnStaff(....);
int newHeight = Pitch(60+newTranspose).getHeightOnStaff(...);

Since we are interested in the difference, this common offset won't harm but is 
make sure the pitch will be positive (unless we have to transpose over 5 
octaves which is very unlikely :-)).
A quick test in "my" NewChords branch this solution seems to solve this issue 
(and also the transposed chords are okay now).

Best regards,

Niek



------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to