On Saturday 15 May 2010 13:31:49 Arnout Engelen wrote:
> Some parts of the Rosegarden code are 'sequencer-like' and work only with
> the pitch, ignoring the accidental, like MIDI does. For such code, it
> would be mighty confusing if 2 notes with (enharmonically) the same pitch
> (C and B#) would be considered to 'be in a different octave'.
This explains something I saw in the code but I didn't understand.
>
> I think this justifies the need for the current implementation. On the
> other hand, I agree it would be useful to have a way to get the
> 'accidental-aware' octave, too.
>
> We could add a new 'getXxxOctave()' which takes into account the
> accidental, or rename the current implementation (and references to it) to
> 'getEnharmonicOctave()' and 'fix' 'getOctave()'. implementation. Someone
> would have to come up with better names ;).
>
> The new implementation would be something like:
>
> int
> Pitch::newGetOctave(int octaveBase)
> {
> // the pitch of the note that is left when the accidental is stripped
> from // it
> int rawNotePitch = m_pitch - getPitchOffset(getAccidental(Key("C
> major")));
>
> // the octave of the note, disregarding any accidental.
> return rawNotePitch / 12 + octaveBase;
> }
>
> (untested)
I will do some test.
>
>
>
> Regards,
>
> Arnout
Thanks both for your reaction. I will have a closer look to the Music XML
export code and try to repair some issues there.
Best regards, Niek.
------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel