コード例 #1
0
ファイル: transpose.cpp プロジェクト: tedfelix/rosegarden
void TestTranspose::testTransposeBbToF()
{
    Pitch bb(70, Accidentals::Flat);
    Key besmaj("Bb major");
    Pitch result = bb.transpose(besmaj, -5, -3);

    Accidental resultAccidental = result.getAccidental(besmaj);
    int resultPitch = result.getPerformancePitch();
    QCOMPARE(resultAccidental, Accidentals::NoAccidental);
    QCOMPARE(resultPitch, 65);
}
コード例 #2
0
ファイル: transpose.cpp プロジェクト: tedfelix/rosegarden
/** 
 * transpose an C# down by an augmented prime in C# major, should yield a C (in C major)
 */
void TestTranspose::testCisToC()
{
    // Testing transposing C# to C

    Pitch cis(73, Accidentals::Sharp);
    Pitch result = cis.transpose(Key("C# major"), -1, 0);

    Accidental resultAccidental = result.getAccidental(Key("C major"));
    int resultPitch = result.getPerformancePitch();
    QCOMPARE(resultAccidental, Accidentals::NoAccidental);
    QCOMPARE(resultPitch, 72);
}
コード例 #3
0
ファイル: transpose.cpp プロジェクト: tedfelix/rosegarden
/**
 * Transpose G to D in the key of D major.
 */
void TestTranspose::testGToD()
{
    // Testing transposing G to D
    Pitch g(67, Accidentals::Natural);
    Key* dmaj = new Key("D major");

    Pitch result = g.transpose(*dmaj, 7, 4);

    Accidental resultAccidental = result.getAccidental(*dmaj);
    int resultPitch = result.getPerformancePitch();
    QCOMPARE(resultAccidental, Accidentals::NoAccidental);
    QCOMPARE(resultPitch, 74);
}
コード例 #4
0
ファイル: transpose.cpp プロジェクト: tedfelix/rosegarden
/** 
 * transpose an A# up by a major second, should 
 * yield a B# (as C would be a minor triad) 
 */
void TestTranspose::testAisToBis()
{
    // Testing transposing A# to B#
    Pitch ais(70, Accidentals::Sharp);
    Key cmaj ("C major");

    Pitch result = ais.transpose(cmaj, 2, 1);

    Accidental resultAccidental = result.getAccidental(cmaj);
    int resultPitch = result.getPerformancePitch();
    QCOMPARE(resultAccidental, Accidentals::Sharp);
    QCOMPARE(resultPitch, 72);
}