Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

Key::Key Rosegarden::Key::transpose ( int  pitchDelta,
int  heightDelta 

Transpose this key by the specified interval given in pitch and steps

For example: transposing F major by a major triad (4,2) yields A major.

Definition at line 569 of file NotationTypes.cpp.

References Rosegarden::Pitch::getPerformancePitch(), getTonicPitch(), isMinor(), Key(), and Rosegarden::Pitch::transpose().

    Pitch tonic(getTonicPitch());
    Pitch newTonic = tonic.transpose(*this, pitchDelta, heightDelta);
    int newTonicPitch = (newTonic.getPerformancePitch() % 12 + 12) % 12;
    return Key (newTonicPitch, isMinor());

Generated by  Doxygen 1.6.0   Back to index